From nobody Wed May 15 19:22:26 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=1671228657; cv=none; d=zohomail.com; s=zohoarc; b=N9Vv8dYbphjkOwvtlVQE37iPO/2RAvJTyYZFdXpHidMgZXza5BCAPtdbMBSAYso9gEajHzojR2s6RC1g4771cuuItJnN/NaerENhk3T8G2CJKNyCUrhSu5sGPjk8bZg4nhlgO1yvHu9dpQnn10T3FWtAAPXHL5GKGcQyhAr89tM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228657; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VztGF32a3KriOcGzpvK3NxYNTE7OoAN19xqfTq2WZ4s=; b=aPQW4qAic32yCcAcO4hR4hPGglvz4Jb3JnbZPZV9u3dhXtOqpeiO+MdL8tXc0g+aoHveYegxZI0JQ3+0El838dFBkpZPvioa3MCfMfH9rZ0odrJnqXsOwM8dQIp+M+3ULTnnSgPo3YS9cGaDYTpMcRTCEAUJRXoP9qiShAyzCnw= 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 1671228657331520.96135095182; Fri, 16 Dec 2022 14:10:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU1-0005zX-25; Fri, 16 Dec 2022 16:43: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 1p6ITj-0005vL-E1 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:53 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITg-0000ag-Uu for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:50 -0500 Received: by mail-wm1-x330.google.com with SMTP id ay14-20020a05600c1e0e00b003cf6ab34b61so5001037wmb.2 for ; Fri, 16 Dec 2022 13:42:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=VztGF32a3KriOcGzpvK3NxYNTE7OoAN19xqfTq2WZ4s=; b=hkrEwZeqSY3AbJL8JNf9sEqouXYxmQER+aBwTc93FOKBPHa9NJQWLJh5KcXFbFhvIw 2At5DZzlRXieDTVpZ/tZFcqu5WK3255/8ApmFrwlf5X30CsTF/cK2ckAmWLzPfqXCYx4 5ozVovpmX5cqA9wEtzEM7BtI2HEnHcBptY5DAO0jI6HD/79URPCQc3xanFu1j0Ot4iy6 2SYo+OvrvrTT0LJmNiotRDnyKdDCZAhd7Jp32QQfIGzRBITjc75eYuiKP4WZziNEKGb5 YIZPdtZLl+7Nb6TltXAL7IVeSwalaxXUyNep3x/6lCEyizdrXbYbLIu/w8cK688Ubcy1 SdVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=VztGF32a3KriOcGzpvK3NxYNTE7OoAN19xqfTq2WZ4s=; b=zwey4XMU73tHJAHCgxnUmVADSAnmevQngiZweT2tJwHBoq9pDWQ7UCjuQS73c+48tm M39c4NGvNcyBJOTbY10CoaJKp1SD2OlSuKnRyYMa4/12iwBoQnjp4pE7CqhsgC5kTATi 21Nso0YtM29q4EL1mGh0f6JKse31gISymYRMcPcYDD+Qvcm0TeZmZJ984aCqWoasDYw8 o6R5+9gzlfs8MSF+r1f7evnu4jTzLuROZVzEGDA7vCcG+ISKMRp++waPPm9vYoPeMY6j zYi74nyuHcDt8dcIXQpPTBkeFj4qn5/2o79pWGnovynbB79VvaRvlwmPdyJcvJjtNtD2 iiOQ== X-Gm-Message-State: ANoB5pktq1+YUNE063Qo5gekOwVOTHGCBD3Yi9yTY5d2knWGntuQRhfx otb3vhrKOiow025DMmw0BYlAjUSs9zN2Jyit X-Google-Smtp-Source: AA0mqf49wyLdi22C8D9kC8oLdM1SxX84gB9Nq9ywNbPT5mr/09oOaCaCy/E75EJQlDBOdLpgLvlWyg== X-Received: by 2002:a05:600c:2252:b0:3d2:196c:270c with SMTP id a18-20020a05600c225200b003d2196c270cmr20402078wmm.31.1671226967308; Fri, 16 Dec 2022 13:42:47 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/36] hw/s390x/s390-pci-inst.c: Use device_cold_reset() to reset PCI devices Date: Fri, 16 Dec 2022 21:42:09 +0000 Message-Id: <20221216214244.1391647-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671228657805100001 Content-Type: text/plain; charset="utf-8" The semantic difference between the deprecated device_legacy_reset() function and the newer device_cold_reset() function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. In s390-pci-inst.c we use device_legacy_reset() to reset an S390PCIBusDevice. This device doesn't have any child qbuses, so the functions do the same thing and we can stop using the deprecated one. Reviewed-by: Matthew Rosato Signed-off-by: Peter Maydell --- hw/s390x/s390-pci-inst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 66e764f9016..9abe95130c5 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -272,7 +272,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_= t ra) stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FHOP); goto out; } - device_legacy_reset(DEVICE(pbdev)); + device_cold_reset(DEVICE(pbdev)); pbdev->fh &=3D ~FH_MASK_ENABLE; pbdev->state =3D ZPCI_FS_DISABLED; stl_p(&ressetpci->fh, pbdev->fh); --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228773; cv=none; d=zohomail.com; s=zohoarc; b=Pkqbqfx7SdtsV0c4MnpLBka+HIJ+OyCEmHAMSFmnWqOMXkhReQW8qd4V2zIQFNBuyf3RfYvnZRPbakVTj7VDZEIkq6p7Ke5bF+w5LiRoLpkT83zK87F5ywAQxnilydeTASptDUif8Gbrj8ehCiCrp8QdmoaMWX09iZaS0ZQ7jro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228773; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w2wDSdFPCVKSJxok1ajjwKeJYPQLxC628rf9HNcdV6c=; b=Ka1AnXhgo6DLRj2yyHrJDW0gI04KD9egTeh0S8mKodr7AecFNI+W7XWj14V2xRLpMiXYTKKywUVvMC4iIzT6Ziz9tJ7aWqxlNtn/3khhdQpEJv0KGx7eQ4t8z97tFX5SBmRLTWJPOfQ1BnHnWPr7Miyjj919GEZvW8qpuIfFOhc= 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 1671228773487115.87532235636093; Fri, 16 Dec 2022 14:12:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU6-00062J-8J; Fri, 16 Dec 2022 16:43:14 -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 1p6ITn-0005vt-43 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:00 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITi-0000aj-Gb for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:52 -0500 Received: by mail-wm1-x329.google.com with SMTP id bg10so2757352wmb.1 for ; Fri, 16 Dec 2022 13:42:49 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=w2wDSdFPCVKSJxok1ajjwKeJYPQLxC628rf9HNcdV6c=; b=TriZc+aSjCoL2CAUEgtfCW8ynwCVA4rO5WOuNzijboXViEUhZcyT+LUJYQhyo4b8QX HFPMSR+F4qAz6WZPZUe493k7a11q0KRxwSfcfnn6MPi73hyjQrXlR4ZoKFq7vhLGZCzi MTxE1jbwSa0ui7KOkrvc0fEqxNvfThMZ3sNPvCpdjqZewL8ANVE5RelYPIGINZz1T5uj SfFam0Aarb2Z7I6SDsSUGmiZHHerS6UMhlL9lwZk7jQZW7OcpaMMxuwoUJobWPpgXmoV l+cNS01L1KkSa+bb9l+aTnB0411gSQJkMGFmfK6YbDSPASasYpSdU6RRdovJ+pQo+MWt PAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=w2wDSdFPCVKSJxok1ajjwKeJYPQLxC628rf9HNcdV6c=; b=R+VMNlBCoDsoROThmY4nFe4jTJH32Dw69/qLtdu/jiNhHMipL30ZldFS64vAbgMJkL e5i++EGAFlvTYNza9QYUSHALI/pgmVEYJH5yhY8xsq4pFj8O+PALvXtQ8OuWyjM7aelR yM6lT4zk1LqNxhVe919DxYAXfU/RTrbjgvGc/A0RfbPmy95UoPp2uh7pl+OO7p6QUJug o+HWYxCj7pBxazOJKVwMnm5QNNrWAqf39CxYbOzFhaibZiE0uEN9y5HXwMnkMVJPZmBx Bk9CdznDSu/WpYmkJNt0CT0OBDHl/sCHpe1dLyegEQd7V5D1iJOfbXkNzqJi88VknCLH FrzA== X-Gm-Message-State: ANoB5plWeoMpmo7fgNTE9VfjxUp6HbSR31cE9CYn9/Ya/xstkapqaU1f jrV5eRxwdsEFWZoFwZ5b9pj1OrLn36FftAkf X-Google-Smtp-Source: AA0mqf65fJ/7YT2cJDuEKzVG4KWIiPg4lCl66WrQ1YiEtVLICQfzAmLmRRcwf6RUFiNe3BOLac6Siw== X-Received: by 2002:a05:600c:4451:b0:3cf:894d:1d06 with SMTP id v17-20020a05600c445100b003cf894d1d06mr27935399wmn.30.1671226968110; Fri, 16 Dec 2022 13:42:48 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/36] pci: Use device_cold_reset() and bus_cold_reset() Date: Fri, 16 Dec 2022 21:42:10 +0000 Message-Id: <20221216214244.1391647-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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 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: 1671228774744100004 Content-Type: text/plain; charset="utf-8" In the PCI subsystem we currently use the legacy function qdev_reset_all() and qbus_reset_all(). These perform a recursive reset, starting from either a qbus or a qdev. However they do not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() and bus_cold_reset() functions. These also perform a recursive reset, where first the children are reset and then finally the parent, but they use the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This should be a no-behaviour-change commit which just reduces the use of a deprecated API. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g;s/qbus_reset_all/bus_cold_= reset/g' hw/pci/*.c Signed-off-by: Peter Maydell --- hw/pci/pci.c | 6 +++--- hw/pci/pci_bridge.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e6292d8060b..c61348dca01 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -378,14 +378,14 @@ static void pci_do_device_reset(PCIDevice *dev) */ void pci_device_reset(PCIDevice *dev) { - qdev_reset_all(&dev->qdev); + device_cold_reset(&dev->qdev); pci_do_device_reset(dev); } =20 /* * Trigger pci bus reset under a given bus. - * Called via qbus_reset_all on RST# assert, after the devices - * have been reset qdev_reset_all-ed already. + * Called via bus_cold_reset on RST# assert, after the devices + * have been reset device_cold_reset-ed already. */ static void pcibus_reset(BusState *qbus) { diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index da34c8ebcd1..b2b180edd61 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -275,7 +275,7 @@ void pci_bridge_write_config(PCIDevice *d, newctl =3D pci_get_word(d->config + PCI_BRIDGE_CONTROL); if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) { /* Trigger hot reset on 0->1 transition. */ - qbus_reset_all(BUS(&s->sec_bus)); + bus_cold_reset(BUS(&s->sec_bus)); } } =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229800; cv=none; d=zohomail.com; s=zohoarc; b=ZDyK2FgF+qt/oTXYWXq2kNMa+Ey5HdQTTKOMAqG7sb/GywsvIH9W9zR2d/qe3pJ1rikJLMZua5h2nZLS2E0pQqOsDlcMnpRlt80FDZvtnroQD17E1EosCGgYxJnZq9AhGbjzuLLtfcJwG057nWUmrcn5eYUq1yJ4w+dNbPMHDF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229800; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IHmzyE2rDA35kdIKQ9Wr9fAtvPOkZTN4VnNyKqozwiU=; b=CC2n/MDz+Eaq9NtlKeWm9uwOfP5c9EvTFxoKEDlN/n1fyY4SBW+/6fyxsRtA22WY7YXS0CiogOnmTxuUbQaKYeL5PrAMPH3w+aFNJVTxgC95WpHa3NUwR+Q4kTQj0jOs4zOjq+0xKCaW8zqiywa4KX73aF687yQpkC7LLWcjspE= 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 1671229800642380.911524390243; Fri, 16 Dec 2022 14:30:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU2-00060h-BE; Fri, 16 Dec 2022 16:43: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 1p6ITn-0005vs-6X for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:00 -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 1p6ITi-0000ar-H4 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:52 -0500 Received: by mail-wm1-x333.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso4974247wme.5 for ; Fri, 16 Dec 2022 13:42:50 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=IHmzyE2rDA35kdIKQ9Wr9fAtvPOkZTN4VnNyKqozwiU=; b=zq1V6yKcG1RQwRej87Vri7480OhdoOMsyYXLfG7KoiwGLhS1Ney1DH0Kvf/xExDih3 4P8GnDJlLZl+M3CW0dRNGwexF7kOEHtCR6joYOMbvr//zdJ/bgenQQkxNdQxeQHHdBRe +IMJqu/IznUjmqJhpVYNX6O6uNZPsXKE814BmguxfJSvj9HnGvoeI4CHb3fsUd42DWNa cyjICycuBkurfsPIRz9xYOk3f9xgDUyedIudGZAXnNeXIXy2YrkLdqUTXP9n31PlTtMh XcKHyQc/0pxnLDQyXxJE29XeeGO/mjUu+h12HcXoLAGJQ/2BwJW8M5AyVVOCRebhJM7l F6vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IHmzyE2rDA35kdIKQ9Wr9fAtvPOkZTN4VnNyKqozwiU=; b=b8/PikDHs7Qbfk3JZSD/0Z0kLz7mDbMfLhaAHiFmoSJKT5wsbVt3AIu18ZIlugVYtN Y8woLlMeooaE5No8ztNRZK7v6qwi+76ERT8EvLOwK/WDB0vrgvCAlCDswTFvb+JU518k nlahCwJVIMmIUhPtlzF5uqSHP4oyYH06Cm/MUFDwgF+BjAfM05Lo0iDG8VV9XtTBygYB IGFHZUAQ48OTZ037WHmsH1Vbq9vnHj+P8zfUMMeZbmh6MalkSZ6MC6o78rSrpzt9wgEZ PjxW9RHDEl1wqos2EOIt3AmZIJCNUk5C5gf0nNsMOysTQOCZzkw7+KVci37MxoopMR62 WDWA== X-Gm-Message-State: ANoB5plCXGoXoIDidPv2ZhpCv2sb3YeZ/m16LhxzDLsL3i6fWyTa3wJ3 LEFR1JGnDO3R5dQkJrBICdvv6BfTn+fosmHJ X-Google-Smtp-Source: AA0mqf5X508WqPg+seXk9TjWLO2VZlIvsAnHFutSSWWNDUmjiorMXf0PSteFVsAEURfwqmp6HsNFXA== X-Received: by 2002:a7b:cd8f:0:b0:3d1:baf7:ceae with SMTP id y15-20020a7bcd8f000000b003d1baf7ceaemr26923967wmj.39.1671226969011; Fri, 16 Dec 2022 13:42:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/36] hw/hyperv/vmbus: Use device_cold_reset() and bus_cold_reset() Date: Fri, 16 Dec 2022 21:42:11 +0000 Message-Id: <20221216214244.1391647-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@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 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: 1671229801948100001 Content-Type: text/plain; charset="utf-8" In the vmbus code we currently use the legacy functions qdev_reset_all() and qbus_reset_all(). These perform a recursive reset, starting from either a qbus or a qdev. However they do not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() and bus_cold_reset() functions. These also perform a recursive reset, where first the children are reset and then finally the parent, but they use the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This should be a no-behaviour-change commit which just reduces the use of a deprecated API. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g;s/qbus_reset_all/bus_cold= _reset/g' hw/hyperv/*.c Signed-off-by: Peter Maydell --- hw/hyperv/vmbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index 8ee08aea46c..271289f902f 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -1578,7 +1578,7 @@ static bool vmbus_initialized(VMBus *vmbus) =20 static void vmbus_reset_all(VMBus *vmbus) { - qbus_reset_all(BUS(vmbus)); + bus_cold_reset(BUS(vmbus)); } =20 static void post_msg(VMBus *vmbus, void *msgdata, uint32_t msglen) @@ -2035,7 +2035,7 @@ static void vdev_reset_on_close(VMBusDevice *vdev) } =20 /* all channels closed -- reset device */ - qdev_reset_all(DEVICE(vdev)); + device_cold_reset(DEVICE(vdev)); } =20 static void handle_close_channel(VMBus *vmbus, vmbus_message_close_channel= *msg, --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671227035; cv=none; d=zohomail.com; s=zohoarc; b=B7NUAA6JJx9bkw0CR0qRfAYpcYxpwuMhd5xAySNLAWr7GuxnEICY8Vgb1CQA7o8sd6vY4Gcajsr1nSzZzNSBBCIxKmAacmKiy2V3jK7bcAQ6lDtslZAy9xDXs6X7BaPbPgoHZlzxsNnZ1m/ezcLdC3qKO//WR9ip1vA9E7oeGvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227035; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kcDNWul230g1IVkNvMU6uv+Q0A4IDRbxHNgR7Lo8f4I=; b=PamYZjSC0ic8bkSZKg87UgE4wI0he4xmzwUAEZxDTaRZhkf+/A4n8cl1NmvOSFNTf6aLOoXIFi1ARzhsRt5px5ByDxt6Jg/uhxtBhoK0qen7aPYE7w06EEklPVga9/61CW5h7b4Ob2MUoBAp/Xyo/P8M59skjQV2ysdGeWsP0Og= 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 1671227035785269.08045120694; Fri, 16 Dec 2022 13:43:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUb-0006Dh-E3; Fri, 16 Dec 2022 16:43:45 -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 1p6ITn-0005vu-4Z for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:59 -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 1p6ITj-0000b3-H8 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:54 -0500 Received: by mail-wm1-x32a.google.com with SMTP id ja17so2736093wmb.3 for ; Fri, 16 Dec 2022 13:42:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=kcDNWul230g1IVkNvMU6uv+Q0A4IDRbxHNgR7Lo8f4I=; b=juDv0skZXjsshTGgySybu7ZeHIN26bAep0mzWhhX40uI9PJkXH0kz9bgga1neOn/GD CsSs41YAnUi5VCahRfREFaY+ziMR38X+EvMq8jADnR827dMOJD6khj6etsvgE8FR79ie RCim74SP2/10zmWTKC5n7qwMb/kkiUL/TUknDUXnj9TNa3bOyoW03mOGurhuS/J+fqPc JlW1jrMevoOreWkq/cX05wNn3HBOqZZ9iEEeYDMoXSVm5sK2n0magu7mGi0bF09fz9oH W1IKkaI5Qx1hZNtOk2cW7HOrniri2KcAi0gI7Z+4HohOomkAsoXq7Q9lGKF4F6EEbCk7 jbnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kcDNWul230g1IVkNvMU6uv+Q0A4IDRbxHNgR7Lo8f4I=; b=JoelUuPUg8Z39Ykv1OUjnVOh2jIQp5E19BUI8aliI6mIQacxkJ1kS4Frn33PfdtTuv 45VfYwOQ/SROree0HeJBhXSAMQGVfKuoNMni2xCzA1TenQ4WDVLp54jKKLFvI/GJy5XW GVTsJN/iNaVXytuXXEJx6Yi1ZoVmZt8qpZLDlWu9H1AmQxIoGeNQ4mdPHs5W9912E9Rp JPMaEMdaoKq2gw2cAqcUFxv/pjwO6/CHaSANClmpBufGXXYMoAJiIOKY6S86qqc1eFzs LduLvVo7RmangdA097gDJ6DvyhLc3ZJm5gHMJZyADyPGdsFHKx6pbeSZik0Mh8vj0fLa 1XNA== X-Gm-Message-State: AFqh2kp8YW3sNh4FW96aVuzRzSF0JK7UOvJ5CkoNHovi0R9wgo9KHBYi hFhn9MZjTHKeG7fv2tifxN9jjLMDaxNVp4Ym X-Google-Smtp-Source: AMrXdXu6XwT8hBpN1OX6az3H5Hpzrn2OwSHUuhc48wWVkG35fFhieMZ/yJQR8aQOw/HDfmL8CeoX+g== X-Received: by 2002:a05:600c:4d8a:b0:3d3:3d51:7d44 with SMTP id v10-20020a05600c4d8a00b003d33d517d44mr4869310wmp.33.1671226969986; Fri, 16 Dec 2022 13:42:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/36] Replace use of qdev_reset_all() with device_cold_reset() Date: Fri, 16 Dec 2022 21:42:12 +0000 Message-Id: <20221216214244.1391647-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@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 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: 1671227036682100001 Content-Type: text/plain; charset="utf-8" The legacy function qdev_reset_all() performs a recursive reset, starting from a qdev. However, it does not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() function instead. This also performs a recursive reset, where first the children are reset and then finally the parent, but it uses the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This commit changes the five remaining uses of this function. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g' hw/i386/xen/xen_platform.= c hw/input/adb.c hw/remote/vfio-user-obj.c hw/s390x/s390-virtio-ccw.c hw/us= b/dev-uas.c Signed-off-by: Peter Maydell --- hw/i386/xen/xen_platform.c | 2 +- hw/input/adb.c | 2 +- hw/remote/vfio-user-obj.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/usb/dev-uas.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index a64265cca07..7db0d94ec28 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -177,7 +177,7 @@ static void pci_xen_ide_unplug(DeviceState *dev, bool a= ux) blk_unref(blk); } } - qdev_reset_all(dev); + device_cold_reset(dev); } =20 static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) diff --git a/hw/input/adb.c b/hw/input/adb.c index 84331b9fce6..214ae6f42b3 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -43,7 +43,7 @@ static const char *adb_commands[] =3D { =20 static void adb_device_reset(ADBDevice *d) { - qdev_reset_all(DEVICE(d)); + device_cold_reset(DEVICE(d)); } =20 static int do_adb_request(ADBBusState *s, uint8_t *obuf, const uint8_t *bu= f, diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 6d0310cec97..fe1fdfb5f70 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -678,7 +678,7 @@ static int vfu_object_device_reset(vfu_ctx_t *vfu_ctx, = vfu_reset_type_t type) return 0; } =20 - qdev_reset_all(DEVICE(o->pci_dev)); + device_cold_reset(DEVICE(o->pci_dev)); =20 return 0; } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 2e64ffab45e..fab79045dd0 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -118,7 +118,7 @@ static void subsystem_reset(void) for (i =3D 0; i < ARRAY_SIZE(reset_dev_types); i++) { dev =3D DEVICE(object_resolve_path_type("", reset_dev_types[i], NU= LL)); if (dev) { - qdev_reset_all(dev); + device_cold_reset(dev); } } } diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 5192b062d6f..88f99c05d53 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -791,7 +791,7 @@ static void usb_uas_task(UASDevice *uas, uas_iu *iu) =20 case UAS_TMF_LOGICAL_UNIT_RESET: trace_usb_uas_tmf_logical_unit_reset(uas->dev.addr, tag, lun); - qdev_reset_all(&dev->qdev); + device_cold_reset(&dev->qdev); usb_uas_queue_response(uas, tag, UAS_RC_TMF_COMPLETE); break; =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671230004; cv=none; d=zohomail.com; s=zohoarc; b=bI1mLzDP5wAIYyZU0EE+KCr0PPuZHBA3EBK7+xK0bWwdWqDeQC3SlUrsAGMePZe0LKRmwpY6vsyG3AQEuVqhB+LDQmEAw0+YnK2UIySUxk5FxL3q34JTQfOIZL0DGYhbI3bW6Z9LJc9soUZw510+PacgYYjaugqYSv6F908a8tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671230004; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3rFihcTTz1hAU/VaIjhHsYjodDtMKZcW8ITB9PAuu1c=; b=ekErfn8iG1sTAWw/WzYkpFroENOeiX017XsSyJnXLt17B1PZggzPkyF+JsnNghgDWIakEcKSrkJtB8SClqt8Qq2+Pf7LTwpm1jFiO+KKaImR4HDqdKUmE7GZQxtUUSRPkBE6UZLRfYJdY8zzX9sN7vajoyKxLEIY1aMie1GDRAI= 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 1671230004196172.42477848714861; Fri, 16 Dec 2022 14:33:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU7-00063j-ON; Fri, 16 Dec 2022 16:43:15 -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 1p6ITp-0005wB-Rm for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -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 1p6ITk-0000bF-4s for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:56 -0500 Received: by mail-wm1-x333.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso1997399wmb.1 for ; Fri, 16 Dec 2022 13:42:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=3rFihcTTz1hAU/VaIjhHsYjodDtMKZcW8ITB9PAuu1c=; b=PFbu/AWxefFZWrt3MHagX9W+kOp45Pnaov3xhECDCAJU0JAnW83gdL8kBtNx/7p+nT KtqfJf1p5f6S5CT+slh0cdnqII66FPZaQTFolIpiHvlOjrGV8sNCS3Fvmq9BEHbz24LL 3xDzT6BsUfRUbskfCeYNWUVmHtTFh8Ze0SMgzcVVQCd2EXZhCSMp2Sisqeg5iZ2ZrjUx 7PHw5lepF3xowz4vwpJlYPVhoCxjA4s2YikasLWFh2lXSCc5ic42oehQJMGex82QAlJ/ 8f442VVd4S3SwgeZUbPqrPXESvvYmrl0+L0cJlZJO4b/rCuSt3J2DyQY8oSQxQUS4V5p ZNhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3rFihcTTz1hAU/VaIjhHsYjodDtMKZcW8ITB9PAuu1c=; b=wKiZCite+EIoQae3PISdvvnh1TVev371b+0sacwwAP5fGyvVlfdb/uribC7hjLO1mb ww/u1fzb+mZ6m6SbmUjcjYMeHf02qTJYxt9Cl9EGTYdMW34SjdRdTGmPWqCIVYx/qT28 TTH5VlLaPug21Mh2GDT2ztKGxgnjURaKKwd6Ito3jkOhjADDFvomspr53xcmiKU3WLu+ Ew+Zhtzbc3h0WEE8pxDnezkTskN5OZlKoNoGK0d5xcD7Rx+AbbQwvxE4nvWFB6z8+j4A A8gBa3sa1BEkP0CyesyKF7skHA7QAE1/zrBOsh1XMwhiIhkUjt210uw3qSfpkklmzgU4 80Uw== X-Gm-Message-State: ANoB5plNZ8z/XoIHamK7nhAL1J9I0VK9hmsi3kB2tJ+As4OFVN18DkjC ujiUbPaEHA5nFpSoS3fTGXnXxJ0fvsjS2PXq X-Google-Smtp-Source: AA0mqf4tcfHbw0rk4xiTsHnYYmb4LMHWHLP6kmFrNuvRvNV0c9+HeRkDtxFmVqC+S/fR5xG6IvZ0pQ== X-Received: by 2002:a05:600c:4fd4:b0:3cf:75dc:12d3 with SMTP id o20-20020a05600c4fd400b003cf75dc12d3mr26962038wmq.23.1671226970864; Fri, 16 Dec 2022 13:42:50 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/36] qdev: Remove qdev_reset_all() and qbus_reset_all() Date: Fri, 16 Dec 2022 21:42:13 +0000 Message-Id: <20221216214244.1391647-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@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 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: 1671230004782100001 Content-Type: text/plain; charset="utf-8" Remove the qdev_reset_all() and qbus_reset_all() functions, now we have moved all the callers over to the new device_cold_reset() and bus_cold_reset() functions. Signed-off-by: Peter Maydell --- include/hw/qdev-core.h | 26 -------------------- hw/core/qdev.c | 54 ------------------------------------------ hw/core/trace-events | 5 ---- 3 files changed, 85 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 785dd5a56ef..c7eda169d78 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -743,32 +743,6 @@ int qdev_walk_children(DeviceState *dev, qdev_walkerfn *post_devfn, qbus_walkerfn *post_busf= n, void *opaque); =20 -/** - * @qdev_reset_all: - * Reset @dev. See @qbus_reset_all() for more details. - * - * Note: This function is deprecated and will be removed when it becomes u= nused. - * Please use device_cold_reset() now. - */ -void qdev_reset_all(DeviceState *dev); -void qdev_reset_all_fn(void *opaque); - -/** - * @qbus_reset_all: - * @bus: Bus to be reset. - * - * Reset @bus and perform a bus-level ("hard") reset of all devices connec= ted - * to it, including recursive processing of all buses below @bus itself. A - * hard reset means that qbus_reset_all will reset all state of the device. - * For PCI devices, for example, this will include the base address regist= ers - * or configuration space. - * - * Note: This function is deprecated and will be removed when it becomes u= nused. - * Please use bus_cold_reset() now. - */ -void qbus_reset_all(BusState *bus); -void qbus_reset_all_fn(void *opaque); - /** * device_cold_reset: * Reset device @dev and perform a recursive processing using the resettab= le diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c0b77a62954..c5ea0adc713 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -250,60 +250,6 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int= alias_id, dev->alias_required_for_version =3D required_for_version; } =20 -static int qdev_prereset(DeviceState *dev, void *opaque) -{ - trace_qdev_reset_tree(dev, object_get_typename(OBJECT(dev))); - return 0; -} - -static int qbus_prereset(BusState *bus, void *opaque) -{ - trace_qbus_reset_tree(bus, object_get_typename(OBJECT(bus))); - return 0; -} - -static int qdev_reset_one(DeviceState *dev, void *opaque) -{ - device_legacy_reset(dev); - - return 0; -} - -static int qbus_reset_one(BusState *bus, void *opaque) -{ - BusClass *bc =3D BUS_GET_CLASS(bus); - trace_qbus_reset(bus, object_get_typename(OBJECT(bus))); - if (bc->reset) { - bc->reset(bus); - } - return 0; -} - -void qdev_reset_all(DeviceState *dev) -{ - trace_qdev_reset_all(dev, object_get_typename(OBJECT(dev))); - qdev_walk_children(dev, qdev_prereset, qbus_prereset, - qdev_reset_one, qbus_reset_one, NULL); -} - -void qdev_reset_all_fn(void *opaque) -{ - qdev_reset_all(DEVICE(opaque)); -} - -void qbus_reset_all(BusState *bus) -{ - trace_qbus_reset_all(bus, object_get_typename(OBJECT(bus))); - qbus_walk_children(bus, qdev_prereset, qbus_prereset, - qdev_reset_one, qbus_reset_one, NULL); -} - -void qbus_reset_all_fn(void *opaque) -{ - BusState *bus =3D opaque; - qbus_reset_all(bus); -} - void device_cold_reset(DeviceState *dev) { resettable_reset(OBJECT(dev), RESET_TYPE_COLD); diff --git a/hw/core/trace-events b/hw/core/trace-events index 9b3ecce3b2f..6da317247f4 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -3,11 +3,6 @@ loader_write_rom(const char *name, uint64_t gpa, uint64_t = size, bool isrom) "%s: =20 # qdev.c qdev_reset(void *obj, const char *objtype) "obj=3D%p(%s)" -qdev_reset_all(void *obj, const char *objtype) "obj=3D%p(%s)" -qdev_reset_tree(void *obj, const char *objtype) "obj=3D%p(%s)" -qbus_reset(void *obj, const char *objtype) "obj=3D%p(%s)" -qbus_reset_all(void *obj, const char *objtype) "obj=3D%p(%s)" -qbus_reset_tree(void *obj, const char *objtype) "obj=3D%p(%s)" qdev_update_parent_bus(void *obj, const char *objtype, void *oldp, const c= har *oldptype, void *newp, const char *newptype) "obj=3D%p(%s) old_parent= =3D%p(%s) new_parent=3D%p(%s)" =20 # resettable.c --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228552; cv=none; d=zohomail.com; s=zohoarc; b=dofKDpKDkj1fudz4WOxvDUtvN7lODbwu9ikKdt5OwuVhPry6iKTDKKaG6ay7hyGw4ejbO5vOIsk2se8DA5+y9lyB9pmBxk+J6oAISan1Y1B566x3JShYEy6Ppb0F1CvR/plRRBOOGNu1RveQ/U2zlb3Sr/WVQTUPjssccJBG83g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228552; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ejnwplBuFjPQYjVXN/BBF9M+6FV2TieQ9nezCnNqXI4=; b=hXJnWkI8+x2kCM4/nnu4vfhhd0/v+C0+1aXzxlyxTfSbh1K9sxC043meExl98s+ZG5FdNpvrQ3S+NBW8Ok7YsDl8kGpBfDIhSFtUrTjRk5aTLO//GVyQqJQSamAmVzvsGp6heX/nMNN3g3SuqnD7M3U0t3AWxmmQsI0nT6fc1cc= 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 1671228552110802.1343913420168; Fri, 16 Dec 2022 14:09:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUb-0006EN-Fe; Fri, 16 Dec 2022 16:43:45 -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 1p6ITr-0005wP-T2 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -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 1p6ITn-0000bU-RT for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:58 -0500 Received: by mail-wm1-x336.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so2965148wml.0 for ; Fri, 16 Dec 2022 13:42:52 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ejnwplBuFjPQYjVXN/BBF9M+6FV2TieQ9nezCnNqXI4=; b=fpLbppGgUnqCSumlbXT80u7GXnt10v3E6uLy4P6P1PlzaXIAgl+XsmcY4RZWIyh2L8 wf4NSzvhh0SMmjgyeuygbF35SH+UO/4awNeSxHwSinDnVCYoOr196i44Rd+z+Boj3sPn a3COXyrpyDf6fsBF3BF8ibZIyc5GZZXjIn5XOsW2C7VSg3gO+quHkVSaTQZgKMdxrHIp 4F5HH6g1MevTxGAiTNY8y6LIV/nNmK6m5RyhYcZ7HLNea9VBRYzpO+1q3KLrFcxUnyfZ hjdnNF9N07/x4joPojOEXiBQ0mjH8FIK+iz/VMKAcVU/ZHHeE0YSb3+wL/Z6lZisUlMO Ky/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ejnwplBuFjPQYjVXN/BBF9M+6FV2TieQ9nezCnNqXI4=; b=WwQ/OL5ykOb70zbQBP2j2YSvnXNCNoO8BdhzOfclPRUUoN79u2k75fsqRhuhDyjqXZ tEVNIkZJpxv/PlWsNCUvUkmlZqjLiVZM6BU5/LNH7yMbOjUsdhgyxKEKusTCl6fRm1CJ 31IHZebgy1uAZlMI7xqJFLaSNFFjmrvTtAspavNGCtqvhMbR0VwN1RzQdJQqL9CZQ1qN 5xr6bJuM6RZuOxvBm2+Gu4A5a4szaORP/+o1sQG4G+1mLD+Bzf0P5eW2IFAaA0Qb8mhu VeA3FrUDMqxFuoCbHTdMWqxdCEcCZqFWydXRHeO1H2QosR5PfpBxeJJHeXSKTq1PEOwu CM1A== X-Gm-Message-State: ANoB5plqDpXhoVPRL4qUEEcTn8XqvFlKI0Bim9ZuDBQQHjLgmzw8q5g8 ALYpRdWKZ0/Ksgx7eYEXxDer4SJyW1kgARaz X-Google-Smtp-Source: AA0mqf49mTY5QY8axnr4YCSjW4nwf8vcLJz5224sutztaD9dPVtrC7NgS26rNOdfhOGeMUnA0dSvnA== X-Received: by 2002:a05:600c:4494:b0:3d2:3d3c:46f7 with SMTP id e20-20020a05600c449400b003d23d3c46f7mr9234052wmo.30.1671226971698; Fri, 16 Dec 2022 13:42:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/36] hw: Remove device_legacy_reset() Date: Fri, 16 Dec 2022 21:42:14 +0000 Message-Id: <20221216214244.1391647-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@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 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: 1671228553214100001 Content-Type: text/plain; charset="utf-8" The device_legacy_reset() function is now not used anywhere, so we can remove the implementation. Signed-off-by: Peter Maydell --- include/hw/qdev-core.h | 9 --------- hw/core/qdev.c | 10 ---------- hw/core/trace-events | 1 - 3 files changed, 20 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index c7eda169d78..35fddb19a64 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -776,15 +776,6 @@ BusState *sysbus_get_default(void); char *qdev_get_fw_dev_path(DeviceState *dev); char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *de= v); =20 -/** - * device_legacy_reset: - * - * Reset a single device (by calling the reset method). - * Note: This function is deprecated and will be removed when it becomes u= nused. - * Please use device_cold_reset() now. - */ -void device_legacy_reset(DeviceState *dev); - void device_class_set_props(DeviceClass *dc, Property *props); =20 /** diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c5ea0adc713..d759c4602c2 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -868,16 +868,6 @@ void device_class_set_parent_unrealize(DeviceClass *dc, dc->unrealize =3D dev_unrealize; } =20 -void device_legacy_reset(DeviceState *dev) -{ - DeviceClass *klass =3D DEVICE_GET_CLASS(dev); - - trace_qdev_reset(dev, object_get_typename(OBJECT(dev))); - if (klass->reset) { - klass->reset(dev); - } -} - Object *qdev_get_machine(void) { static Object *dev; diff --git a/hw/core/trace-events b/hw/core/trace-events index 6da317247f4..56da55bd71d 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -2,7 +2,6 @@ loader_write_rom(const char *name, uint64_t gpa, uint64_t size, bool isrom= ) "%s: @0x%"PRIx64" size=3D0x%"PRIx64" ROM=3D%d" =20 # qdev.c -qdev_reset(void *obj, const char *objtype) "obj=3D%p(%s)" qdev_update_parent_bus(void *obj, const char *objtype, void *oldp, const c= har *oldptype, void *newp, const char *newptype) "obj=3D%p(%s) old_parent= =3D%p(%s) new_parent=3D%p(%s)" =20 # resettable.c --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228854; cv=none; d=zohomail.com; s=zohoarc; b=O41boy52ABhGRCQRUrESjOmWW2P1tdfk/GRtxLF8Ha/B0mRo+97Z+heMmPamHO/Z+YJ139MzESTAzApB2/9ck92sOO7xONq3Qdp1efhVb7PBJzffYKV5YgqdRe4dHPwTK6G58JmBy8z2pNo7jb3qm+FGCH/IZHMMzb3UaoNqTAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228854; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=++dngzwVZrf/lhItKbFYZlrrhOCx5GYOttIsi96mUbc=; b=AMqQ3MTBcZt2bWw+3hE4hGEZl+4umflOD5aBsu4Dg1hzmnxljxh7PKlzXyagEVMpzuD6dnCL1tXrnemHFvnOwPRDq2zbtXTkJVMqtGSstmz0Xu8KRfWalKJbwLsWgeNFNrVS+0cVmOyBe9SSeWdAXIhMPYnUeAgm7PwG/BQyf3Q= 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 1671228854360806.9918060900503; Fri, 16 Dec 2022 14:14:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU3-000611-5g; Fri, 16 Dec 2022 16:43: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 1p6ITs-0005wb-LF for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -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 1p6ITn-0000be-ST for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:59 -0500 Received: by mail-wm1-x334.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso1997425wmb.1 for ; Fri, 16 Dec 2022 13:42:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=++dngzwVZrf/lhItKbFYZlrrhOCx5GYOttIsi96mUbc=; b=sqpalmsfwALTaW8MdpFF1E7RvU8ya5O9lmA4aQfi4/GH//mRnNYxfxAtEZJCTdPkfj 2WjuWLhzV9FeEPmhzK1SiuZs1RIC703Dbfub5+jZQfI499pBguzPfFgH2jl/+uxaAdPQ e0KLwJefBb3ji1f9hQJ0CJe0y1UzaK9TCGQBWSthHvZejmw3Vy3/oZJdPDus0BsPFIZ2 OYYl7wGVPCnWqcHMBqhwRSfX872/0ZKGLlGgwNCDU/NCTTMHEcEf6LOfaoAzKhFWj+R5 9SedeesR6PVTDR1JIW6ykKiHUnYyfkfBWVGStQhzBkjS0L8dF3tEXPeHDhan8XID/u+O O9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=++dngzwVZrf/lhItKbFYZlrrhOCx5GYOttIsi96mUbc=; b=p9yJuT6CtfIUyBHGth3A0V5f/OWVLn0qkJreydYYNUpUT4v4g0Qgm0nSjlHMbJCLgK wJNpl1QRj3rwMyyeXDhsCDOxddETibg5y4WzhFMGZS9xp+ADJFCTMfzCom2crVHSTa/0 yJVdx47fzUAiJJGE0BJOKMiySZelZmD0lVT98uhZttcjgO7ziTwaq+QKW1iBwd2fLHAb lNMGUq5AvWmUjd2gMpYc2sKoJFWuyDBAC0OaCHOLGaqEATf+arrSNST9imvHA3ffPRWq 77mZC7aReiKCRTrgNa26BcQDym9ehON3YdDEE2bSPWZLQZgeOT24L4mbGuWhkaKvnK9C q28A== X-Gm-Message-State: ANoB5pkrAUmGXEeSNfbiGMD12+45b7U9bQPlGAn3B6NEFXhlPjJBtHF7 5wIxJHCFuqm7s4IbsWisgMQ3Hf39feq9oaDv X-Google-Smtp-Source: AA0mqf5laPTLRvGi+3NE0n0//1NLqiO79lonhOR/q/BPg8RcP3SZubmz3avwW60ZXHUU4e6Phuz8yw== X-Received: by 2002:a05:600c:384e:b0:3cf:a483:3100 with SMTP id s14-20020a05600c384e00b003cfa4833100mr28021532wmr.3.1671226972536; Fri, 16 Dec 2022 13:42:52 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/36] hw/input/ps2: Convert TYPE_PS2_DEVICE to 3-phase reset Date: Fri, 16 Dec 2022 21:42:15 +0000 Message-Id: <20221216214244.1391647-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::334; envelope-from=peter.maydell@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 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: 1671228855408100003 Convert the parent class TYPE_PS2_DEVICE to 3-phase reset. Note that we need an 'exit' phase function as well as the usual 'hold' phase function, because changing outbound IRQ line state is only permitted in 'exit'. (Strictly speaking it's not supposed to be done in a legacy reset handler either, but you can often get away with it.) Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20221109170009.3498451-2-peter.maydell@linaro.org --- hw/input/ps2.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 05cf7111e31..47a5d68e300 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -1001,12 +1001,18 @@ void ps2_write_mouse(PS2MouseState *s, int val) } } =20 -static void ps2_reset(DeviceState *dev) +static void ps2_reset_hold(Object *obj) { - PS2State *s =3D PS2_DEVICE(dev); + PS2State *s =3D PS2_DEVICE(obj); =20 s->write_cmd =3D -1; ps2_reset_queue(s); +} + +static void ps2_reset_exit(Object *obj) +{ + PS2State *s =3D PS2_DEVICE(obj); + ps2_lower_irq(s); } =20 @@ -1281,8 +1287,10 @@ static void ps2_init(Object *obj) static void ps2_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 - dc->reset =3D ps2_reset; + rc->phases.hold =3D ps2_reset_hold; + rc->phases.exit =3D ps2_reset_exit; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229288; cv=none; d=zohomail.com; s=zohoarc; b=mCY0oIpJRCNU2R2Umkja4BUheC2nRYN27vCOm8wTGzQaujjtsJJr2A4YMybNEx+b6I4RWRZ3+TI/rTjrK0W031W2tUFOTEoYtHkS0v79XgwATeoQRFMwO/IlcIBx1D7f/0aaZ5R6Nq/+WyXhPNFB3Ag5/9LPkmStfDlmvVYU5SM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229288; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=18PIUptsG0HDozMjNUaDXZMKAMCj9HHUBMVLqT4eZ7w=; b=grkgzda8B1wuJW1Rao2368/h6ZFRGIM3nLxFom9NJktBiNMnhRHQqMNDRjQNhgSNN9N+xaITsQf0XXXQHfyaMT6HyqAWu37L328LlKuBVqiai6A3pZevkwPmFNGONJ9/tLllMkiR5bMCWsJium5HXalf04x7Bp20wERRIQgpgyk= 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 167122928811291.78829065049695; Fri, 16 Dec 2022 14:21:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU5-00061q-8o; Fri, 16 Dec 2022 16:43:13 -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 1p6ITs-0005wa-LD for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITp-0000bj-Is for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:00 -0500 Received: by mail-wm1-x330.google.com with SMTP id i187-20020a1c3bc4000000b003d1e906ca23so2079437wma.3 for ; Fri, 16 Dec 2022 13:42:56 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=18PIUptsG0HDozMjNUaDXZMKAMCj9HHUBMVLqT4eZ7w=; b=ht1iUpW1qxl9jPHRbqK1PQnKRpCmqA23TW4jbkZS3CLntLX+X822yx8MKgOZOFsX7t N1Ms6bz7Ib/0VNvIr7oOUGB8XV393hObh7hIDKOhFRcWTAHBaTEhvzXyJwG11vs+ezhH Hn+nhwotYTLK6seOWbOHkxNP4JSeiVzhP/IYFtdsyX1Mfwk0DRUfRGAu41RftL633QZs qQ5mzJSYGFBgmKJCSV9sSBOFZE3BGmlCxIkbZt6EB5p9b6np08+7tWxWBJ8+jimQ9/Kn SU4zyxsi/fplCJiDmDNW4xjECPCD5l3geHD5gtEFNKA1FrknkUzmt97mMs4cg8yKd+l9 Vb1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=18PIUptsG0HDozMjNUaDXZMKAMCj9HHUBMVLqT4eZ7w=; b=6HICtwH96e25CTrZWX0HBHCXG8jigwzgxeF53KhJMa+DSQ0Uq1gk8e9j+fmDr8hZ19 SbkcNfbuMdoWhbNTiMILGHUH6PLbTEDFOL9oQCw8Nb/6HIguz0mM4k7ac5hyRNJTCNa/ 4WjYunp773uDeY3dXRLgASjFlCczRFE9fu3jY+O9pFCCKDezd7KwP3XdEgXRe/MSZOQz DBw4bptfOyyz+EV/pbeLbH/oCCAhI2uTkQDNPtgmCBNqqmEvpdiaHgAuXyirpYdmUeab yyue3lEKL8kf8H/gcghmar5OJke9Ag2eO7Xkl+s38kPK1dWPB7rQiY7SY3DpSitATb5z a2cw== X-Gm-Message-State: ANoB5pm8xPLsYXPemBTHqnneAjqJdeyZAMFW5tVxrGWDRAWxAN+V8GD8 dBgJ1CyRhcT9DPJs/pFuGHj33ypEQz2KGfuF X-Google-Smtp-Source: AA0mqf4s3MWB10jQeG8IyDx/VD6q1Hm3WSOF7LDpgn2RymngeGZKn6MGSO3GYHlyevET24pbOhXyEA== X-Received: by 2002:a05:600c:3d8f:b0:3cf:a18d:399c with SMTP id bi15-20020a05600c3d8f00b003cfa18d399cmr26796086wmb.1.1671226973402; Fri, 16 Dec 2022 13:42:53 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/36] hw/input/ps2.c: Convert TYPE_PS2_{KBD, MOUSE}_DEVICE to 3-phase reset Date: Fri, 16 Dec 2022 21:42:16 +0000 Message-Id: <20221216214244.1391647-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671229290397100003 Convert the child classes TYPE_PS2_KBD_DEVICE and TYPE_PS2_MOUSE_DEVICE to the 3-phase reset system. This allows us to stop using the old device_class_set_parent_reset() function. We don't need to register an 'exit' phase function for the subclasses, because they have no work to do in that phase. Passing NULL to resettable_class_set_parent_phases() will result in the parent class method being called for that phase, so we don't need to register a function purely to chain to the parent 'exit' phase function. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221109170009.3498451-3-peter.maydell@linaro.org --- include/hw/input/ps2.h | 2 +- hw/input/ps2.c | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index ff777582cd6..cd61a634c39 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -36,7 +36,7 @@ struct PS2DeviceClass { SysBusDeviceClass parent_class; =20 - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 /* diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 47a5d68e300..3253ab6a92c 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -1042,13 +1042,16 @@ static void ps2_common_post_load(PS2State *s) q->cwptr =3D ccount ? (q->rptr + ccount) & (PS2_BUFFER_SIZE - 1) : -1; } =20 -static void ps2_kbd_reset(DeviceState *dev) +static void ps2_kbd_reset_hold(Object *obj) { - PS2DeviceClass *ps2dc =3D PS2_DEVICE_GET_CLASS(dev); - PS2KbdState *s =3D PS2_KBD_DEVICE(dev); + PS2DeviceClass *ps2dc =3D PS2_DEVICE_GET_CLASS(obj); + PS2KbdState *s =3D PS2_KBD_DEVICE(obj); =20 trace_ps2_kbd_reset(s); - ps2dc->parent_reset(dev); + + if (ps2dc->parent_phases.hold) { + ps2dc->parent_phases.hold(obj); + } =20 s->scan_enabled =3D 1; s->translate =3D 0; @@ -1056,13 +1059,16 @@ static void ps2_kbd_reset(DeviceState *dev) s->modifiers =3D 0; } =20 -static void ps2_mouse_reset(DeviceState *dev) +static void ps2_mouse_reset_hold(Object *obj) { - PS2DeviceClass *ps2dc =3D PS2_DEVICE_GET_CLASS(dev); - PS2MouseState *s =3D PS2_MOUSE_DEVICE(dev); + PS2DeviceClass *ps2dc =3D PS2_DEVICE_GET_CLASS(obj); + PS2MouseState *s =3D PS2_MOUSE_DEVICE(obj); =20 trace_ps2_mouse_reset(s); - ps2dc->parent_reset(dev); + + if (ps2dc->parent_phases.hold) { + ps2dc->parent_phases.hold(obj); + } =20 s->mouse_status =3D 0; s->mouse_resolution =3D 0; @@ -1245,10 +1251,12 @@ static void ps2_mouse_realize(DeviceState *dev, Err= or **errp) static void ps2_kbd_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); PS2DeviceClass *ps2dc =3D PS2_DEVICE_CLASS(klass); =20 dc->realize =3D ps2_kbd_realize; - device_class_set_parent_reset(dc, ps2_kbd_reset, &ps2dc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, ps2_kbd_reset_hold, NULL, + &ps2dc->parent_phases); dc->vmsd =3D &vmstate_ps2_keyboard; } =20 @@ -1262,11 +1270,12 @@ static const TypeInfo ps2_kbd_info =3D { static void ps2_mouse_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); PS2DeviceClass *ps2dc =3D PS2_DEVICE_CLASS(klass); =20 dc->realize =3D ps2_mouse_realize; - device_class_set_parent_reset(dc, ps2_mouse_reset, - &ps2dc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, ps2_mouse_reset_hold, NUL= L, + &ps2dc->parent_phases); dc->vmsd =3D &vmstate_ps2_mouse; } =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229740; cv=none; d=zohomail.com; s=zohoarc; b=Ip7bTr+KriL4hw2KejUKzh+40e4UY8kAKRMAnGm+YEQYAVW6CR4xsLrvu5a8n22i+3xHfY0SdBTrwFUB+nzg/s/lAID9Bhwyv8JUipgacwkug/POJtbKqVKG7h8kmIcygk566jmfGqgRESlE0F1OmXCLYg2x1Q7O46F31PsdGM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229740; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A2o/3JD/47KFZGGuCaIY7m7S85np6OtsBKjDrudLLbI=; b=CnrzpU9vlt33ukjxTmxgmZpIhSI+jD1BjdJ9xZo1r5i5B/JIX+/koqAH7I+9O0nksOtaz+e60H+zmSX7cgnj6zhFKwXsgHbBW1s7FfGkPZdfUYKhBxc/p97dA7uDNFEONP2HMaqWHmEUo34YuZCuMYeru0+SS92VYBDSZWEmKgQ= 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 1671229740608607.9158131571235; Fri, 16 Dec 2022 14:29:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU2-00060g-6w; Fri, 16 Dec 2022 16:43: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 1p6ITr-0005wQ-Sx for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITn-0000bu-Gu for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:42:58 -0500 Received: by mail-wm1-x330.google.com with SMTP id ja17so2736186wmb.3 for ; Fri, 16 Dec 2022 13:42:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=A2o/3JD/47KFZGGuCaIY7m7S85np6OtsBKjDrudLLbI=; b=hcsLKqGhSuByZBWzM6fIlTEEvqViVoWa5KW1CJ1tcEdkIWrkmG7xpg1mwLz+PiOvEY bN5RGmJMiQWY9sczcyD/iDjdibM78JVn2XodSvPBW9aG95Xfjw2L3oPL6EtpluUyEgAy /xm4J7S0WNAI7CqB5VI91oFCC5G+RNKykPRSCX5pFDRVrLiwvImDj/zAAkbEFmo/15Hn 7N8vZCd3ER09NZRZvu879A/5DseqXmYGGQjwGKoZ+dxMYNXySkXntVfeMd7WhQESy929 Wn5V6yXWl9NfeXv//Zh5V2eR6HKjOCcp3Q0cVMtlkgwENo97CBASs/I1ORI7mYbcUFQ+ JKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=A2o/3JD/47KFZGGuCaIY7m7S85np6OtsBKjDrudLLbI=; b=2887D0EQqVzvBBRu1WQG0oBmgx74nWe4nVJEZQ+tQG5DNkyGn6tb7iqB3HuDuJukpd CZxACVpPr5dAF4oYwGGVQKISHGJbncT0dLFYPnouGIGfL1GKiNjX4O0KHC7KORX1c5tx hfNpRAyCH/ezxjFtK5YwXFztO32/VoAtoL9YgMXEHYcJTMHxABsFSaKcafDGx+uxAnrc /DXPXQO954A10/+KNraDLRjYgIFLjzfgRyYrkpWK1sqTm98JtLnnTWe0sCA8ziinXjd6 X+14wKeyTz4pX2KtZKTwvTL4KasO1bIk5buI9ANsSFlEd32Tt6OEM/PORR8nIS7AeB7e z3tA== X-Gm-Message-State: ANoB5pk+lYgFzqjeDqVJuCHzckCNLB8gOlUlzASNY4b/4bhyMaQHWXg4 yG9l2w7umq+yQ448GZV7gEBqZRH7pFCpI8P5 X-Google-Smtp-Source: AA0mqf70bB27ADxaTZ2ejT8fYjU2vyjwfppqBJ7mD7ne018b+8aIGMSq9KKo1xxp9r5WtAJqt2YTHQ== X-Received: by 2002:a7b:c4d2:0:b0:3d1:f270:a81e with SMTP id g18-20020a7bc4d2000000b003d1f270a81emr27490719wmk.17.1671226974271; Fri, 16 Dec 2022 13:42:54 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/36] hw/misc/mos6522: Convert TYPE_MOS6522 to 3-phase reset Date: Fri, 16 Dec 2022 21:42:17 +0000 Message-Id: <20221216214244.1391647-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671229741577100002 Convert the TYPE_MOS6522 parent class to use 3-phase reset. This is a prerequisite for converting its subclasses. Signed-off-by: Peter Maydell Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20221110143459.3833425-2-peter.maydell@linaro.org --- hw/misc/mos6522.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index fe38c44426b..0ed631186c3 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -643,9 +643,9 @@ const VMStateDescription vmstate_mos6522 =3D { } }; =20 -static void mos6522_reset(DeviceState *dev) +static void mos6522_reset_hold(Object *obj) { - MOS6522State *s =3D MOS6522(dev); + MOS6522State *s =3D MOS6522(obj); =20 s->b =3D 0; s->a =3D 0; @@ -705,9 +705,10 @@ static Property mos6522_properties[] =3D { static void mos6522_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_CLASS(oc); =20 - dc->reset =3D mos6522_reset; + rc->phases.hold =3D mos6522_reset_hold; dc->vmsd =3D &vmstate_mos6522; device_class_set_props(dc, mos6522_properties); mdc->portB_write =3D mos6522_portB_write; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228679; cv=none; d=zohomail.com; s=zohoarc; b=hmb1NHO80NRFi9iCys6v3A8Iw8EE3Lp6yJfaN7WddBaX8iretFI3kQRvJAwtMQgEJf/+RX1iwHuTPGi2NrV56I1c813ljyxQM3JGGHAX/28YRIck2NTIdqQR4cXjA4f1yyAlIMf+8qzLtFuRPmpXFsn4nnZGrwIHeROGsn+KW+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228679; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=21r9CxWzALIMyBFcFfX8uwReEH2XuTI7G3xkkaCFq6A=; b=KJ8CS95o/NDHphPZzyFaDKXAMLVEzPPMNIYeMOj0HGp1lWT0tKXYAzpdpg3dNtlNOg1kaIobf7MZs9tCKsKaKyeCrYCfBvMyre8/RocAEyA3NgrgvA9UOGctKeu9jQ/GNlaLuar9YMvUrwYEFRZsY57FTZT/8kkMvgRMXFCiYes= 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 16712286799381009.2935409730856; Fri, 16 Dec 2022 14:11:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU3-000613-7P; Fri, 16 Dec 2022 16:43: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 1p6ITs-0005wc-Ly for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITp-0000cM-Dn for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:00 -0500 Received: by mail-wm1-x330.google.com with SMTP id o5-20020a05600c510500b003d21f02fbaaso4980547wms.4 for ; Fri, 16 Dec 2022 13:42:56 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=21r9CxWzALIMyBFcFfX8uwReEH2XuTI7G3xkkaCFq6A=; b=crP/TfttSK1H9ClAZxV2e+sRHm+opVPbaC/rcihlXWVYIPxl/bblQDGQ3rgiG12Soa dc4U17rO2ch32duTgbBJSoCEpfhEg+9h1EuXsZDP4JLEfyfrz+KwBQwDpyX5/5ZHoGUS iSchmil9dzQaPF7xSfgfg0lNJB/9jxCGMGndY/WmpF0XMrGMyy8MI7w7yaXkR4GgANLJ D6fIiOs/fpDVGkr/R0N4cIC7GVDvN71WPQ9TzwQZGwLUJaNy+PFtC4Bv+55Ekan0rQrl vTKdGmUFfTH5A5k0BXEM3RQATQyPw0dOBUALFs4CTxEcBtRmEWxoFZOzwZ4CB49xhRIS a90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=21r9CxWzALIMyBFcFfX8uwReEH2XuTI7G3xkkaCFq6A=; b=5mnhMycq+zlVEoyO0RrFgFcttKTXwfpNPLB+WsagXe2+qB3BcgVt/+aY2Jdkknh9I0 4yCvOTE7zyz8jbbiQSQhZ/SNrIdwjja9g1NzsTr106t3eMC/SfUdWrmWrbLDcY5eB25h bXdYfBndPoNU9puSsFfVqqezl3RA3h6nsqmqhAAxprNjrBaqwrW4osywlZGqWAs2TD7B wT32Foy4pNAyIk8hoCjTVdqFhJVED5U8zDV2sXEO1Q1umDNpJl0ojqc6zlQXNqI9G4W5 abE9diIkUnq5dfZlp8zfzuF1l4y0LlDLswmKY9XPaskFXCTsipAekw/UwLVehtqNd6RB 5qGQ== X-Gm-Message-State: ANoB5pklbEx6rWqD8ZHNF2ZZdnVLLvm2jmP0jTGVF/QQiAwRYUThLVR3 40nZcpqrICQNNy0q23I1w+q+MBYm2ccm6aH8 X-Google-Smtp-Source: AA0mqf4IW9GwYIgVb/XUH0a9dAJC9BghPIODPxcMktZrVLRujTksFkRKgCp3tybdUaDJS1LF6eDQ9Q== X-Received: by 2002:a05:600c:3b8e:b0:3cf:d428:21d6 with SMTP id n14-20020a05600c3b8e00b003cfd42821d6mr27388700wms.3.1671226975217; Fri, 16 Dec 2022 13:42:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/36] hw/misc: Convert TYPE_MOS6522 subclasses to 3-phase reset Date: Fri, 16 Dec 2022 21:42:18 +0000 Message-Id: <20221216214244.1391647-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671228681947100003 Convert the various subclasses of TYPE_MOS6522 to 3-phase reset. This removes some uses of device_class_set_parent_reset(), which we would eventually like to be able to get rid of. Signed-off-by: Peter Maydell Acked-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221110143459.3833425-3-peter.maydell@linaro.org --- include/hw/misc/mos6522.h | 2 +- hw/misc/mac_via.c | 26 ++++++++++++++++---------- hw/misc/macio/cuda.c | 14 ++++++++------ hw/misc/macio/pmu.c | 14 ++++++++------ 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index 0bc22a83957..05872fffc92 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -157,7 +157,7 @@ OBJECT_DECLARE_TYPE(MOS6522State, MOS6522DeviceClass, M= OS6522) struct MOS6522DeviceClass { DeviceClass parent_class; =20 - DeviceReset parent_reset; + ResettablePhases parent_phases; void (*portB_write)(MOS6522State *dev); void (*portA_write)(MOS6522State *dev); /* These are used to influence the CUDA MacOS timebase calibration */ diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index f42c12755a9..076d18e5fd9 100644 --- a/hw/misc/mac_via.c +++ b/hw/misc/mac_via.c @@ -975,14 +975,16 @@ static int via1_post_load(void *opaque, int version_i= d) } =20 /* VIA 1 */ -static void mos6522_q800_via1_reset(DeviceState *dev) +static void mos6522_q800_via1_reset_hold(Object *obj) { - MOS6522Q800VIA1State *v1s =3D MOS6522_Q800_VIA1(dev); + MOS6522Q800VIA1State *v1s =3D MOS6522_Q800_VIA1(obj); MOS6522State *ms =3D MOS6522(v1s); MOS6522DeviceClass *mdc =3D MOS6522_GET_CLASS(ms); ADBBusState *adb_bus =3D &v1s->adb_bus; =20 - mdc->parent_reset(dev); + if (mdc->parent_phases.hold) { + mdc->parent_phases.hold(obj); + } =20 ms->timers[0].frequency =3D VIA_TIMER_FREQ; ms->timers[1].frequency =3D VIA_TIMER_FREQ; @@ -1097,11 +1099,12 @@ static Property mos6522_q800_via1_properties[] =3D { static void mos6522_q800_via1_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_CLASS(oc); =20 dc->realize =3D mos6522_q800_via1_realize; - device_class_set_parent_reset(dc, mos6522_q800_via1_reset, - &mdc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mos6522_q800_via1_reset_h= old, + NULL, &mdc->parent_phases); dc->vmsd =3D &vmstate_q800_via1; device_class_set_props(dc, mos6522_q800_via1_properties); } @@ -1123,12 +1126,14 @@ static void mos6522_q800_via2_portB_write(MOS6522St= ate *s) } } =20 -static void mos6522_q800_via2_reset(DeviceState *dev) +static void mos6522_q800_via2_reset_hold(Object *obj) { - MOS6522State *ms =3D MOS6522(dev); + MOS6522State *ms =3D MOS6522(obj); MOS6522DeviceClass *mdc =3D MOS6522_GET_CLASS(ms); =20 - mdc->parent_reset(dev); + if (mdc->parent_phases.hold) { + mdc->parent_phases.hold(obj); + } =20 ms->timers[0].frequency =3D VIA_TIMER_FREQ; ms->timers[1].frequency =3D VIA_TIMER_FREQ; @@ -1183,10 +1188,11 @@ static const VMStateDescription vmstate_q800_via2 = =3D { static void mos6522_q800_via2_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_CLASS(oc); =20 - device_class_set_parent_reset(dc, mos6522_q800_via2_reset, - &mdc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mos6522_q800_via2_reset_h= old, + NULL, &mdc->parent_phases); dc->vmsd =3D &vmstate_q800_via2; mdc->portB_write =3D mos6522_q800_via2_portB_write; } diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 0d4c13319a8..853e88bfedd 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -589,12 +589,14 @@ static void mos6522_cuda_portB_write(MOS6522State *s) cuda_update(cs); } =20 -static void mos6522_cuda_reset(DeviceState *dev) +static void mos6522_cuda_reset_hold(Object *obj) { - MOS6522State *ms =3D MOS6522(dev); + MOS6522State *ms =3D MOS6522(obj); MOS6522DeviceClass *mdc =3D MOS6522_GET_CLASS(ms); =20 - mdc->parent_reset(dev); + if (mdc->parent_phases.hold) { + mdc->parent_phases.hold(obj); + } =20 ms->timers[0].frequency =3D CUDA_TIMER_FREQ; ms->timers[1].frequency =3D (SCALE_US * 6000) / 4700; @@ -602,11 +604,11 @@ static void mos6522_cuda_reset(DeviceState *dev) =20 static void mos6522_cuda_class_init(ObjectClass *oc, void *data) { - DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_CLASS(oc); =20 - device_class_set_parent_reset(dc, mos6522_cuda_reset, - &mdc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mos6522_cuda_reset_hold, + NULL, &mdc->parent_phases); mdc->portB_write =3D mos6522_cuda_portB_write; mdc->get_timer1_counter_value =3D cuda_get_counter_value; mdc->get_timer2_counter_value =3D cuda_get_counter_value; diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index 70562ed8d07..97ef8c771b6 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -797,14 +797,16 @@ static void mos6522_pmu_portB_write(MOS6522State *s) pmu_update(ps); } =20 -static void mos6522_pmu_reset(DeviceState *dev) +static void mos6522_pmu_reset_hold(Object *obj) { - MOS6522State *ms =3D MOS6522(dev); + MOS6522State *ms =3D MOS6522(obj); MOS6522PMUState *mps =3D container_of(ms, MOS6522PMUState, parent_obj); PMUState *s =3D container_of(mps, PMUState, mos6522_pmu); MOS6522DeviceClass *mdc =3D MOS6522_GET_CLASS(ms); =20 - mdc->parent_reset(dev); + if (mdc->parent_phases.hold) { + mdc->parent_phases.hold(obj); + } =20 ms->timers[0].frequency =3D VIA_TIMER_FREQ; ms->timers[1].frequency =3D (SCALE_US * 6000) / 4700; @@ -814,11 +816,11 @@ static void mos6522_pmu_reset(DeviceState *dev) =20 static void mos6522_pmu_class_init(ObjectClass *oc, void *data) { - DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_CLASS(oc); =20 - device_class_set_parent_reset(dc, mos6522_pmu_reset, - &mdc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mos6522_pmu_reset_hold, + NULL, &mdc->parent_phases); mdc->portB_write =3D mos6522_pmu_portB_write; } =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228660; cv=none; d=zohomail.com; s=zohoarc; b=EgA/TdQ93uw6lkmCXTNRB7xzylduAoXqvg1fh/yNmQ3QaTzbLIWMHWqqjKTKw0psPfMOoS3yylS7WdXaMrksAfrqUR/DNWVq/S49fNQ3LFFEU+TK+83C0Ya0b+KkLxSqpK7xGQdLe4b+EP7GE7tCFGRiOtjrPvZroruNMpVC0/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228660; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=nvPk54QRJ/qyA59be4zwXugaGblwrr78KUg8Kl3uc4hK4Bp6GbSordGJiCU5ZOA9E9pcAEKP+rrZ5KaevpGAasER3ngMFFBNDiTt1mCMDrLWjMY8tZiasmUvXxHgS80lD9Cyz2jXHisQNReYWXTj3TcAuY6yvXaAKnewOWguSIA= 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 1671228660820483.8979850618813; Fri, 16 Dec 2022 14:11:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU6-00062M-AD; Fri, 16 Dec 2022 16:43:14 -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 1p6ITt-0005wj-Db for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITp-0000ck-JY for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:01 -0500 Received: by mail-wm1-x32d.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so2678214wmb.5 for ; Fri, 16 Dec 2022 13:42:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=qb+2tEd3ZMRI8oYO2pEAvtPDETaxH9yq6tRX2MTRfIVo+B74H2pXLtzp3KkZodsm3y WCmFGJxa8y9CkLDa2W0eDB2vFcZ4TxJWQ+gldQs1YjA997ivDEoQF1GYJN0mbZYgU12J FYVTwXzFcmAm8Eq5nd70M2GQE47NnqCrD7UdYAQa70HD23lVv0GhoybGJLDFUXq3NjfG evCXr5/9tO1z8Bl+7SsVsigyu8IPZ5phwLA2P269051HeIgBHNc3tsbLOR6Z77LIhyUw 5igU4q8iba7+adblpWac6kZopYKgpWmLaOV/HdGaCO8aeqXkK4rPUrOq390NWJXpTXNJ 45JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=bnHpzsN/up1ud/+/6wAH5Q3jgEvVMLMdyfAN32cMipchTYe25WrFqXdRC1OXN61doh GJdZE+0CyWcGyOy/Isg+ABiMWLCPVlr9nUmjIsCwvv+cpZp0jE3/mWvnbZ2ZonGz5+Zy TUtvnPPxL1Bi4b3jORiFlqQsBvWCgLEC126x43WgJtwEKYMpB91DsY/4daoPjHYSh5it xGmGITiZVnPbRvbftf5Mgky/MSsTqkIBbOsCXBTjCdggC7IAvwMbcA+B5IKkMKG5VyHx QUsMTe3HOHGo79SxKibq/s/UAoKAsQ4uuIr0wTcn30SYbjzT0fRr5c85V0NqGGJ3v6D0 XnQw== X-Gm-Message-State: ANoB5pnJUMY8rYPbAsRxUyukmzgAr8PrEVrMxETji6LSpqAyHL4KR3qH f4RGKbUjWlsRI2a5AqlA4zGBV8G8fecrPD1R X-Google-Smtp-Source: AA0mqf48S8NKCk6thIzDSH6PlCAyvhlDf76Il4Vf2NgeJQjj83EV/LASKRKvpYHtnw/DQ69Y5QfAyQ== X-Received: by 2002:a05:600c:1e01:b0:3cf:a4fa:510 with SMTP id ay1-20020a05600c1e0100b003cfa4fa0510mr26952345wmb.30.1671226976267; Fri, 16 Dec 2022 13:42:56 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/36] hw/core/cpu-common: Convert TYPE_CPU class to 3-phase reset Date: Fri, 16 Dec 2022 21:42:19 +0000 Message-Id: <20221216214244.1391647-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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: 1671228661793100009 Convert the parent class TYPE_CPU to 3-phase reset. This is a necessary prerequisite to converting the subclasses. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Message-id: 20221124115023.2437291-2-peter.maydell@linaro.org --- hw/core/cpu-common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index f9fdd46b9d7..78b5f350a00 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -116,9 +116,9 @@ void cpu_reset(CPUState *cpu) trace_guest_cpu_reset(cpu); } =20 -static void cpu_common_reset(DeviceState *dev) +static void cpu_common_reset_hold(Object *obj) { - CPUState *cpu =3D CPU(dev); + CPUState *cpu =3D CPU(obj); CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 if (qemu_loglevel_mask(CPU_LOG_RESET)) { @@ -259,6 +259,7 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu) static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); CPUClass *k =3D CPU_CLASS(klass); =20 k->parse_features =3D cpu_common_parse_features; @@ -269,7 +270,7 @@ static void cpu_class_init(ObjectClass *klass, void *da= ta) set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize =3D cpu_common_realizefn; dc->unrealize =3D cpu_common_unrealizefn; - dc->reset =3D cpu_common_reset; + rc->phases.hold =3D cpu_common_reset_hold; cpu_class_init_props(dc); /* * Reason: CPUs still need special care by board code: wiring up --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671230013; cv=none; d=zohomail.com; s=zohoarc; b=N93W2iR84MwI2c4S5linoisQRgf9elqyWTeGFA2peLxXDc0iuCmb3oeE5hMw7QdqVkFYsFP+IHc4bEad1hp3pKphqS1mkBK32RLNjAKks3k1zs2oJmDXVKOkLSKfh/2CJyrC6nuDat1+whxJ251Cu2xFjUrybQWzodQIp3NLk8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671230013; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dunqq5wh2SHxaxGYJwoMKd8AXFWzRcMTlvb9MMShOc4=; b=Vf+qW8hrmZWq9L0f7ChRWm6B29wsEIhNJYZTMNdDEtNHKoNu1vzRSF5qPty1VFJ195cYTmBgcMrt+wTMGUq19nWRsT+DOBnaFScBgZ0dgPoD3hHwVwCK3c6C30xq8p7nrMBgC2CjQ90lDt0HII7BgjnvKP2IXW2Bb6+xVqrf/XY= 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 167123001376571.57241873561054; Fri, 16 Dec 2022 14:33:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU7-00063k-QC; Fri, 16 Dec 2022 16:43:16 -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 1p6ITt-0005wk-VA for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -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 1p6ITr-0000bF-7y for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:01 -0500 Received: by mail-wm1-x333.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso1997490wmb.1 for ; Fri, 16 Dec 2022 13:42:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=dunqq5wh2SHxaxGYJwoMKd8AXFWzRcMTlvb9MMShOc4=; b=TLP1xrFhSRfMUMqkyT+dTh13tj/ELikcOblvMo5R4hWvlrtYhcjuUN6HLzod2ptn1w Oqoq1DPOcKAHWBfL+Aj3n/yRsgVN+OapNb/SvOCE9SObATp7P+J2RV1OM5TB0vWJl9th bm4g6Ubj8U6N6u740R2JhQh60fjcbi2+LEZF4qpT2WC2TO7mdZ4EITBWVztM+op1CuiF LL/1Aw8uPsUC/WXlhu3tKUlwoAM9dTzKQdFShaUjG/zEAG0l8mEGTOwn70Jcg0epu6iP TnYsEj8P1lhhy7BbRzF3/AYQsGqzdrxwBz3v2hLGdJzy2Boz16fNT+5GPgboR4nlAEAg OotQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dunqq5wh2SHxaxGYJwoMKd8AXFWzRcMTlvb9MMShOc4=; b=41PqaYvSLc2yzR9BiOhFSMkjFrlJwc5NUKStJbZ1YXbHioMzPO23oHVvjF/XIEnN97 Egua7iPWLRHNGnZ785yk3fNfMxRFbX7kbah/muXRv2z4OQX7xKL+YYFAtcGnPgXEnWVN UNSzVDD+JWr8aYMe0jfCthILUJn4+3kVKumqn55KAENQ+tSzXhZnq7jzxOVpvbBjS5yZ hrSuv+0qvFGNYWnNfY/oTR3x4rdT7lHBkWKUOr5Iafbb7iXdpHJDQyar9v1QjP77pdWK QwQqgU5kWbyDb7FO6TVjPc2z9Rq/yZAII3QMDsR8ULP7AiEtTFmO/FVUZ3vOCNhJAe9J 5WiA== X-Gm-Message-State: ANoB5pnRM/ShBShCqJ98M4CIfRPO1H6GeER7guH9GuJZPDTEb6qaABcy Y6FV9M70f3FkjpEtFZ3XPSl7unCVzOKB8BVF X-Google-Smtp-Source: AA0mqf5ITsKy3hj6kkedX5GY5RCFXNYEQvXtm357V1fHoxYT4jCciAGMc9wAdduVaRfcWmyS2qE15g== X-Received: by 2002:a05:600c:3d06:b0:3c6:e60f:3f55 with SMTP id bh6-20020a05600c3d0600b003c6e60f3f55mr26989589wmb.12.1671226977379; Fri, 16 Dec 2022 13:42:57 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/36] target/arm: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:20 +0000 Message-Id: <20221216214244.1391647-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::333; envelope-from=peter.maydell@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 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: 1671230014723100001 Convert the Arm CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Message-id: 20221124115023.2437291-3-peter.maydell@linaro.org --- target/arm/cpu-qom.h | 4 ++-- target/arm/cpu.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h index 64c44cef2dd..514c22ced9b 100644 --- a/target/arm/cpu-qom.h +++ b/target/arm/cpu-qom.h @@ -43,7 +43,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info); /** * ARMCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * An ARM CPU model. */ @@ -54,7 +54,7 @@ struct ARMCPUClass { =20 const ARMCPUInfo *info; DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0f55004d7e7..2fa022f62ba 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -202,14 +202,16 @@ static void cp_reg_check_reset(gpointer key, gpointer= value, gpointer opaque) assert(oldvalue =3D=3D newvalue); } =20 -static void arm_cpu_reset(DeviceState *dev) +static void arm_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); ARMCPU *cpu =3D ARM_CPU(s); ARMCPUClass *acc =3D ARM_CPU_GET_CLASS(cpu); CPUARMState *env =3D &cpu->env; =20 - acc->parent_reset(dev); + if (acc->parent_phases.hold) { + acc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUARMState, end_reset_fields)); =20 @@ -2211,12 +2213,15 @@ static void arm_cpu_class_init(ObjectClass *oc, voi= d *data) ARMCPUClass *acc =3D ARM_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(acc); DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, arm_cpu_realizefn, &acc->parent_realize); =20 device_class_set_props(dc, arm_cpu_properties); - device_class_set_parent_reset(dc, arm_cpu_reset, &acc->parent_reset); + + resettable_class_set_parent_phases(rc, NULL, arm_cpu_reset_hold, NULL, + &acc->parent_phases); =20 cc->class_by_name =3D arm_cpu_class_by_name; cc->has_work =3D arm_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228196; cv=none; d=zohomail.com; s=zohoarc; b=WGSTDn7SobiT+6LOr4yOtNRuAXz84PEQr9BhkDvH39m65i626DhUfwNhPQnoNc7Kl9rMQAcLt7+n3p15ddZrsfBPOYO+60qk1Ywxtx8T9hClErmedHr9L78ucDx9iUxvrWmHUNFFzBa1BNzc2VyWFQRnM8d1EQ3ibkLDhm3cE84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228196; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PZCvJDQbNUr26OElgPGYt8xyDSU+rXGhRrJxQ62tt6I=; b=CYCth1rc8c7pVvi3WtFNO9ghViKhORTz+Xbft26L6rm/4JzYDRnMY+8AKulQWw2zVswbnDgWsHGzuTUx/AP1wPxFOtgCF3WdUKtytJvPsm9+F+/l/aenO8/W6+ovf5H5SLqF4mUf7I4yKfKhENZU6xkrN7WOEn1WAI91TE8ExGM= 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 167122819647777.38512419345318; Fri, 16 Dec 2022 14:03:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU4-00061Q-9s; Fri, 16 Dec 2022 16:43: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 1p6ITt-0005wl-WA for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITs-0000eW-Dd for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:01 -0500 Received: by mail-wm1-x335.google.com with SMTP id o15so2731588wmr.4 for ; Fri, 16 Dec 2022 13:42:59 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=PZCvJDQbNUr26OElgPGYt8xyDSU+rXGhRrJxQ62tt6I=; b=YYoy1aO3+lYoJh64G7LrZ1tDNp8x8plOkrOQNOYbQDes7vVon9JENG5KNnXcZAAiCx HMB7H5RvVMRahEd05i2omeeWh6daUiF/QHDkS6NKFdBFLpA4z+RJS4eGtztqFetahV2A NTW6SrhgZNrwgFSKMRbmFtpV5zJiTYTl/lBts4mPnsKwZ+SdIhWYvCngYaj7DieSJs5P fZtkBVWat/jZBaSZSRCu1EtKB1mdP0p7nzWFdhv+lytBMZYHDEOij6yZFdKLeiV7V35G 9iAI4qhgIWJBjE8mnwZxcnbJu4M+hRFD48vsHAliymr30BO+Ly21Sx7cgzXume0VM8jg veYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=PZCvJDQbNUr26OElgPGYt8xyDSU+rXGhRrJxQ62tt6I=; b=1pEM7DM6xqGTjRrotcuqX7n4KtUiYxo/ee/SbdsvOju9lQL09eBZ10vWWcV/Swzcj0 EEZRi5PwZGlyWS7SEOlBK+i7a9+Ux8mnqIjdavVtGaAGByWTKftwiqOJWP0MPlzNc0nq jVKdWQiLmR0vCi8TYj7nxQ0Se5FBGOTBrCnKPWy01THC3zocO/gmTAFiE8SUfUmHNKr0 SEhQvDQ/XjhasBmLb+raATWg//gljTg4y1p9X+7dhBBjgtGcG8Wh60MUxL1DQ1Ln5IZK Yvr1cdR5HRsspisHJQXC7liIBRZ1Qb4ln0Xn5su93WD2XXTcHNmty+q8P4wso2sU/SZv +Smw== X-Gm-Message-State: ANoB5plbhX23i+yHNCpKwZHLHKA1Jxv+WKZQoWw2dyeMzF8Z0sptGTpn mmDIwJ1Oc38u8xQbOCifaL2VQ9gdpZlv8iXY X-Google-Smtp-Source: AA0mqf6Nbj/FQl7lJ9xWjXb3xSPmLrBXX/pHR/yyuFlczROAWOovWRsT2C3jy22h584b84IZyO56iA== X-Received: by 2002:a05:600c:3c95:b0:3cf:e7c8:494 with SMTP id bg21-20020a05600c3c9500b003cfe7c80494mr26547301wmb.29.1671226978353; Fri, 16 Dec 2022 13:42:58 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/36] target/avr: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:21 +0000 Message-Id: <20221216214244.1391647-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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 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: 1671228197703100001 Convert the avr CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Message-id: 20221124115023.2437291-4-peter.maydell@linaro.org --- target/avr/cpu-qom.h | 4 ++-- target/avr/cpu.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h index b5c3507d6d7..01ea5f160b6 100644 --- a/target/avr/cpu-qom.h +++ b/target/avr/cpu-qom.h @@ -31,7 +31,7 @@ OBJECT_DECLARE_CPU_TYPE(AVRCPU, AVRCPUClass, AVR_CPU) /** * AVRCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A AVR CPU model. */ @@ -40,7 +40,7 @@ struct AVRCPUClass { CPUClass parent_class; /*< public >*/ DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/avr/cpu.c b/target/avr/cpu.c index c7295b488d1..d0139804b9f 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -67,14 +67,16 @@ static void avr_restore_state_to_opc(CPUState *cs, env->pc_w =3D data[0]; } =20 -static void avr_cpu_reset(DeviceState *ds) +static void avr_cpu_reset_hold(Object *obj) { - CPUState *cs =3D CPU(ds); + CPUState *cs =3D CPU(obj); AVRCPU *cpu =3D AVR_CPU(cs); AVRCPUClass *mcc =3D AVR_CPU_GET_CLASS(cpu); CPUAVRState *env =3D &cpu->env; =20 - mcc->parent_reset(ds); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } =20 env->pc_w =3D 0; env->sregI =3D 1; @@ -223,9 +225,12 @@ static void avr_cpu_class_init(ObjectClass *oc, void *= data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); AVRCPUClass *mcc =3D AVR_CPU_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, avr_cpu_realizefn, &mcc->parent_re= alize); - device_class_set_parent_reset(dc, avr_cpu_reset, &mcc->parent_reset); + + resettable_class_set_parent_phases(rc, NULL, avr_cpu_reset_hold, NULL, + &mcc->parent_phases); =20 cc->class_by_name =3D avr_cpu_class_by_name; =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228575; cv=none; d=zohomail.com; s=zohoarc; b=jB7KBiA/UWi6hNYMUOk+IzqkfsZAalbuSpc9L4VSBwULyP813YmiTPwE2M0hW/oIquM2p1LUrRSpsv+nDek8DkbLCFWqISTPbNkHFejk26P2RNOGIGTEY9ysqfKy6egrFztJWCfqpZu7Zet0EiA45LGeUAofQsqjF2v/8fUqdCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228575; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q8tZDsND3tybaP48R6M+gEKoRel5tUUnDBAqMV6lK9Q=; b=hSSf6OJKBQf9pjqNX3skTRK+Xhcg2GEQb5C5whPSyqwbL4u2455N+qEU8q3dn3qP6udkLvytjJhgvul5Ip7AHlhkxPVFaEaOBH1K2teXEj/cy/XnmijDR92A8SmH3MldZzEyR7/dYmr0Zmykt/vkyr7NqP+GwEQVbxUG6Kn4Kdg= 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 1671228575682491.53221944617644; Fri, 16 Dec 2022 14:09:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU2-00060x-T6; Fri, 16 Dec 2022 16:43: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 1p6ITu-0005wq-IP for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITs-0000ea-P6 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:02 -0500 Received: by mail-wm1-x32d.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso1997512wmb.1 for ; Fri, 16 Dec 2022 13:43:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=q8tZDsND3tybaP48R6M+gEKoRel5tUUnDBAqMV6lK9Q=; b=EfjNw6lLQ7hF6jJDimXg59ek5raX471SFaougtz/J6/qx3/dk8eIHkCB7Tma4zLBOQ +GomQ3uBMM6PHaQf3nvFLWHRcKHZZHhYXkLLruIPh8DVp7zWrl6zEEUK8YVypbceI8es ISSngj/3F5005JvE7/WfuRi3sbiMidwk+K0txKaxHhf8yfwiH67icNNQigy1xHS8PfhN Zsv6QQ4wUrR3zXcJSvCIkUoSbsXV9rqvNPSUBugvqIEpt1Dup54jf/psbiBX+jByQXs7 Cv4CAgpxA/6RL4qV5xA5Qnh6eW/9TkmFkIYtv0ER3hd8uQzTGhxCOMHLsLcRmTLe58Lu I9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=q8tZDsND3tybaP48R6M+gEKoRel5tUUnDBAqMV6lK9Q=; b=rwUTXFVNZOYKbv5FO6gF3xnhRPepPaYg+xMstd7TXC0UTQK4CBPCroG8ZAJq+l170R GhYKpvJcUVZNUl7hiLRrrFcbqFnyW+4X5a1Htl3dF4+mf9N8P5nJfpd32BRT0GQvyrRC mjQVJoeZb7fnEQ539AadhXgE0DRgTF5L8te+TVM9jNFXiKkhtBgN/mCWDCQtRWyMy7Wx aRMu1xy6MOzwRTW3PVlGMmxCSVcfi3fgsvU9jL205FjRuwNDf9UFKXNGjHSy98ZDw6aH zVZ0XK5+rsbixSVxe/i5WFEr1Nr5+zRwboeq6I6+cO2IwnKyfLartOsDZG318d9OGSMf RCJQ== X-Gm-Message-State: ANoB5pl4hGWl3SJoKf2RMMK7AuZd4iBqucgTmn3Ryexf79E+u00RmH4N fHGjjEfhcuCGrNa1PbaCBPnv/qtT3xlzNIud X-Google-Smtp-Source: AA0mqf4m54UmBJ1Zvktk3t6C1b29wsKsmZZe074WzXPHYP1nxszHz3wK/gr3+EbG+4LkhHp2xvG12g== X-Received: by 2002:a05:600c:3b93:b0:3d2:3e75:7bb9 with SMTP id n19-20020a05600c3b9300b003d23e757bb9mr8073893wms.34.1671226979235; Fri, 16 Dec 2022 13:42:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/36] target/cris: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:22 +0000 Message-Id: <20221216214244.1391647-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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: 1671228577333100001 Convert the cris CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Message-id: 20221124115023.2437291-5-peter.maydell@linaro.org --- target/cris/cpu-qom.h | 4 ++-- target/cris/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/cris/cpu-qom.h b/target/cris/cpu-qom.h index 71e8af0e70a..431a1d536a9 100644 --- a/target/cris/cpu-qom.h +++ b/target/cris/cpu-qom.h @@ -30,7 +30,7 @@ OBJECT_DECLARE_CPU_TYPE(CRISCPU, CRISCPUClass, CRIS_CPU) /** * CRISCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * @vr: Version Register value. * * A CRIS CPU model. @@ -41,7 +41,7 @@ struct CRISCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; =20 uint32_t vr; }; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index fb05dc6f9ab..a6a93c23595 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -56,15 +56,17 @@ static bool cris_cpu_has_work(CPUState *cs) return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI= ); } =20 -static void cris_cpu_reset(DeviceState *dev) +static void cris_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); CRISCPU *cpu =3D CRIS_CPU(s); CRISCPUClass *ccc =3D CRIS_CPU_GET_CLASS(cpu); CPUCRISState *env =3D &cpu->env; uint32_t vr; =20 - ccc->parent_reset(dev); + if (ccc->parent_phases.hold) { + ccc->parent_phases.hold(obj); + } =20 vr =3D env->pregs[PR_VR]; memset(env, 0, offsetof(CPUCRISState, end_reset_fields)); @@ -305,11 +307,13 @@ static void cris_cpu_class_init(ObjectClass *oc, void= *data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); CRISCPUClass *ccc =3D CRIS_CPU_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, cris_cpu_realizefn, &ccc->parent_realize); =20 - device_class_set_parent_reset(dc, cris_cpu_reset, &ccc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, cris_cpu_reset_hold, NULL, + &ccc->parent_phases); =20 cc->class_by_name =3D cris_cpu_class_by_name; cc->has_work =3D cris_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671227514; cv=none; d=zohomail.com; s=zohoarc; b=nXlj+AvaQ74RAoAVC55d4Tv8ESK2IAgmPfC8fYxZK93Y9t15v+3O3jrDIb7merV/vsCJe/csJHniNc+B2EssYq9Bmn2r+Dh+rK2CUe5nCkcse9vJByjN41BecPsTknCJVtT0YK0Qb/ANXG/Gu78Kwh3vLzK1XmOFMyzZeUR58sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227514; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NlLR2z3qolE9UkVci7mw2GXgMx349fCTP5JUzSE62RQ=; b=hfYEBhn5SlX2slPKpOOXDMLNmNUTf+kf5OgL4gjlcP5VEaAT0YjiAl01omsv8OXncTsGfG7AY63S0NFj0zSJvwl17QSsinwK+lCGsWi/xROEwaYL8WqNbNPlQTIm0ITiUTo9nGfowYsj2h5E4un2Z6G5B8igK1+m++w//oWxUyg= 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 1671227514322547.7783408099284; Fri, 16 Dec 2022 13:51:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU4-00061Z-EU; Fri, 16 Dec 2022 16:43: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 1p6ITu-0005wt-M5 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITs-0000ag-QB for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:02 -0500 Received: by mail-wm1-x330.google.com with SMTP id ay14-20020a05600c1e0e00b003cf6ab34b61so5001336wmb.2 for ; Fri, 16 Dec 2022 13:43:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=NlLR2z3qolE9UkVci7mw2GXgMx349fCTP5JUzSE62RQ=; b=bScts5i56vU/uLIcXiRNf5AUdcGkeLW/PbIaYPQDLAKftZ0zUFClUy1QiLY5G/mFv8 cjiMAZLn/f9h54F0QUyPR6Q/IQqPpzwBsCHOpFhCFvL8QNDyBT5ZCnVy8cPBLp0hy566 s0OVA6AsXFBl8IMs5VSdI3GPrZ9egUxh5eWAeoJQM8CQxCm7EKGU7SHhF/B6FZur5ELF 0nP9JAMSmW9jNUBwDfsj4gBE4cnP71dylBMOBvUNxo9tQ6obw+bnfVqGE+4As4b8xm0h G0Hjj4HCmdm8+JV73KL5ckyQ4oFYaWW7WhCSmtxKdQC/TBopys5bHMVFq8MHRA3Rdv9J 9hQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NlLR2z3qolE9UkVci7mw2GXgMx349fCTP5JUzSE62RQ=; b=K/W2zd4B7z3G/7qCgKKiO7smGVzBp/QVRjiQaMo/Tk2J0SAWponU46ljaAtitWWZwu rP87/wnRR8mJSF7tkVJWCBITvPXDNSMHzymHOfzRBIfOknIC9VOhMBwGi9VCit+vDElB aoPUYBvBmODXkDf6CYSCbP3VrjTgvoETEVqLIhtlQelHVn0cPgF7UjkKc2etwltpjl+b ELmkojwLkgPu9pQ+fmu3MKPX5u2uDry3Ko/5nSNQhTb62t0Def5C/NSbRuLbRtFriuQ+ lWqGVQQLZ5B025DxjPam8o9HGrSCVy4Vn4us1A9HC4GGp/rriU5Lfw0oB2T+d7ogf1kT 4oYg== X-Gm-Message-State: AFqh2koxjrSiFoP7zcS6nhmk70GQR0FnQWzDqnIj448xHnH1pq9ZrvFv Es37d0BnJCji8ZEsKWmYeCDJPSvN3LyWwoU4 X-Google-Smtp-Source: AMrXdXsmjaW+UQ238E8X2biTHeIHSVUvuY+lNclJ6PjwLE9RQVR/4prCbCcWjBvWOgCbZbC70AW2tQ== X-Received: by 2002:a05:600c:1e29:b0:3d3:404a:8a1b with SMTP id ay41-20020a05600c1e2900b003d3404a8a1bmr3957083wmb.8.1671226980085; Fri, 16 Dec 2022 13:43:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/36] target/hexagon: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:23 +0000 Message-Id: <20221216214244.1391647-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671227515325100003 Convert the hexagon CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-6-peter.maydell@linaro.org --- target/hexagon/cpu.h | 2 +- target/hexagon/cpu.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 2a65a57bab3..794a0453fd4 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -137,7 +137,7 @@ typedef struct HexagonCPUClass { CPUClass parent_class; /*< public >*/ DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; } HexagonCPUClass; =20 struct ArchCPU { diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 03221fbdc28..658ca4ff783 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -281,14 +281,16 @@ static void hexagon_restore_state_to_opc(CPUState *cs, env->gpr[HEX_REG_PC] =3D data[0]; } =20 -static void hexagon_cpu_reset(DeviceState *dev) +static void hexagon_cpu_reset_hold(Object *obj) { - CPUState *cs =3D CPU(dev); + CPUState *cs =3D CPU(obj); HexagonCPU *cpu =3D HEXAGON_CPU(cs); HexagonCPUClass *mcc =3D HEXAGON_CPU_GET_CLASS(cpu); CPUHexagonState *env =3D &cpu->env; =20 - mcc->parent_reset(dev); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } =20 set_default_nan_mode(1, &env->fp_status); set_float_detect_tininess(float_tininess_before_rounding, &env->fp_sta= tus); @@ -339,11 +341,13 @@ static void hexagon_cpu_class_init(ObjectClass *c, vo= id *data) HexagonCPUClass *mcc =3D HEXAGON_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, hexagon_cpu_realize, &mcc->parent_realize); =20 - device_class_set_parent_reset(dc, hexagon_cpu_reset, &mcc->parent_rese= t); + resettable_class_set_parent_phases(rc, NULL, hexagon_cpu_reset_hold, N= ULL, + &mcc->parent_phases); =20 cc->class_by_name =3D hexagon_cpu_class_by_name; cc->has_work =3D hexagon_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228763; cv=none; d=zohomail.com; s=zohoarc; b=VgChVBPc2jsqini/rmHftiMzw0W9UbZadtPdBWyxcyvfCyt5StRvELq22VW03awdtBcu71xJyLXvdgFy0MdGUGlGjxycA7zXd6unaTrMetYKw7R0F905qiZtHaMSYsqGB9B/KuwOIM1kbhGEb3rJB4/jGcDuobZYLbbe0YDE85o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228763; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JHNhVzZ7q07vjZsQq3XKlgrS7g2PS5zs14Th7/Xr78I=; b=hL6TjSZO5B1oHQVtOTYRCTttIfmsmsUnP9OEdiPljEhdcI9rtHFbdnR5p0En3d8Uakr5Tc4fBeeViO7oQQlEW2reKPU9J9DawIjoiPP2PCs6o4MyCWIZhwVd2YE1A/XOvYLpaZ/J6CsFcQNSI7NTwP+v7/37CcHBSQipXRRyEUA= 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 1671228763936193.04134024722498; Fri, 16 Dec 2022 14:12:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU4-00061L-55; Fri, 16 Dec 2022 16:43: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 1p6ITw-0005wx-3z for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -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 1p6ITu-0000fE-EE for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:03 -0500 Received: by mail-wm1-x32f.google.com with SMTP id v7so2786418wmn.0 for ; Fri, 16 Dec 2022 13:43:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=JHNhVzZ7q07vjZsQq3XKlgrS7g2PS5zs14Th7/Xr78I=; b=dHHcUfTEe3uzd7KDM0p+Bh7WAxnBRKrUCEiZcuVdJdse7QHSYJnwNkF27ItWWbRry4 aW9ZNCGPzUgklzofxwPWylpw3OuCceMsg5MDtOZ3mdsx7vEiYkRk4kmydZfazwL/ijP5 1fWqkwk3w9aVzvE8mlM7Q3YXtEORO9y53W83LcymuHJxO203li9Yzeti0VZ6nXBpRSdz 7AUl/jsy01h/VB8T4yyu/2RDFqTyg2WRlsdSTidvlQkagczpMlGERcU76QRpYRNkUciv CszSUZSRKyt6Wf+6viMwqJC3cj2IDAZcQrNx/W8Ms4ibucJ4DlNNUKSF1CPh5Se4rHRu ODtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JHNhVzZ7q07vjZsQq3XKlgrS7g2PS5zs14Th7/Xr78I=; b=BI6JpMQKuBnUMJut2+fbMR/S3J/v2CMCPsl6NbLrpdDmmgWD0P7nZ0+56lLTro9/ch 3wDhV9S0y+7mBWlDfGq0e7Rp8wIWsVw6kgnooubbSY7h+lzVhLAjAbFAzrrk4Xpv23pN SX+UfcZGChbKLJem7eAd3Tf4OIJ5AVG7Kha6bfuouIAKwx6QFW1eSd9hmEmrO/2wn+NL jZBkNRN9axrqSEhv3Vc77VDYwVh2AnOlBL9ZjavhzN67eY3gEGrFyDcBCjdKrQoqASAi tbP1UfoKbWF+2gwv3XlhafRiiOPgTcQ+C+Co8jKX49CbvexBOOKUggmCcCDb3aZaZstw K9dQ== X-Gm-Message-State: ANoB5pk+Oy9rz9T3UsoazeovKGM/nmqQvAftynXVt6ygWEN3J4NN1SEL SLAql98oydBsJqpy72HWCwr/5eEVg1rSS34G X-Google-Smtp-Source: AA0mqf5Crdku8840QY9x2xZYfK35ia5qaAQE/44/jBle5ZoGOK0j88Kgx8Sy30CQexLvpPwB6kclXg== X-Received: by 2002:a05:600c:35c4:b0:3cf:85f7:bbc4 with SMTP id r4-20020a05600c35c400b003cf85f7bbc4mr27647692wmq.2.1671226980957; Fri, 16 Dec 2022 13:43:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/36] target/i386: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:24 +0000 Message-Id: <20221216214244.1391647-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32f; envelope-from=peter.maydell@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 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: 1671228764679100001 Convert the i386 CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-7-peter.maydell@linaro.org --- target/i386/cpu-qom.h | 4 ++-- target/i386/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h index c557a522e1e..2350f4ae609 100644 --- a/target/i386/cpu-qom.h +++ b/target/i386/cpu-qom.h @@ -42,7 +42,7 @@ typedef struct X86CPUModel X86CPUModel; * @migration_safe: See CpuDefinitionInfo::migration_safe * @static_model: See CpuDefinitionInfo::static * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * An x86 CPU model or family. */ @@ -67,7 +67,7 @@ struct X86CPUClass { =20 DeviceRealize parent_realize; DeviceUnrealize parent_unrealize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ae502f0bfea..3410e5e4702 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5877,9 +5877,9 @@ static void x86_cpu_set_sgxlepubkeyhash(CPUX86State *= env) #endif } =20 -static void x86_cpu_reset(DeviceState *dev) +static void x86_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); X86CPU *cpu =3D X86_CPU(s); X86CPUClass *xcc =3D X86_CPU_GET_CLASS(cpu); CPUX86State *env =3D &cpu->env; @@ -5887,7 +5887,9 @@ static void x86_cpu_reset(DeviceState *dev) uint64_t xcr0; int i; =20 - xcc->parent_reset(dev); + if (xcc->parent_phases.hold) { + xcc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUX86State, end_reset_fields)); =20 @@ -7111,6 +7113,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) X86CPUClass *xcc =3D X86_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); FeatureWord w; =20 device_class_set_parent_realize(dc, x86_cpu_realizefn, @@ -7119,7 +7122,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) &xcc->parent_unrealize); device_class_set_props(dc, x86_cpu_properties); =20 - device_class_set_parent_reset(dc, x86_cpu_reset, &xcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, x86_cpu_reset_hold, NULL, + &xcc->parent_phases); cc->reset_dump_flags =3D CPU_DUMP_FPU | CPU_DUMP_CCOP; =20 cc->class_by_name =3D x86_cpu_class_by_name; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229887; cv=none; d=zohomail.com; s=zohoarc; b=gFn7DgV+3Kj6pAnipebBgDW0GNlyTgYyv0z9jFOrW8bfd9Pd6e2/3RyeR/QzKq/Ve7eJbgfAeR7S/hD0yY3Kd2FKUycssFnDWSzLdNrh02ytkvxJaGEhlhGowLBS62OtkIvG3YjBcbYU2t0TPz5gnzK1MoBEmhaRMX4vHmOcwqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229887; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9VfBPDH2IM8XoXDsV415IlApTEkb1iN+XBOOUvBnr0A=; b=M4I7Jb9PwU51Y5FK5bRk3ACPoelMqNqqAiXBd3k4B9YiBmTI+EmDXCA8VfLmj06xgHh+X2JQ67QDjVgAxxT2iw4PhOpbNNW9Nvr/5XOQJFm6/JVNgX5twGjiUtm/UUFHN1GIHH7qEXfEjsk669+LMMAVOzWDv9jGlWzmnaZFB0s= 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 1671229887496543.8831005773649; Fri, 16 Dec 2022 14:31:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU5-00061r-Kn; Fri, 16 Dec 2022 16:43:13 -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 1p6ITw-0005x7-V1 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -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 1p6ITv-0000fW-BL for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:04 -0500 Received: by mail-wm1-x331.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so2697596wms.2 for ; Fri, 16 Dec 2022 13:43:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=9VfBPDH2IM8XoXDsV415IlApTEkb1iN+XBOOUvBnr0A=; b=HwEA7ZHlNTjz8Zjg2hMtQtIQhuEtcOCn8g0voGgT/Qfp2Iiynn5gmBSoaanEQFdrZ8 0eC6m37EyvWgR8JWlInxWS51ZQyBkqzIPHR1mw5HjRaT+GeCvWYl+wu6WbCAs2v7dyZ8 SslZ6hngnwSJSor4uZJJUjOkbK32gSeMBV+Nb9/DbCpulYIYYb+LuEYk7JOXo6zirVeW JfkhATlrRPG3jPrKZPaHi2fPW5XK13ora/rrNWmdkapZD7ersTq4qf3IKi9JltQej+Ux vEgoqXlRn3Mky34Q82bAr5sdDimBzCmTAllTSbX3CS/fJ/IDmprEfr+ghENsHhkDMi1O VY3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9VfBPDH2IM8XoXDsV415IlApTEkb1iN+XBOOUvBnr0A=; b=D2SzgWsmJITkuJG/97TyUDzG7sBxQBwbH7KeAYy+iTJeK0/g96/1d5HV+GEiLN3XR2 j2k+6SMGTwbb6Rr08/lhY29x9Ji2NDbRgt8roHPeNuAO1aBwE5a0CuHnOGPgrunh0bKf jr6sx+rrUtGtwNLzFCczpDfoehBZ7Atyor/dE5vlaSWma0gVBqINAofTfXXdUBFTatNt OvDrbpUsnsB25Q19oqOIuaF64wZLMUH0Bq19Yl916MSEQZRdFMDOUpXmVK80qq5BuF0B V/UxpTiHp/TK32CcEfE8PMioGnKFrvkRFenaIB2BRzGc66+OoIfyApoHFYg7q17e/SCt 2PLw== X-Gm-Message-State: ANoB5pl7qnM3fGqPHlhQh4niH0SHLP44vA0sCDQOSHnqGshObdcNg7cO 9blxfaFMiwtOvDUwJ85A/JYRv7irfwHNEkY1 X-Google-Smtp-Source: AA0mqf6BDFqCDgw5xFEr8G2D82AiFOcVjtw2XPBoPIs+Nzjmf7SxZtK0W2S5G69QwH8gd1tibk/WZQ== X-Received: by 2002:a05:600c:2285:b0:3d2:26cd:3b1e with SMTP id 5-20020a05600c228500b003d226cd3b1emr16887366wmf.28.1671226981955; Fri, 16 Dec 2022 13:43:01 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/36] target/loongarch: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:25 +0000 Message-Id: <20221216214244.1391647-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::331; envelope-from=peter.maydell@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 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: 1671229888261100001 Convert the loongarch CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-8-peter.maydell@linaro.org --- target/loongarch/cpu.h | 4 ++-- target/loongarch/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index e15c633b0bf..e35cf655975 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -356,7 +356,7 @@ OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, /** * LoongArchCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A LoongArch CPU model. */ @@ -366,7 +366,7 @@ struct LoongArchCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 /* diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index e7b0e12be6a..290ab4d526b 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -450,14 +450,16 @@ void loongarch_cpu_list(void) g_slist_free(list); } =20 -static void loongarch_cpu_reset(DeviceState *dev) +static void loongarch_cpu_reset_hold(Object *obj) { - CPUState *cs =3D CPU(dev); + CPUState *cs =3D CPU(obj); LoongArchCPU *cpu =3D LOONGARCH_CPU(cs); LoongArchCPUClass *lacc =3D LOONGARCH_CPU_GET_CLASS(cpu); CPULoongArchState *env =3D &cpu->env; =20 - lacc->parent_reset(dev); + if (lacc->parent_phases.hold) { + lacc->parent_phases.hold(obj); + } =20 env->fcsr0_mask =3D FCSR0_M1 | FCSR0_M2 | FCSR0_M3; env->fcsr0 =3D 0x0; @@ -694,10 +696,12 @@ static void loongarch_cpu_class_init(ObjectClass *c, = void *data) LoongArchCPUClass *lacc =3D LOONGARCH_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, loongarch_cpu_realizefn, &lacc->parent_realize); - device_class_set_parent_reset(dc, loongarch_cpu_reset, &lacc->parent_r= eset); + resettable_class_set_parent_phases(rc, NULL, loongarch_cpu_reset_hold,= NULL, + &lacc->parent_phases); =20 cc->class_by_name =3D loongarch_cpu_class_by_name; cc->has_work =3D loongarch_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229807; cv=none; d=zohomail.com; s=zohoarc; b=lIKZC0rs/We4lv9i0HYhpKSTrLT18LKymi9Wi4Jt6WORj1EatRIaQ7DxWBEe6QYUhfVz0ryk+Mh6VKGFkvrUqyt1OsovyTFSr5x7R4qJcN0adEZh+v5Wk72RZo8+pyqpYJff+cvQxv/jKiLLi0wHjtyAvbJDApjeLwYGVrHD2so= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229807; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W0Sgz5RvbZ0+7rq6tAt31bRICOQNwLU3F3RWRUnkyZA=; b=R9ZWs1OD7BjuMX6X3mzGGuHE82JMf/tJmQiOYV06gBbre/sx6o0RIaVAmuBPE+HwAr4cPbw5DL3XqZh+LZEyt77542Nxq2JTCRimnbXpIkpJMCkb1lgfWyqGCIec8rUrqXpWbABap93OUb3XPL8MvnZrI7pR3Zprq3ieFjodm0w= 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 167122980700753.53061132055166; Fri, 16 Dec 2022 14:30:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU5-00061p-5g; Fri, 16 Dec 2022 16:43:13 -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 1p6ITy-0005y7-DH for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:06 -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 1p6ITw-0000fi-Fk for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: by mail-wm1-x334.google.com with SMTP id m19so2730337wms.5 for ; Fri, 16 Dec 2022 13:43:04 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=W0Sgz5RvbZ0+7rq6tAt31bRICOQNwLU3F3RWRUnkyZA=; b=nWYsTOO2+5yZnowRxnSCb+4nrpmfb6c4N60eN+rF9JxW2PjqLssYlEw1w362oz3xKY 5BHROy0SxGdher1BMmUD2L2IXQal2z4sgDLwdti4/4NA/6C5agcrRT0X9gUFHjztRGmZ wNgMneY42Y0K3cs36xArbgGINwLDEc8icKzGRiOvo94Vw27UxP7iH/ImsHFpU8wfE7eC xBFbAzcZrwk0VwCBvGCS856/FLviYEkZFEXllIau6HwK4J2+I+xjzodFDLkb4lZ3IGgB pigOzFfWsIDfccaBtlO3LJYk1wryTjVV7SBl37Rla4cp6kAbSUP89PR/br3bpivJWpzH 43MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=W0Sgz5RvbZ0+7rq6tAt31bRICOQNwLU3F3RWRUnkyZA=; b=oxA1H4YpJTm7vvXzmMV2U3gxXHnOMiXb+LWkH4qGYkpKhWaovhNOmB92JIvLIMUW2T x2aPY8bfjc2uF9UP1YhsAgwWqhbGt2+govFDR/YuWMzLae/BdBSvurHxOlYZmeiv1fsA XUbK6eV4Pdx6H+BEJ6nBY61D5E2Vlkd8af7HVedgMQsmXx+7BW0jZN7wiMpGyTdUfP0I M34madyVZ6TUX0FYf+wDDnhra6Pw8cUs7cxjYaZXVjEABW8X8x+Q53Cbb18YBIBcIer2 idmDUqbXZr3AF6mzLv9bxuP9SVxEJJMkk1cm6O1N+AHfeBciGbY1w5o1ZWcoILXdlHB7 VrlA== X-Gm-Message-State: ANoB5pmg8k5kTJmQxP2ud4Eff7ncnBhQ5n6hRm0GwkIc515nuSUxDx8i ZuxZyDFSTMKXnbILhshNdfKi2pdcUn+4Fa7h X-Google-Smtp-Source: AA0mqf4NWKgdkRx2yB726se7EWbGX8DdRzPkInZY7bxxtV2R1UjB2uZGmg+IDosk8BKo0EM+2xcX+Q== X-Received: by 2002:a05:600c:3b9c:b0:3d1:e710:98ec with SMTP id n28-20020a05600c3b9c00b003d1e71098ecmr35682143wms.21.1671226983264; Fri, 16 Dec 2022 13:43:03 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/36] target/m68k: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:26 +0000 Message-Id: <20221216214244.1391647-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::334; envelope-from=peter.maydell@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 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: 1671229807986100001 Convert the m68k CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-9-peter.maydell@linaro.org --- target/m68k/cpu-qom.h | 4 ++-- target/m68k/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/m68k/cpu-qom.h b/target/m68k/cpu-qom.h index cd9687192cd..0ec7750a926 100644 --- a/target/m68k/cpu-qom.h +++ b/target/m68k/cpu-qom.h @@ -30,7 +30,7 @@ OBJECT_DECLARE_CPU_TYPE(M68kCPU, M68kCPUClass, M68K_CPU) /* * M68kCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A Motorola 68k CPU model. */ @@ -40,7 +40,7 @@ struct M68kCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index b67ddea2aee..99af1ab541a 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -66,16 +66,18 @@ static void m68k_unset_feature(CPUM68KState *env, int f= eature) env->features &=3D ~BIT_ULL(feature); } =20 -static void m68k_cpu_reset(DeviceState *dev) +static void m68k_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); M68kCPU *cpu =3D M68K_CPU(s); M68kCPUClass *mcc =3D M68K_CPU_GET_CLASS(cpu); CPUM68KState *env =3D &cpu->env; floatx80 nan =3D floatx80_default_nan(NULL); int i; =20 - mcc->parent_reset(dev); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUM68KState, end_reset_fields)); #ifdef CONFIG_SOFTMMU @@ -552,10 +554,12 @@ static void m68k_cpu_class_init(ObjectClass *c, void = *data) M68kCPUClass *mcc =3D M68K_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, m68k_cpu_realizefn, &mcc->parent_realize); - device_class_set_parent_reset(dc, m68k_cpu_reset, &mcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, m68k_cpu_reset_hold, NULL, + &mcc->parent_phases); =20 cc->class_by_name =3D m68k_cpu_class_by_name; cc->has_work =3D m68k_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229020; cv=none; d=zohomail.com; s=zohoarc; b=WjVxyrvabMO4+Rl+o22R2O/9Lh5tidbv8IIOVqUU0elYGCO1nY2IwxiNla06VbzBgA17T8TZjAxvKeauD1UhCTYrLwSrJ18Inx1s/n4bDCAEO+4CbW2/G1FjpK83jvhAzGShwjbNqQGf+OmUZv4pOhu0C0eYdScsxFRyKXE49ro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229020; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B378x5OhsXxdbYk6KqXx4tmBaBnAJUAFvnfZ7I26cuw=; b=hBKULIpqmEAPk97yUSxx/c8MFim0ljv46+79AzI/LoVnXP3XmRZcfg2RiuRRDtn0dFgDo1AO1rXCyYlFRp+QsUydjHSbeQ/CyQe3/8tsIgzcECxbFtzuMc8SEMV1csFyBtdrGllnetixGqPR9T4JzCDy+DZ9d64GLyEHXHl7jI8= 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 1671229020333170.10616394224598; Fri, 16 Dec 2022 14:17:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUe-0006Mu-Pc; Fri, 16 Dec 2022 16:43:48 -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 1p6IU1-00060G-5o for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:09 -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 1p6ITx-0000fr-FI for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:07 -0500 Received: by mail-wm1-x331.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso2706736wmo.1 for ; Fri, 16 Dec 2022 13:43:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=B378x5OhsXxdbYk6KqXx4tmBaBnAJUAFvnfZ7I26cuw=; b=kAPsUCy/qj/ZQYxNQkc7OPBW5+fyTP1cmBmMZQXw22aa7Pz+1wFbiV4XI1YrQrcT/1 H1QPpVtB+90vqgRtgRF4E3KR+14nmo4XED2osQOQJOJ07wMSPUgZPaoadqWQaW1aGQsa pANCkpXvUdSwk6vkyMnGCZIQTcpz7n41wwI6dbbGj8xX1R4xvMuYl7Xmjnoxlf+qdT7A qlUvX9HHYqvpqWnSZEvJf+0rGA12LAk72Yn0ZAr2S+n3a1y9F7SRjqrcQpShUx8VpX4W 6GOBzLKcMRu08tU4fNIlurydA/j/SJ8Bwos+5ig/jhm+V134Rj+QkfzyYuYbyt1IiE6j c8hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=B378x5OhsXxdbYk6KqXx4tmBaBnAJUAFvnfZ7I26cuw=; b=BpMjpDr2rlzCDIjqX4krJrfLAl3Mnv4VOyI6U2xXegcBR+EQuhpjr1XqXHeOUTLW/h 0hMjk7brETLUIinQ2aV1f8agKSJvqGoNgM4oAbhdlV/mRyIUJM+SCty0KJ9k6jrVbZ2j 2I/Q11+dWPBB9kcIMPo8sIFPGNiMZVWQ8m7nittWFFGgKRzMGyY8TXSe761C3+7DPNDi PjItK+wDML+Gm0rkclhnXdCtqRiykpkYoVgpbyNRiOU/RY2zVN4U0huI4w1DzFK62+ov vy2QA872vuunkKfoun5vCb31uPi0m5nmyyigs1bVNf+HLEJHxp/rJCpO7JN6BcKXg0r4 6Mmw== X-Gm-Message-State: AFqh2kqlDaMxdpEnLvl4AOAWRAyk/3eeJzqMgmfbbZjazHUVqCUazFXA EEU1aepWIQ5WYvmvxnLVHABqijH8qc2dcCdb X-Google-Smtp-Source: AMrXdXsOawPPm+h4qpExDYuBNUl/CwZCe7pdMFZqsDtmcFul7XY4CK8lbCjZGPbTEFxL4c+TlsGfFw== X-Received: by 2002:a7b:cc85:0:b0:3d3:3c93:af5e with SMTP id p5-20020a7bcc85000000b003d33c93af5emr5337292wma.35.1671226984176; Fri, 16 Dec 2022 13:43:04 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/36] target/microblaze: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:27 +0000 Message-Id: <20221216214244.1391647-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::331; envelope-from=peter.maydell@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 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: 1671229022567100001 Convert the microblaze CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-10-peter.maydell@linaro.org --- target/microblaze/cpu-qom.h | 4 ++-- target/microblaze/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h index 255b39a45df..cda9220fa99 100644 --- a/target/microblaze/cpu-qom.h +++ b/target/microblaze/cpu-qom.h @@ -30,7 +30,7 @@ OBJECT_DECLARE_CPU_TYPE(MicroBlazeCPU, MicroBlazeCPUClass= , MICROBLAZE_CPU) /** * MicroBlazeCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A MicroBlaze CPU model. */ @@ -40,7 +40,7 @@ struct MicroBlazeCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 89e493f3ff7..817681f9b21 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -162,14 +162,16 @@ static void microblaze_cpu_set_irq(void *opaque, int = irq, int level) } #endif =20 -static void mb_cpu_reset(DeviceState *dev) +static void mb_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(s); MicroBlazeCPUClass *mcc =3D MICROBLAZE_CPU_GET_CLASS(cpu); CPUMBState *env =3D &cpu->env; =20 - mcc->parent_reset(dev); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUMBState, end_reset_fields)); env->res_addr =3D RES_ADDR_NONE; @@ -399,10 +401,12 @@ static void mb_cpu_class_init(ObjectClass *oc, void *= data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); MicroBlazeCPUClass *mcc =3D MICROBLAZE_CPU_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, mb_cpu_realizefn, &mcc->parent_realize); - device_class_set_parent_reset(dc, mb_cpu_reset, &mcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mb_cpu_reset_hold, NULL, + &mcc->parent_phases); =20 cc->class_by_name =3D mb_cpu_class_by_name; cc->has_work =3D mb_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671227059; cv=none; d=zohomail.com; s=zohoarc; b=Z/0JqU/+C4A02aXPJxWFRo/YLVnKZoNLh5pOdKBLsw/aAKsCS/QtXM8Qb/Kl/ft1Hor0kKz1cNGl7/GyakMkCJ1v7lZlcjjCM6ZHDtOYZH/MQcLZLetOpWJDbjM8/W29Y9Vq8BHcrWsiK+2nNao0O1btd+YWVEDAvg6coJBnqeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227059; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=16RWnagd9d1NknqwhBiXGx22YuZemZqKb+dy4GTRhZI=; b=LBGw4FoHurDqTXXXjYeBr6T3ms/XTrNClUYrYk4Y8gGjTo87sIGtQFdV/ayVshKsh+NESeHF67G29PF5xsheLpVgp7dTO8VtPjvACDKWMuQK7lXYiHcABhDbEtYwO385v5KVp6yMmsMusDBpe3yFFQPizpUkjr0E2LIrfCWfbCk= 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 1671227059080304.5452553178004; Fri, 16 Dec 2022 13:44:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU6-00062r-Qe; Fri, 16 Dec 2022 16:43:14 -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 1p6IU1-00060F-4j for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:09 -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 1p6ITx-0000fE-UP for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:07 -0500 Received: by mail-wm1-x32f.google.com with SMTP id v7so2786536wmn.0 for ; Fri, 16 Dec 2022 13:43:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=16RWnagd9d1NknqwhBiXGx22YuZemZqKb+dy4GTRhZI=; b=dSvQmiaCDmRZCe7E5ePevTKglqWb81nbePehtv9MS7AGMK+RPntTz+o3mJDsJEftsw yNk9fTFcqTin0UT2Jp/t9hLqTczIXMTec8RDy9bo1reir0z3gqI/VyZNMbDlQjd30CDn EmdmJS2IWu7WwBowZfoAHoAkXjPaHm3lSmz/eGYiW5BlOowcPdOvAW6gpfRFkIGDTQPG O4axZXF94r6pp9JZADNXJr2HkVLGHrRDmjujR8hO9CK+ofBvcwIr9qovLz0ulwEr7PZ7 Z3FQCSevY+on/VFsXlKKps8o3jvztIvMhz0zg1fjeUB8FBheKvpraV5I7NmTnr2rS1Ny kMew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=16RWnagd9d1NknqwhBiXGx22YuZemZqKb+dy4GTRhZI=; b=g30GDlGnG7U+AbOsTC62Kfft91GXsELwkQwP9Zn/Vv+VccQ7NxN7kE0qF8rC7N51Mv lizXJp74hCTu61LouYD+bLAZbeI1+w2zXWItkFNDs6xSWCXANcdOlQLSc8uJI4jMKmJM AiZ6GPdEKGZZUtf5ayzXRMgVszEG8clahs/+2DFcVGslqRGe/hUHNnuPMLj+w6dNQWJr EVO4xCnQkfXTZ5yRGdWKDVi/Wu+6n6SM7NiINeIuRWaD23jiBk21wEdetS0Gku2LsUyX S+shATyQxPofqHaLjFYrEUFUfSGWDBRHhY/cGU/Qluk5Zory8b7t9OBDMAuQ20QT7Bc6 WuaQ== X-Gm-Message-State: AFqh2kpQ2dYnVf9WlCOF81zHh1ZTfE7prYSV8GtQCpOxqsRTP4Gaur4/ 5oXrjFSzL4pMIfw8eMrWWSSPxz5C5XtuIf5f X-Google-Smtp-Source: AMrXdXsTmW6BSGGZq39aHQUaqCvnTmCj0PP+24KC75QYoPJZT+Rn7XJ8ybfqdx4uQyhlIgR1PaG27Q== X-Received: by 2002:a7b:c3d5:0:b0:3d3:396e:5e36 with SMTP id t21-20020a7bc3d5000000b003d3396e5e36mr6069498wmj.0.1671226985116; Fri, 16 Dec 2022 13:43:05 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/36] target/mips: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:28 +0000 Message-Id: <20221216214244.1391647-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32f; envelope-from=peter.maydell@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 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: 1671227060840100003 Convert the mips CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-11-peter.maydell@linaro.org --- target/mips/cpu-qom.h | 4 ++-- target/mips/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/mips/cpu-qom.h b/target/mips/cpu-qom.h index e28b5296073..0dffab453b2 100644 --- a/target/mips/cpu-qom.h +++ b/target/mips/cpu-qom.h @@ -34,7 +34,7 @@ OBJECT_DECLARE_CPU_TYPE(MIPSCPU, MIPSCPUClass, MIPS_CPU) /** * MIPSCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A MIPS CPU model. */ @@ -44,7 +44,7 @@ struct MIPSCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; const struct mips_def_t *cpu_def; =20 /* Used for the jazz board to modify mips_cpu_do_transaction_failed. */ diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 7a565466cb3..c614b04607a 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -182,14 +182,16 @@ static bool mips_cpu_has_work(CPUState *cs) =20 #include "cpu-defs.c.inc" =20 -static void mips_cpu_reset(DeviceState *dev) +static void mips_cpu_reset_hold(Object *obj) { - CPUState *cs =3D CPU(dev); + CPUState *cs =3D CPU(obj); MIPSCPU *cpu =3D MIPS_CPU(cs); MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(cpu); CPUMIPSState *env =3D &cpu->env; =20 - mcc->parent_reset(dev); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUMIPSState, end_reset_fields)); =20 @@ -562,10 +564,12 @@ static void mips_cpu_class_init(ObjectClass *c, void = *data) MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, mips_cpu_realizefn, &mcc->parent_realize); - device_class_set_parent_reset(dc, mips_cpu_reset, &mcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, mips_cpu_reset_hold, NULL, + &mcc->parent_phases); =20 cc->class_by_name =3D mips_cpu_class_by_name; cc->has_work =3D mips_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671227093; cv=none; d=zohomail.com; s=zohoarc; b=gswiQW8xtUSPtRpeZllXjfbqwznZPdoCk9Wu+s0GNyNkmrUoz0FNJsK6tAEeXe4LMaKyDMWzDPz4BEi23JesndHt0zyuY8ZB/sy7nfB06gqnCT5iTPaRsV/WC4CTxzH8mLru7m/s1wNUa3JiEMBRP/N8lbdJj0KCxpiF+g+x44k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227093; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MOyQoEElJBaMGAXsx9Bs+8ElHc6eJlOS6vtS/o3/iRQ=; b=kvNDPi9erqvO8gVI0yxBkR5dVDf/dIkb4pXDxNiOy6gxACovl0LZ0PKXLZJy8PsKJPrDW71bzmuIHbzSkUoxI28mU7Cm+SXOgO8cH2yojzBF6gKYSaCqWzfDtuHTeKINimzz4YAJLSthIy4uYqckWzGQc84ujvhv1is5z0B4FLY= 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 1671227093116696.5640438208555; Fri, 16 Dec 2022 13:44:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUk-0006Wu-IW; Fri, 16 Dec 2022 16:43:54 -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 1p6IU2-00060k-Jr for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:10 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU0-0000gB-MY for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:10 -0500 Received: by mail-wm1-x330.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so5012555wma.1 for ; Fri, 16 Dec 2022 13:43:06 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=MOyQoEElJBaMGAXsx9Bs+8ElHc6eJlOS6vtS/o3/iRQ=; b=Mk4Fepy0U0cPiNS5365h9QbHPPvpxQbAuYJUZyD51QOktcVaYvR+KQc/cfZcg2EOeL nGFbFSbt4hNGgLpa3+7piKO60fmY7iiXnlGRzLOAPm0narcIRo5mUhv0QGasti9evCgD xv424sYlTzRj1w4UJtjqOEv9eU62pptWQsSUb85zmTwFSTUDEK5qsB2Nl5Lt0D8WfZMm irDcUDxRZvkX559zfu8wVjbVdFlbRNqgW/M/JTbBnG82VxbRy2WatbdZd5KTyNznJXks y7P2ZBQ1qN9GvMjar/sKg5qOiR2mcnXpFlXVl/RCKzzdwFK7e0kpUD1+qL69oAqhIC3G zULQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=MOyQoEElJBaMGAXsx9Bs+8ElHc6eJlOS6vtS/o3/iRQ=; b=m4q+gGmCWTwTG8OFzZM7maL8Bl/T4+b4e728owAiKBi2CHmsE1up3bjQdtCVh8Ap/k g8VvJiJjhOGR7XOFDnKvVipYddUa7gIRMY/2wtOhyvHHbQCdNKHvO4sDr50MZf6FHJX+ 9uPpDb71xAw85gw22+sLEEeHFLdls2j5gE4iT1OtvpfhxqQe+69hFWWjkx8Bp7b2PuuU J0OT9l12tSDrOKoZqazr7B1Rc77ArU0JrLVfTAR7gR6NByYNmAjaYDChEK2YLk/18+vd F2IM1mvbNs6RZaUXQ+OATClwR2EPvaUnBpnILvUFvjF/xxxB9huboRoPUJdnjgx+FJrw 5rkg== X-Gm-Message-State: ANoB5pk8VOpXVJ49dQuIHxN0E7Djo1SYmJEBTQvcus1TStpeaH5MyAUW V+AQFw0VPO8tGTOMGViARYWTWzJxixjSuE9Z X-Google-Smtp-Source: AA0mqf5Ystu4QWkbqzbkxzsZPgBZ5hUbvRV2kbBH1Tiiw/eI/tnNJvQl/hFoRcnx7vY2Ar0/LKFAyg== X-Received: by 2002:a05:600c:6002:b0:3cf:8260:6364 with SMTP id az2-20020a05600c600200b003cf82606364mr27394783wmb.37.1671226986083; Fri, 16 Dec 2022 13:43:06 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/36] target/nios2: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:29 +0000 Message-Id: <20221216214244.1391647-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671227094981100003 Convert the nios2 CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-12-peter.maydell@linaro.org --- target/nios2/cpu.h | 4 ++-- target/nios2/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index f85581ee560..b1a55490747 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -37,7 +37,7 @@ OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CP= U) =20 /** * Nios2CPUClass: - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A Nios2 CPU model. */ @@ -47,7 +47,7 @@ struct Nios2CPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 #define TARGET_HAS_ICE 1 diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 9a5351bc81d..cff30823dad 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -57,14 +57,16 @@ static bool nios2_cpu_has_work(CPUState *cs) return cs->interrupt_request & CPU_INTERRUPT_HARD; } =20 -static void nios2_cpu_reset(DeviceState *dev) +static void nios2_cpu_reset_hold(Object *obj) { - CPUState *cs =3D CPU(dev); + CPUState *cs =3D CPU(obj); Nios2CPU *cpu =3D NIOS2_CPU(cs); Nios2CPUClass *ncc =3D NIOS2_CPU_GET_CLASS(cpu); CPUNios2State *env =3D &cpu->env; =20 - ncc->parent_reset(dev); + if (ncc->parent_phases.hold) { + ncc->parent_phases.hold(obj); + } =20 memset(env->ctrl, 0, sizeof(env->ctrl)); env->pc =3D cpu->reset_addr; @@ -371,11 +373,13 @@ static void nios2_cpu_class_init(ObjectClass *oc, voi= d *data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); Nios2CPUClass *ncc =3D NIOS2_CPU_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, nios2_cpu_realizefn, &ncc->parent_realize); device_class_set_props(dc, nios2_properties); - device_class_set_parent_reset(dc, nios2_cpu_reset, &ncc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, nios2_cpu_reset_hold, NUL= L, + &ncc->parent_phases); =20 cc->class_by_name =3D nios2_cpu_class_by_name; cc->has_work =3D nios2_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228197; cv=none; d=zohomail.com; s=zohoarc; b=G3yLHuaIIU0UsHsjw0Pgnyo10n5Macw7v9lQZBE8sI8p0U3du2XKovzcvsDro1kkctuJ4FKohJ6DCNe52VAc4fQRxjmSZwmjMoL5uAPCxmZ26NRu10AXSnloK+JE8YsHtDsPTR3AhT6LrFV8a/EyRDatnKE/v2IMcKXKBtOqlAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228197; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3wlQ3hEbEsOsTOS6YZN+KsSVSdVU6IjrEOLfitW6DbU=; b=FGqeMi9vHwM01EpO2Cuk623geFKaGhzKxiPHl2ClR6VNbAOaRemZB6bJRivsRxEu17o11gFlKysccjFPK1ByY812a7RpjgQTIYdbFz0T1ZEpVYdn9wwZj2iUNtxt1CpPnUuyz8pyx+MlMmcQ771TmwAc6BW6J9b9wkQf5UMZIYE= 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 1671228197243481.6918097931324; Fri, 16 Dec 2022 14:03:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUf-0006NX-3r; Fri, 16 Dec 2022 16:43: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 1p6IU2-00060j-Hj for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:10 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU0-0000ag-O7 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:10 -0500 Received: by mail-wm1-x330.google.com with SMTP id ay14-20020a05600c1e0e00b003cf6ab34b61so5001527wmb.2 for ; Fri, 16 Dec 2022 13:43:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=3wlQ3hEbEsOsTOS6YZN+KsSVSdVU6IjrEOLfitW6DbU=; b=EBvfgXw+k7fK2/Qh3SZ7CHXukOUVHaSeJkMCnAC+ZtGZ2NGfXjkZmobBkbVGSn4SaV 0yoKizvY1grSU8RZNEEw+1GdF3VYBuqxdBh51Vq3tGjFhyUI9zWUgx/+cg/54x/oA/qN TtjgInf77ts1d4GAiPWfWa7DCyu80z7hjk0R+wDVNZm5j4AsGsxAEeu3kYW9oMlSQt1e sN7AZ7rN3VwiXgD9dTdzZnY3tzKbVKaMmkNZsji72uTRmVxMQ6vObcPDQyFFnAOzkxSP CIfQ70QLVGd7nakfE6xAeSi5I3oTB2mF+6pP3wcGIbbO44UoeH1yYGAKL1FYelMd+ku9 f3wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3wlQ3hEbEsOsTOS6YZN+KsSVSdVU6IjrEOLfitW6DbU=; b=hztNnzgNGLMbqRQqfmOXzd7udkmQ/OLG4wL5z6bUjIHXuS+I3EhUM2fmdyf2d6ocHX +iCkKR1K9PYt0bj8kZ4sRmxFU1Cwvhd4OMPv206+lUgfTMNgWjE6dFQvFuLHgzwsLYX9 Bo0i23jlpSod9DJlfSyPfunuRk3/FkkWBKcI+PxsAMnVDb2kzyuqKl4Cy1P3+sR4DM4d hppAAblWJbgIeUoeL7oN2mC3HrlHLJ/xIQkNGjdXyfGEnmE51+NpfZyZw2Yf5fZd/msg tkW2KyALxzFzpF6ef4OX41n4ilSKLvFcYUk20M+4cjLTMqlS2J4ebvipQg7WAmjkt6ee QqoA== X-Gm-Message-State: AFqh2koVU7UvF0SapiWtkwdT7ABAqAn7ZHM++tqCrEmU5muEd2AgYWfA H72wW4sFyDS9kKsaSZLASe4DYSzPQU7eb3Er X-Google-Smtp-Source: AMrXdXtN+6jiSBo1VpGSxsEXG5OJBo/qukMilxzuc4ipXfAtD1n3yYrg1sYpioYX4YhXiioO7MT1Eg== X-Received: by 2002:a1c:4b18:0:b0:3d3:39a9:e659 with SMTP id y24-20020a1c4b18000000b003d339a9e659mr6223903wma.21.1671226987034; Fri, 16 Dec 2022 13:43:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/36] target/openrisc: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:30 +0000 Message-Id: <20221216214244.1391647-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671228199345100007 Convert the openrisc CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Message-id: 20221124115023.2437291-13-peter.maydell@linaro.org --- target/openrisc/cpu.h | 4 ++-- target/openrisc/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 1d5efa5ca2f..5f607497052 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -34,7 +34,7 @@ OBJECT_DECLARE_CPU_TYPE(OpenRISCCPU, OpenRISCCPUClass, OP= ENRISC_CPU) /** * OpenRISCCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A OpenRISC CPU model. */ @@ -44,7 +44,7 @@ struct OpenRISCCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 #define TARGET_INSN_START_EXTRA_WORDS 1 diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index de0176cd20c..4c11a1f7ada 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -70,13 +70,15 @@ static void openrisc_disas_set_info(CPUState *cpu, disa= ssemble_info *info) info->print_insn =3D print_insn_or1k; } =20 -static void openrisc_cpu_reset(DeviceState *dev) +static void openrisc_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); OpenRISCCPU *cpu =3D OPENRISC_CPU(s); OpenRISCCPUClass *occ =3D OPENRISC_CPU_GET_CLASS(cpu); =20 - occ->parent_reset(dev); + if (occ->parent_phases.hold) { + occ->parent_phases.hold(obj); + } =20 memset(&cpu->env, 0, offsetof(CPUOpenRISCState, end_reset_fields)); =20 @@ -229,10 +231,12 @@ static void openrisc_cpu_class_init(ObjectClass *oc, = void *data) OpenRISCCPUClass *occ =3D OPENRISC_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(occ); DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, openrisc_cpu_realizefn, &occ->parent_realize); - device_class_set_parent_reset(dc, openrisc_cpu_reset, &occ->parent_res= et); + resettable_class_set_parent_phases(rc, NULL, openrisc_cpu_reset_hold, = NULL, + &occ->parent_phases); =20 cc->class_by_name =3D openrisc_cpu_class_by_name; cc->has_work =3D openrisc_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228571; cv=none; d=zohomail.com; s=zohoarc; b=EsIc/VPJzrF/nepe7Y/0iMyQ0AlX2cDaUg8ZM4B7ixE9t+gfZ8YnojFR36CHUozSOfIbyJw9o9z/yEGvhuW2z1CkF/IoeoKamBonVjuqs3AVLTDG1GmcRJD6mHSzF/3hRCGmIF8LcPFeEh3YuLE+HpQuvWzg0YvdjGr86XINpR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228571; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ngOEeBVak8Pn0v7S29nlnFYFEpUJqHxOa2AWGjEaHE4=; b=YPtcWWldtYHOf3beOtz6B+XJLg82Iu6dhx9lWNIGp/5KPerdlIjxBbvURZk+xJ5nggS7Vru8lGCkR5SEasnoe5esix75fFYlYKQ15F1ua3K3KI4q97AS+S2FpFP2OXnsEBrg5V2LtG7uKE1UlQSVp6mfZ2ioTmGL59rkXM2vV/Y= 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 1671228571291578.6763407113809; Fri, 16 Dec 2022 14:09:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV4-0006l3-88; Fri, 16 Dec 2022 16:44:14 -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 1p6IU3-00061K-U6 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:11 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU1-0000gQ-B2 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:11 -0500 Received: by mail-wm1-x330.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso2732387wmb.0 for ; Fri, 16 Dec 2022 13:43:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ngOEeBVak8Pn0v7S29nlnFYFEpUJqHxOa2AWGjEaHE4=; b=sQga9+/PYBLjqzkXyNlsZik5K0L3OZHKEDmKpv8bfwPeUMB8hqr7KhxR8mLTBTMrIl TqEbfafhcV+zHoOFwov/OwCIiU+cl2c5u5w70tzHjLkq0KXz3JkAaxA+7Gf4O3n8PcZv KWa+O41TJTEdFbfZcdHZrrkWDJ9Vc3J/Nc3NqWjFnF2Et+Ovzm7t0fXufUtsr4s+16qc ceu69CUOp6S9YF5X41FFGz8zici6iaLf/sev43RWmOMkTjLTivk1UCqfBJ6+cwpR3Boc EQxsZdLpWQ6ZY1MPhp+3OjrhK4xLFS+nEveQuB+V+I/NF4CiCD2op9dh6IU+WSaWxIet oVkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ngOEeBVak8Pn0v7S29nlnFYFEpUJqHxOa2AWGjEaHE4=; b=MACpGaCeo3ghfF6WfZ8Mzl1xKlYhHj/aDyC+2ncbRcboIX/DHkqmf6vlV3Es1qUxD2 A8BqRmO+6ztaRNkURMrnyXnP8imuJBFa265JiDwyxFgRPtK99RBDQjCoOqJaw92/mnW3 lSFBhDM7CMK3ycZhjywNPxW15qTwosMGcGypX2LlZgWKYSMcuJRA05JaImPkbJYJEHpP bWiOWyNECs0b50k1XUY2ljqVZ0+0rQEozQcCOxhQ3HI14jieeUJwDXMSiROpf+W3x9P0 +OYob2w9iGZx4/nEf3SyR4qr66Mjcw6PUX4k5P94RVpflnvGlM0KZk8BzeQInzzb6CNq mQEA== X-Gm-Message-State: ANoB5pkSVtx5CHAoWYpoVTzfL/BAat35TMytnY6hxs4ktlIlZuxhYz2Q zIX8KLBw6xdUho/uk9C7XN9Q22gdeXCx2xLW X-Google-Smtp-Source: AA0mqf5yRVoLzRJ0xyoNI9cYMdWMvQzmlzLvHy6bc+DCvA+3ytatXXBJdYFgGFwd6JeyiJ4yiD7TMA== X-Received: by 2002:a05:600c:3b15:b0:3d0:d177:cac1 with SMTP id m21-20020a05600c3b1500b003d0d177cac1mr26364240wms.36.1671226987974; Fri, 16 Dec 2022 13:43:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/36] target/ppc: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:31 +0000 Message-Id: <20221216214244.1391647-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671228573415100003 Convert the ppc CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Message-id: 20221124115023.2437291-14-peter.maydell@linaro.org --- target/ppc/cpu-qom.h | 4 ++-- target/ppc/cpu_init.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 89ff88f28c9..0fbd8b72468 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -143,7 +143,7 @@ typedef struct PPCHash64Options PPCHash64Options; /** * PowerPCCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A PowerPC CPU model. */ @@ -154,7 +154,7 @@ struct PowerPCCPUClass { =20 DeviceRealize parent_realize; DeviceUnrealize parent_unrealize; - DeviceReset parent_reset; + ResettablePhases parent_phases; void (*parent_parse_features)(const char *type, char *str, Error **err= p); =20 uint32_t pvr; diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index cbf00813743..95d25856a0e 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7031,16 +7031,18 @@ static bool ppc_cpu_has_work(CPUState *cs) return cs->interrupt_request & CPU_INTERRUPT_HARD; } =20 -static void ppc_cpu_reset(DeviceState *dev) +static void ppc_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); PowerPCCPU *cpu =3D POWERPC_CPU(s); PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); CPUPPCState *env =3D &cpu->env; target_ulong msr; int i; =20 - pcc->parent_reset(dev); + if (pcc->parent_phases.hold) { + pcc->parent_phases.hold(obj); + } =20 msr =3D (target_ulong)0; msr |=3D (target_ulong)MSR_HVB; @@ -7267,6 +7269,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void = *data) PowerPCCPUClass *pcc =3D POWERPC_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, ppc_cpu_realize, &pcc->parent_realize); @@ -7275,7 +7278,8 @@ static void ppc_cpu_class_init(ObjectClass *oc, void = *data) pcc->pvr_match =3D ppc_pvr_match_default; device_class_set_props(dc, ppc_cpu_properties); =20 - device_class_set_parent_reset(dc, ppc_cpu_reset, &pcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, ppc_cpu_reset_hold, NULL, + &pcc->parent_phases); =20 cc->class_by_name =3D ppc_cpu_class_by_name; cc->has_work =3D ppc_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228365; cv=none; d=zohomail.com; s=zohoarc; b=X4D1kw/v+HZy8Mo5YCDkdn/c2gUGb7X42IHhrz9Lkaa/JTUuBmnC+tHL/kjmulqrK28O4Vzn59WKNxmMD9VTy+Dtg15fYOde3icfbTeuPYqv/37+83lhVCx038zxIkjYnVm8yMZKtcZLSOZdtu3wRfBaZFAtmTsEBRNLWJqcV7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228365; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lqJ1U1BjhvvbnXKxuMnVz/cLZMrP5TJ4J5T0otuK7Ws=; b=aqO+Z+LnFsvG7qM7adC7Kg9PwYtfXJAoJaJWZEOC1CJI1pcHKABevcfk+w3casWkThrQxPiDhKipAj/xdJpKZZcYnWx8fvfhOF1N9popS5IYhPZyuLBU0tCOn3eh3V+s3rhZJp0J8bZ42Z/vUsA7fARTprAMRoy0h2B/yWVqt+Y= 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 1671228365917414.42085070310986; Fri, 16 Dec 2022 14:06:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUy-0006eJ-Fc; Fri, 16 Dec 2022 16:44: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 1p6IU4-00061M-09 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:12 -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 1p6IU1-0000ar-LP for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:11 -0500 Received: by mail-wm1-x333.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso4974705wme.5 for ; Fri, 16 Dec 2022 13:43:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=lqJ1U1BjhvvbnXKxuMnVz/cLZMrP5TJ4J5T0otuK7Ws=; b=BOtriwxshH0YTkpjm7w0rqIqQ/wupWBqkRMWLDlindEIBnwtEj4MNMgJtS4MwjmN8y DTjK5oRY8soSk4U3IZjwSnBWF8Np5SY5Fn0CiO2F+/InGPMQTT3TGdJoDhY3erwGA4HO TemOGd4mMLETXvq9j4FAJxnYIe7oNe5YGsSNOTe3PMzLvk31EPL5TB041UGyOX0ZbCJe zzwATcVmGfBvmrpq5Kt9m6AVWhY6ayUBLzkUgJIHWcYgJ32bEdsmgBduN0J60vQTrlNx 4dXBK0BYn9OUl086o4ytYnsQ815mCXcFgdVwhXPIlZlVg3MLvlnANTZjEpBJNn0liCLY a32Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lqJ1U1BjhvvbnXKxuMnVz/cLZMrP5TJ4J5T0otuK7Ws=; b=ivL8iT6G9C/0exb94tomlFW+MsnEuWczUhpAvIqAA+G5thXQhIRuS/+Xu7f/FA9AbH If6qjI4LhPNHAt1N8oTc2cCH69a2mBqf2d0fIzV0hrdztZXRrbzaGcqXB/jG96dsXkXQ AmLgk2nMZXPuepzqXEOe8IeyAHGmRbQ9Fhw1t2bSa3fAs142uBMsBxriPKA5P/8UlKHJ a/ScPLtvJ52FGCYKKObityBD3YUyWhpILjldKiLqNL8RbdR1+hO0az48GRSFKFuO3REX zWQrzcTotN5bimmGCdttgwYHDyYiLAkHN4o4U5q6gCB7B/VWXPK1u62fxXhRia5WVue3 ASUA== X-Gm-Message-State: ANoB5pnCIhNyX2zmYjOQqBErZRSYCy6rt37m+G5p/tqDt2dB9uiQhXJ5 u7prJyphnd65Ito3QBi0VygeFX+nJrI046qY X-Google-Smtp-Source: AA0mqf6XRxl5qrXZnm+R88pURpPe4Syj0ocf/VqS5f9TAcWTValQUoS/PNPxHOo0E6H53pcFVX0PXg== X-Received: by 2002:a05:600c:539a:b0:3cf:8957:806e with SMTP id hg26-20020a05600c539a00b003cf8957806emr27147023wmb.5.1671226988885; Fri, 16 Dec 2022 13:43:08 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/36] target/riscv: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:32 +0000 Message-Id: <20221216214244.1391647-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::333; envelope-from=peter.maydell@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 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: 1671228368060100003 Convert the riscv CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Message-id: 20221124115023.2437291-15-peter.maydell@linaro.org --- target/riscv/cpu.h | 4 ++-- target/riscv/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 3a9e25053f8..443d15a47c0 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -395,7 +395,7 @@ OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_= CPU) /** * RISCVCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A RISCV CPU model. */ @@ -404,7 +404,7 @@ struct RISCVCPUClass { CPUClass parent_class; /*< public >*/ DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 struct RISCVCPUConfig { diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d14e95c9dc1..6fe176e4833 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -519,18 +519,20 @@ static void riscv_restore_state_to_opc(CPUState *cs, env->bins =3D data[1]; } =20 -static void riscv_cpu_reset(DeviceState *dev) +static void riscv_cpu_reset_hold(Object *obj) { #ifndef CONFIG_USER_ONLY uint8_t iprio; int i, irq, rdzero; #endif - CPUState *cs =3D CPU(dev); + CPUState *cs =3D CPU(obj); RISCVCPU *cpu =3D RISCV_CPU(cs); RISCVCPUClass *mcc =3D RISCV_CPU_GET_CLASS(cpu); CPURISCVState *env =3D &cpu->env; =20 - mcc->parent_reset(dev); + if (mcc->parent_phases.hold) { + mcc->parent_phases.hold(obj); + } #ifndef CONFIG_USER_ONLY env->misa_mxl =3D env->misa_mxl_max; env->priv =3D PRV_M; @@ -1161,11 +1163,13 @@ static void riscv_cpu_class_init(ObjectClass *c, vo= id *data) RISCVCPUClass *mcc =3D RISCV_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, riscv_cpu_realize, &mcc->parent_realize); =20 - device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, riscv_cpu_reset_hold, NUL= L, + &mcc->parent_phases); =20 cc->class_by_name =3D riscv_cpu_class_by_name; cc->has_work =3D riscv_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229922; cv=none; d=zohomail.com; s=zohoarc; b=I9Q7NKEEB6j2gxWchCE6ixa+t/oyyXX4cHErQSGztoY5UK947g/RUNhjoGaO5MwY93N4B77dOkwP7Y99XV1TD5hvJfLp6j4JikPfmK1jf4AH/+8I+YOXR6JFnx9fIvoFEX4UALBUR5DraPiS2A+FTRH44zPe7YCkKRRPY8l5jhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229922; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OaolEeI/VBAVtDjg7jIzycyq6Q1jqs6WjWVYeKLQJ68=; b=TLqs6+p9YTQimSSbeNo290Zh5jcZ9eUTig4SVBawPS8cc3CMs0n6Fx5XoiPC5ropFL9UTwUFM36kFGsY6OemTVnTsESZUGYBTv624REjvxuXnANNxMtvIsWYWYM8NXKZrKngpJIneTZCfHNQ2iR+GyDxIuc02F0o5C3mKWk+sns= 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 167122992255446.90226825479067; Fri, 16 Dec 2022 14:32:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUq-0006Zb-MD; Fri, 16 Dec 2022 16:44:04 -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 1p6IU4-00061g-Fg for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:12 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU2-0000cM-MX for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:12 -0500 Received: by mail-wm1-x330.google.com with SMTP id o5-20020a05600c510500b003d21f02fbaaso4980895wms.4 for ; Fri, 16 Dec 2022 13:43:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=OaolEeI/VBAVtDjg7jIzycyq6Q1jqs6WjWVYeKLQJ68=; b=OhHIdHLwNyH0CsC6iNDJuXMoEAHDtz8QuHhzMKd0GLMIzpW7N0XrnSGPzC5gBaNcxL 6kAFZ7lBVN0vybG85Puxq++alFqsfLDBo6XZlbA1ocn23gIsIe2ETGdXcewAu1ZiDlfu bPW9KDprDuVeraTIVVpPSHHXNcTfWw03MZixxy6QmcrC5ye3LPA8KmlZPiv/5r8F/gDo wqK5NwhQ7oBTqkV2XksEqQclud70Ax9XRKK2mUrZUlOuwwXrhk4AYaagnNXTt17p/PBE qwuOGDw/ayaCB/zFKMU84FcKAUF9J4IA5eb9Vdq2QE2CGhP5uyd70aLCuABbNk8mPZIS rO1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OaolEeI/VBAVtDjg7jIzycyq6Q1jqs6WjWVYeKLQJ68=; b=HEXRSyT0XnZfHaGf6QQy+b3NP6cykZHlO+Yv2j5Ga8UwW2rGVZP4eRhyunTLdbVIVq nhGRfNP86VJXFdloBcCsb3IHxAFozG4CRGumxLL+eVlgxU72J4pbGq/E3qw0kLHfxf6B vz3G2akb00uEXYPexyRRj6vyiCgDfSHEaAOjWcbnttsU0Zmxt8NaegxrQUFry/1j412D vLiSSoj8n+BvN7pB85ui14RJVokYp53zvZNA3XbpQdlXB5w5fDKUbOc1XU5B1lVhlicf myaIbAaWtJZtburYOXmFWThkI/MehgjHMH0vWcd87UAK4lgeLoNBRE7dVBevdO5QK56O 2mHg== X-Gm-Message-State: ANoB5pkxG1NCaX4lYXrNNk9v8KGLTi4VvqklJZpr6z/4SPsCK+MqPFsi 5wpPczonyy1mMkCjtAk+E2PTRr/aezofcN7G X-Google-Smtp-Source: AA0mqf5g710v4qF7o9bNSTi8Y3bFvLKgyePulA9YQO2+kwakHzUGXcscbgzPrEj4NufA9qN+QWxVmg== X-Received: by 2002:a1c:cc1a:0:b0:3cf:5583:8b3f with SMTP id h26-20020a1ccc1a000000b003cf55838b3fmr27369970wmb.20.1671226989952; Fri, 16 Dec 2022 13:43:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/36] target/rx: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:33 +0000 Message-Id: <20221216214244.1391647-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671229924450100003 Convert the rx CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Message-id: 20221124115023.2437291-16-peter.maydell@linaro.org --- target/rx/cpu-qom.h | 4 ++-- target/rx/cpu.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/target/rx/cpu-qom.h b/target/rx/cpu-qom.h index 4533759d966..1c8466a1870 100644 --- a/target/rx/cpu-qom.h +++ b/target/rx/cpu-qom.h @@ -31,7 +31,7 @@ OBJECT_DECLARE_CPU_TYPE(RXCPU, RXCPUClass, RX_CPU) /* * RXCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A RX CPU model. */ @@ -41,7 +41,7 @@ struct RXCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 #endif diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 9003c6e9fed..219ef28e463 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -62,14 +62,16 @@ static bool rx_cpu_has_work(CPUState *cs) (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR); } =20 -static void rx_cpu_reset(DeviceState *dev) +static void rx_cpu_reset_hold(Object *obj) { - RXCPU *cpu =3D RX_CPU(dev); + RXCPU *cpu =3D RX_CPU(obj); RXCPUClass *rcc =3D RX_CPU_GET_CLASS(cpu); CPURXState *env =3D &cpu->env; uint32_t *resetvec; =20 - rcc->parent_reset(dev); + if (rcc->parent_phases.hold) { + rcc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPURXState, end_reset_fields)); =20 @@ -215,11 +217,12 @@ static void rx_cpu_class_init(ObjectClass *klass, voi= d *data) DeviceClass *dc =3D DEVICE_CLASS(klass); CPUClass *cc =3D CPU_CLASS(klass); RXCPUClass *rcc =3D RX_CPU_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 device_class_set_parent_realize(dc, rx_cpu_realize, &rcc->parent_realize); - device_class_set_parent_reset(dc, rx_cpu_reset, - &rcc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, rx_cpu_reset_hold, NULL, + &rcc->parent_phases); =20 cc->class_by_name =3D rx_cpu_class_by_name; cc->has_work =3D rx_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671227030; cv=none; d=zohomail.com; s=zohoarc; b=ZmTnaGXCGwmHAH7zScobjEhr2nQr7wR0hnRSZiWo7B8KgXyQ7DPAU3BWxa1ox8Wc9eGjIqwblt/d5DlMuSj6aaXq9ZQjU3CWowpQaEQI1SkJ+AoPUBfhdPNW2MmTLQBgklqsEN6ttZnM7uVWbEv2sJtfFHJtHK5wHD8KWvvgJFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227030; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=edRWCBqsjA6zIj3Q58VGwuvfkVmFaYmBYW1gADSiXrE=; b=TXQwyVtSNeZ2TKDyMNws5nWh2sDJPVrUsrv1txwpegQJxnSC6XS4RHQqblKQkYOeER2eymVzBc2KxrorENgwe0weoY6Z8LZJ0r6N2FN9XrIf1Pko5wqaazaoNl/e8hkphtpC5FKJmpjXILJQMJTeCTvgrz6VzpMNIZJjTOtH3xQ= 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 1671227030339939.372231056416; Fri, 16 Dec 2022 13:43:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IUI-000666-3u; Fri, 16 Dec 2022 16:43:26 -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 1p6IU5-00061s-DR for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:13 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU3-0000bj-Ny for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:13 -0500 Received: by mail-wm1-x330.google.com with SMTP id i187-20020a1c3bc4000000b003d1e906ca23so2079825wma.3 for ; Fri, 16 Dec 2022 13:43:11 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=edRWCBqsjA6zIj3Q58VGwuvfkVmFaYmBYW1gADSiXrE=; b=kwjR68fRgDg3ScAf8dq4gZgKwPjMaaY2antm5h066SlcLhvCtyDuuF1Nq7JUfapXZ/ pVaC0f2qhB5cRzBi1w5PrhwnJb+EjhKXInf5dkKchQrq9w5Nk/9rfQRiHJACSmfW9VQg Isf/bYpn8O+saeK426Azj7yP9j4J/yIzwWKWcv8zYUWmHIwntE522mSdrvrIWVj6Eaww tyvqpskbAJQF4YwgWdLzE8nXI23IlKFkPdw7NDNT5WcMpf1+KXBULkqShvc7vJ/xBnr0 kkeGLvavWHe20Xeq0ibqsv5sbrEdzTpE8t5WPiGBiJ7ZdQ37RQLUy1B4JRQXnftgDiHv CHEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=edRWCBqsjA6zIj3Q58VGwuvfkVmFaYmBYW1gADSiXrE=; b=Q8EQqtqX2GhUp8g/J/Faf3geKA2ut5zOXjOHqbea7nPj7+2zdXq1rLYHtIyv994K7E iojpLlOBk6fH7GV/ijbxpQ4umon1ZMnyO+F3AHxpMYY3Zh8qDsvXZ8PIladZG5UKQaqw TEoknDiQ5iAi6DG0ujyPVrNMv7eFSeYJBlgbkZggTGEdn+alXcQ/cSzD+sMs4eJVrmVW 6+VWTxVHabJMBpN4Gh2MVdniUH8mZzVErUYUEt+wr0s7C4kAMfrUFEVRKE/fl47noD0R C8OhrXsTaAaPauXVdHs6Qk14kDb6qVno6UGcOeKf2QPIed4HD+bfx8iC3q3pddS7X+Af H9eg== X-Gm-Message-State: ANoB5pk4IGiHALlTVrkNm42+pT8JUNlx93NO9knNw31BKDehDjPyW9lO dE8m5J7q0gudpkGHv+2vaX27+O+aXB0LLiep X-Google-Smtp-Source: AA0mqf7orhWKqKHCXe4Py5CvMNZ26wa8adRC2U093csDVg0guuT1ms4KvR5lNrBugjE6z4+U6CUjGg== X-Received: by 2002:a05:600c:4e92:b0:3d0:89f5:9296 with SMTP id f18-20020a05600c4e9200b003d089f59296mr27221992wmq.17.1671226990863; Fri, 16 Dec 2022 13:43:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/36] target/sh4: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:34 +0000 Message-Id: <20221216214244.1391647-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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 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: 1671227032635100003 Convert the sh4 CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Message-id: 20221124115023.2437291-17-peter.maydell@linaro.org --- target/sh4/cpu-qom.h | 4 ++-- target/sh4/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/sh4/cpu-qom.h b/target/sh4/cpu-qom.h index d4192d10908..89785a90f02 100644 --- a/target/sh4/cpu-qom.h +++ b/target/sh4/cpu-qom.h @@ -34,7 +34,7 @@ OBJECT_DECLARE_CPU_TYPE(SuperHCPU, SuperHCPUClass, SUPERH= _CPU) /** * SuperHCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * @pvr: Processor Version Register * @prr: Processor Revision Register * @cvr: Cache Version Register @@ -47,7 +47,7 @@ struct SuperHCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; =20 uint32_t pvr; uint32_t prr; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 453268392bf..951eb6b9c8d 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -87,14 +87,16 @@ static bool superh_cpu_has_work(CPUState *cs) return cs->interrupt_request & CPU_INTERRUPT_HARD; } =20 -static void superh_cpu_reset(DeviceState *dev) +static void superh_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); SuperHCPU *cpu =3D SUPERH_CPU(s); SuperHCPUClass *scc =3D SUPERH_CPU_GET_CLASS(cpu); CPUSH4State *env =3D &cpu->env; =20 - scc->parent_reset(dev); + if (scc->parent_phases.hold) { + scc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUSH4State, end_reset_fields)); =20 @@ -274,11 +276,13 @@ static void superh_cpu_class_init(ObjectClass *oc, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); SuperHCPUClass *scc =3D SUPERH_CPU_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, superh_cpu_realizefn, &scc->parent_realize); =20 - device_class_set_parent_reset(dc, superh_cpu_reset, &scc->parent_reset= ); + resettable_class_set_parent_phases(rc, NULL, superh_cpu_reset_hold, NU= LL, + &scc->parent_phases); =20 cc->class_by_name =3D superh_cpu_class_by_name; cc->has_work =3D superh_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229905; cv=none; d=zohomail.com; s=zohoarc; b=BmLQQp7cJDLNZCvKvFlCv7JGM2kiyl01eOpM+56AP6kLMqgwENxsCz/I6PY0i3LeGYSn/ZQb2vvuv++DP/ok1olihAwzimJBrQjT+oCAEm1wTlg++CihSfd94We5dqPLVFJgt5pp/3bgWnnwR5nrmEbLOqVCUqwdmz3lNE8raWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229905; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bDUcrxHwLGbcB7ISY+JnEmJS7iSG+RW4z/scHWZ7amo=; b=cvrmMTELl74XzesIIU+DhQVnSs+Vvl1PAu7DXAWxWryC60KfVowzm7MohWO3I+rO5deP9ULX23WpEu93nvJ5pFJHT3BKeLsx1O5HXxRRbdxnP9cAvia8ENXf8MUsDUPsZlt3M5t0jk4MUp19TpHpUT6hSpOsy8LHRC77c0hy+og= 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 1671229905145142.58798138035468; Fri, 16 Dec 2022 14:31:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV5-0006l9-1K; Fri, 16 Dec 2022 16:44:15 -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 1p6IU6-00062W-98 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43: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 1p6IU4-0000ar-Hk for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:14 -0500 Received: by mail-wm1-x333.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso4974785wme.5 for ; Fri, 16 Dec 2022 13:43:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=bDUcrxHwLGbcB7ISY+JnEmJS7iSG+RW4z/scHWZ7amo=; b=fHgppYctibrgC9kBXxpWHycUGJgik4bz1uqWS1gG/kMhtP8dIU/D/FGIoVhHNAOz8u QAaR2CwOGQWrhxXgoY4gWY9DGdm3OiCzvEdqkeDFa+qIgML3fbcKpDz/ZBoFNQV26aRK ooRy2xtq46Z6DhefNxOln2LdlJ7RN3Ttm0pWn51vckBHg68TmlyVPT3f9E2OVGo6Kk8+ pT+HC2Ars7/y6lRmlKRXyuxRSlskALLAm6j4XJ67KavNip6j3rsd33HC78oVk1j8IojC 49/JvW+4Zg/JJwi9SgMNaG7cIrJBCfCTgWUqYhWVwrPFwm0qWUr2u6dYCQNjXIW63y8J wsTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bDUcrxHwLGbcB7ISY+JnEmJS7iSG+RW4z/scHWZ7amo=; b=Y9sphAUjzw3LM7rFLkbWRUuxJYtj7bnajG7ASjRVPSutly9iFn15Yhg067exRR+GTi xQUo+Ug2cYV9ttp2TKOcCQnF+7ewLeO6yBT1k14mcuTcCTVsv5bYs2LhJlF1uHf37Ub7 XLBI4ry4CXVC2GUEQPKIzQGOW84HmF2fmgGVTPdcFzWebjorU4w5kObw2Iz68czqg+YA vZrpIbtJCv9qMUoXDhdNKCwGlvfBTwoTO2ECfSdZ2ozPaWNVR5NFM6G99GlFZhLEWZa2 rl7/M3g06u3IC/v0XQy6uYZMGLN2YmNf1hfe9WrVXRjII8UEgVQ16C8quGA5yZrVjItR 6mmw== X-Gm-Message-State: ANoB5pnU5f9JgZh1t1CS2lJkNGVTx6NfgMMfnNHFHwml/x/w5GtbA0gr UbqBv3tgrxrjwXWRIM0V2P24yAunzZSGqdMz X-Google-Smtp-Source: AA0mqf6imw9rUGczwz80Qf37ViJD8C9veThp0xWGtutq8Tvz8/qyiQVh1Heq9ofxsF40QMAtyZ2xXA== X-Received: by 2002:a05:600c:5120:b0:3d2:5e4e:6fa with SMTP id o32-20020a05600c512000b003d25e4e06famr6898775wms.34.1671226991745; Fri, 16 Dec 2022 13:43:11 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/36] target/sparc: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:35 +0000 Message-Id: <20221216214244.1391647-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::333; envelope-from=peter.maydell@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 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: 1671229906402100001 Convert the sparc CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Reviewed-by: Mark Cave-Ayland Message-id: 20221124115023.2437291-18-peter.maydell@linaro.org --- target/sparc/cpu-qom.h | 4 ++-- target/sparc/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index 86ed37d9333..78bf00b9a23 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -35,7 +35,7 @@ typedef struct sparc_def_t sparc_def_t; /** * SPARCCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * * A SPARC CPU model. */ @@ -45,7 +45,7 @@ struct SPARCCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; sparc_def_t *cpu_def; }; =20 diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 4c3d08a8751..1734ef8dc6b 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -28,14 +28,16 @@ =20 //#define DEBUG_FEATURES =20 -static void sparc_cpu_reset(DeviceState *dev) +static void sparc_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); SPARCCPU *cpu =3D SPARC_CPU(s); SPARCCPUClass *scc =3D SPARC_CPU_GET_CLASS(cpu); CPUSPARCState *env =3D &cpu->env; =20 - scc->parent_reset(dev); + if (scc->parent_phases.hold) { + scc->parent_phases.hold(obj); + } =20 memset(env, 0, offsetof(CPUSPARCState, end_reset_fields)); env->cwp =3D 0; @@ -889,12 +891,14 @@ static void sparc_cpu_class_init(ObjectClass *oc, voi= d *data) SPARCCPUClass *scc =3D SPARC_CPU_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, sparc_cpu_realizefn, &scc->parent_realize); device_class_set_props(dc, sparc_cpu_properties); =20 - device_class_set_parent_reset(dc, sparc_cpu_reset, &scc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, sparc_cpu_reset_hold, NUL= L, + &scc->parent_phases); =20 cc->class_by_name =3D sparc_cpu_class_by_name; cc->parse_features =3D sparc_cpu_parse_features; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671230016; cv=none; d=zohomail.com; s=zohoarc; b=hsut91ypCVkkeuwlYINWgKwtFtUE5VQpzKrOO009fpt3FErIBPZKkZKT2Xy793haQbg+TsQg8ks/nRC33cGIdx0xo7ztQyfJU7hI27GueN8IawFUAaI+i4oFFJP4DzeYvEO91Ggwznz8mA1sQz5NIsVqTnhBntUGrvukOKewnV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671230016; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NmHc1iW2xf801WdjGgkjhtPtQcaDJVi1vDsYl4gELPE=; b=O5zh/FmqKkf0JaOK0MApJqHIPssOKoz6IOcLJ/O8E//TTwo0hIXKtdJveaAG5Y2+RP/JQTOU13wc5R7fKwVh7EgL5H7BVsfOUFO870+uMmfSVxV/RNrqaj6GDKqE2jMBenJNhmsclpej3M4PGOPGytJH/rTc780PXOTqFW+vDQg= 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 1671230016261569.8589516425334; Fri, 16 Dec 2022 14:33:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV5-0006lp-Mq; Fri, 16 Dec 2022 16:44:15 -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 1p6IU7-00063T-8k for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:15 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IU5-0000ck-Gg for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:14 -0500 Received: by mail-wm1-x32d.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so2678562wmb.5 for ; Fri, 16 Dec 2022 13:43:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=NmHc1iW2xf801WdjGgkjhtPtQcaDJVi1vDsYl4gELPE=; b=sJs61Y9rk7oSJyORF5J4o54KW7CWbVbFYwkwP2Lm4ShEBQdC6ZIiHxUVFDw3pV6Zgu aAEXxF2yCCwEx2BCaSwrIwcIVqUD59tVYKpFp9koov0cuMMgP/nSI29dGeZ85It3vdaN 3cvHzuTKTua4kRSJfKLAxE/xLonAPOqFTtXXU/1y+Rk9ZufMF8Cz90gH2jaTTe9WDytv isdEd8OyBzo7dcBQvFGfCoGtacLi7YGnNtmEscwr7LbfivRIaL3AnFTnUmPh9BlZ1Sde QOkNW5460W2rL+7VHa9Hby1VGL4+/5xw1WpguifNiCmz2qgLVjmRQSibeRqbI3L8PIC4 Gkcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NmHc1iW2xf801WdjGgkjhtPtQcaDJVi1vDsYl4gELPE=; b=LOl/QhzYGt5DHlNaiQlhKDpUFbfqLIWmIMIcalk70Ek23ad5uODzyASUlo9KdpQGWP Lf8WYsYl8Z+q6/7Gg+tNmm3qY+KFtjmuRRSHmS9u0bJeoQYvxGPJ3jxIG//wYYDY4pvj dO0Zy0zMvGaOMCstzSqXU7y6gpn6t6eRQ0HPY0ShNe4vDGcWYJ1YEGu1wPdaOmLMGQR1 f7OTTqqStt+NeOBZoHbqNHLXX2AsnnbD5MNkGInmxsz+PMMQWOzN8Lru5bwpyRdHAVqn YsTR2BxsT4Qz0/hcTsZv+EaHyt/LhNqPcJF2P8PfxSCs9/WL+nlSWpgb/8MITLBDWNNY kLPQ== X-Gm-Message-State: ANoB5pk2+YYDbunkdkcsNo+mUHzGRusR6dbqCBXBFzvx+i69BSO3SJ8j d3SRvA/eL/mhYEo7aPbCx9xllhFm5yiGucGk X-Google-Smtp-Source: AA0mqf6eMUgHalWMFa13luv5W7xc2TKmY2cj1nYc8wwdxsrgZiHjM6LJqyX/Eyu2BUZH24cckDO4tw== X-Received: by 2002:a05:600c:3555:b0:3d0:8643:caf1 with SMTP id i21-20020a05600c355500b003d08643caf1mr18952734wmq.16.1671226992735; Fri, 16 Dec 2022 13:43:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/36] target/tricore: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:36 +0000 Message-Id: <20221216214244.1391647-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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: 1671230016810100005 Convert the tricore CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Reviewed-by: Mark Cave-Ayland Message-id: 20221124115023.2437291-19-peter.maydell@linaro.org --- target/tricore/cpu-qom.h | 2 +- target/tricore/cpu.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/target/tricore/cpu-qom.h b/target/tricore/cpu-qom.h index ee24e9fa76a..612731daa09 100644 --- a/target/tricore/cpu-qom.h +++ b/target/tricore/cpu-qom.h @@ -32,7 +32,7 @@ struct TriCoreCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 =20 diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 2c54a2825f8..594cd1efd5e 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -68,14 +68,16 @@ static void tricore_restore_state_to_opc(CPUState *cs, env->PC =3D data[0]; } =20 -static void tricore_cpu_reset(DeviceState *dev) +static void tricore_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); TriCoreCPU *cpu =3D TRICORE_CPU(s); TriCoreCPUClass *tcc =3D TRICORE_CPU_GET_CLASS(cpu); CPUTriCoreState *env =3D &cpu->env; =20 - tcc->parent_reset(dev); + if (tcc->parent_phases.hold) { + tcc->parent_phases.hold(obj); + } =20 cpu_state_reset(env); } @@ -180,11 +182,13 @@ static void tricore_cpu_class_init(ObjectClass *c, vo= id *data) TriCoreCPUClass *mcc =3D TRICORE_CPU_CLASS(c); CPUClass *cc =3D CPU_CLASS(c); DeviceClass *dc =3D DEVICE_CLASS(c); + ResettableClass *rc =3D RESETTABLE_CLASS(c); =20 device_class_set_parent_realize(dc, tricore_cpu_realizefn, &mcc->parent_realize); =20 - device_class_set_parent_reset(dc, tricore_cpu_reset, &mcc->parent_rese= t); + resettable_class_set_parent_phases(rc, NULL, tricore_cpu_reset_hold, N= ULL, + &mcc->parent_phases); cc->class_by_name =3D tricore_cpu_class_by_name; cc->has_work =3D tricore_cpu_has_work; =20 --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229378; cv=none; d=zohomail.com; s=zohoarc; b=UQwcbav0agkwtmUPXdVOh7jTeTNVnbz754U82Q6c8NsW5WL/J/z6SfFf5qfo0K2fatIl2EugdAtJ21Naf7koAsYb/6u2ZK02gkmdM9RiYvYfAX262B3j0HNf16RGXgmMULKvnf3je2MtztK8jPqpeDR5ur8aXSBKXbiBA3cdXD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229378; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tmWSOkAlgQ3XeV0sLQSMRS/hn+5qBNnCvxTz3LkMcQc=; b=FtSDH2nx2BY4SQR7k1aFRcUpBRlWngRsZ0ExREL6l9mIX04aeeMAPrc/z8imVwEdqPGbEk+L13ScSunBprc7H3mIWi60xf+UB8MwBbE7x8XmmyUiUSEMSYo5UU5pvE5DZKgYAlOdd1FbAOzUbk3ALf11MCkGDLoSomuxflgdlH4= 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 1671229378333841.7746400223708; Fri, 16 Dec 2022 14:22:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV0-0006ft-6s; Fri, 16 Dec 2022 16:44: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 1p6IU8-00064V-6M for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:16 -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 1p6IU6-0000fE-GH for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:15 -0500 Received: by mail-wm1-x32f.google.com with SMTP id v7so2786738wmn.0 for ; Fri, 16 Dec 2022 13:43:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=tmWSOkAlgQ3XeV0sLQSMRS/hn+5qBNnCvxTz3LkMcQc=; b=lyPa3JVlWjHsLi18a+PEbeqodaoH0/bqyckN9gU7xFTDgDFIkpAPCdLWJIxFY89UsZ Rf2sRBuaL4Ctnwu4/FPHjQCeKMIm+x4XG812x0RsNsIzEzmEzSsGIaSOcvuJkJmb4c2u 7tcpJH617MolIkKUfN69a4bJyJh9/TUIqdoWmkSi5SEXexeXfab6hCXTjwrfk6G6mOS7 FYFuWub4Oi/vtHoPrLBX+Vgofi63Qt6qK9zVGoe4kVqMvY/RIREmA0b2v1gJy4g/tCFR wLAspnBnGGnikOz9i/frG4XfrjrINmNSx8qs0pbe05HvADI0+HuIqy0bauXR1mrYGp7X 5X0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tmWSOkAlgQ3XeV0sLQSMRS/hn+5qBNnCvxTz3LkMcQc=; b=o2oQfHvh8dVe39snbZHyfVCLb75EKMzXBeQbP4SN7YvjkLa+rps9s75i9YJ41WHkha PJp4ZTIWwqJ0yGEeYR+lO4bn7+LgQpKKiyWNEst/OXtNNsxPofnUASJQsRaa1+kcRXSR Tf8PivG2Qx1iervD3Ob9jtuRTUgWVExqERgsOax+KgLgdT/IJ5mvI24bdPiq0dIa4oJa TsLdZJANS3now8srWN99Y38ouVTYcqURTaYns+1fxC3vdedmW4+5T/Fvhw0awQJcNby1 GqRUhajpN2NCNP6267WbvdK7/ofVKaXJYTIzo7vR2pAH7Aib7vTBlFL/QyW3ewueU7QX H2Jw== X-Gm-Message-State: AFqh2kqUKiLwS9CvYCDnbd5zDTDuI/VHqGpn77ROdyO8m3KFdgKAOswQ ZlAA5FJmzlP35P7wZJSEa9dwOQWNjptkwxpV X-Google-Smtp-Source: AMrXdXtTZSHF6OtmVXYn9AJ9JmK58jeh+ERIfNEgP1poxhJYKQKOm7UvwoWBUGN3TDV5Bkj9QKGbAw== X-Received: by 2002:a05:600c:ad6:b0:3d3:3fb1:901d with SMTP id c22-20020a05600c0ad600b003d33fb1901dmr4494380wmr.37.1671226993776; Fri, 16 Dec 2022 13:43:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/36] target/xtensa: Convert to 3-phase reset Date: Fri, 16 Dec 2022 21:42:37 +0000 Message-Id: <20221216214244.1391647-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32f; envelope-from=peter.maydell@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 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: 1671229378716100001 Convert the xtensa CPU class to use 3-phase reset, so it doesn't need to use device_class_set_parent_reset() any more. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Edgar E. Iglesias Reviewed-by: Taylor Simpson Reviewed-by: Greg Kurz Reviewed-by: Mark Cave-Ayland Message-id: 20221124115023.2437291-20-peter.maydell@linaro.org --- target/xtensa/cpu-qom.h | 4 ++-- target/xtensa/cpu.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/xtensa/cpu-qom.h b/target/xtensa/cpu-qom.h index 4fc35ee49b8..419c7d8e4a3 100644 --- a/target/xtensa/cpu-qom.h +++ b/target/xtensa/cpu-qom.h @@ -41,7 +41,7 @@ typedef struct XtensaConfig XtensaConfig; /** * XtensaCPUClass: * @parent_realize: The parent class' realize handler. - * @parent_reset: The parent class' reset handler. + * @parent_phases: The parent class' reset phase handlers. * @config: The CPU core configuration. * * An Xtensa CPU model. @@ -52,7 +52,7 @@ struct XtensaCPUClass { /*< public >*/ =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; =20 const XtensaConfig *config; }; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 09923301c40..2dc8f2d232f 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -85,16 +85,18 @@ bool xtensa_abi_call0(void) } #endif =20 -static void xtensa_cpu_reset(DeviceState *dev) +static void xtensa_cpu_reset_hold(Object *obj) { - CPUState *s =3D CPU(dev); + CPUState *s =3D CPU(obj); XtensaCPU *cpu =3D XTENSA_CPU(s); XtensaCPUClass *xcc =3D XTENSA_CPU_GET_CLASS(cpu); CPUXtensaState *env =3D &cpu->env; bool dfpu =3D xtensa_option_enabled(env->config, XTENSA_OPTION_DFP_COPROCESSOR); =20 - xcc->parent_reset(dev); + if (xcc->parent_phases.hold) { + xcc->parent_phases.hold(obj); + } =20 env->pc =3D env->config->exception_vector[EXC_RESET0 + env->static_vec= tors]; env->sregs[LITBASE] &=3D ~1; @@ -240,11 +242,13 @@ static void xtensa_cpu_class_init(ObjectClass *oc, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); XtensaCPUClass *xcc =3D XTENSA_CPU_CLASS(cc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 device_class_set_parent_realize(dc, xtensa_cpu_realizefn, &xcc->parent_realize); =20 - device_class_set_parent_reset(dc, xtensa_cpu_reset, &xcc->parent_reset= ); + resettable_class_set_parent_phases(rc, NULL, xtensa_cpu_reset_hold, NU= LL, + &xcc->parent_phases); =20 cc->class_by_name =3D xtensa_cpu_class_by_name; cc->has_work =3D xtensa_cpu_has_work; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229869; cv=none; d=zohomail.com; s=zohoarc; b=iR4pTqVRHBgL6PP8JI/BrHjSZSPh6QxCPAROoym/XfhGAa80ZaoUCkzjE5fM/IL3KulUu+TnAZ46sF7W2r6ijmST+CAyLzeIrDeoG0STxATJMnZwAk9tEI5WICMXixSZSJagmZIiaL3qUjBDruL2Y2wQpmPqhxE2x539R7SMfDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229869; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p23dzeVMJeBlC5T/z5p/oWaIFlDAiyWvA9icRXV99Mg=; b=TipdaT3R0qJdZrWKf9zLnFyMFd8zjCvibVHalT6BlGV9E/hjVMcHSngQ6nISgzwyiNZZPMyfECRdzugJ7xktNUz0OMiU6NkfKefnL/mN/OFTa8iD9tidJBfmbuhXCvD8JpE0PoBIvjgukPI23CDXCFELc1dOctgGya/qhc5RbV4= 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 1671229869829734.5779302601229; Fri, 16 Dec 2022 14:31:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV2-0006gc-46; Fri, 16 Dec 2022 16:44: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 1p6IUC-00064x-Ny for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:21 -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 1p6IU7-0000ad-Be for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:16 -0500 Received: by mail-wm1-x336.google.com with SMTP id h8-20020a1c2108000000b003d1efd60b65so5041363wmh.0 for ; Fri, 16 Dec 2022 13:43:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=p23dzeVMJeBlC5T/z5p/oWaIFlDAiyWvA9icRXV99Mg=; b=LbRwThVG+rrs3bGsVEeAMZdTm26SW0XjMQ6oSFSTIyNRk72QfVXmXle6GKRMzJcnIq ca4tJ038GP6dMTJxnJCQ/uphF356+f9inOyWYAONtwF6bmBfWQ9lNtONx/z6qABn9Gwa fjbwBAgJjp0dPWuESz8ZZ3xa8W23uLTFSBvyifLTT6gyF600qdmpASkvCbD4chph5dU6 j62dKru+RHHxl3RF2XpY+FIrLiw0BkH5Z5KjJGSBP5mrRMsLU0dh4rmn4obPx0XnOfEw ptJc4wO0pZOtxX5l76m/rXX3oNZY7+cXsj9idWC05H1ruwXriEQrz9AEOQMmgPWBuPF5 RXMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=p23dzeVMJeBlC5T/z5p/oWaIFlDAiyWvA9icRXV99Mg=; b=X4zj0KuppFdJP0poUyj/r/CJLIn83T1P/pPh//mDIoBHI3udbYusVWHSnB1poOeZbp 9n7rQYqcwdKYE0EaYHUPzmFF/5urFXWRiXtEWjPcLzd0RUw0uOGEgugU87t4u35RLVLK LHhwfqh59c2rqBO9wSMbg/QBrkakItLUre0Y0KfLW8s5dEawbseh0r7GJUis8Rrot95Y ysFGgCvVZFP4TBTRS4TvmszLews7T7Jpmv9bOLmWmzreiUGx7shOWPHWVsnrs/UOlBS+ D0mXdxyE4PQTeQpQIo+SUncWP5pSHXpcFGuudcfE/1/NpjWFe5EI3/xxCqb9wj1lvAyb WSkg== X-Gm-Message-State: ANoB5pkjFQqV2rARkGyqZHQBMhdWYkxM96EDNhM3aWKDATnVPDjVJ3jG pCWFlfo+xCKm13In+Ez7NnUm+fiUJPTAhm8a X-Google-Smtp-Source: AA0mqf6MFNjnBdJJ3BBX1pEYRlee7AvRjrNI8kh1axtN+4Vu4L1n8VTL0z9ZLdght3rBu7YmmGVOMA== X-Received: by 2002:a05:600c:1c9e:b0:3d2:7a7:5cc6 with SMTP id k30-20020a05600c1c9e00b003d207a75cc6mr24389061wms.18.1671226994680; Fri, 16 Dec 2022 13:43:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/36] hw/virtio: Convert TYPE_VIRTIO_PCI to 3-phase reset Date: Fri, 16 Dec 2022 21:42:38 +0000 Message-Id: <20221216214244.1391647-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::336; envelope-from=peter.maydell@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 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: 1671229870191100001 Convert the TYPE_VIRTIO_PCI class to 3-phase reset. This is necessary so that we can convert the subclass TYPE_VIRTIO_VGA_BASE also to 3-phase reset. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-2-peter.maydell@linaro.org --- hw/virtio/virtio-pci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index a1c9dfa7bb5..7873083b860 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2008,9 +2008,10 @@ static void virtio_pci_reset(DeviceState *qdev) } } =20 -static void virtio_pci_bus_reset(DeviceState *qdev) +static void virtio_pci_bus_reset_hold(Object *obj) { - PCIDevice *dev =3D PCI_DEVICE(qdev); + PCIDevice *dev =3D PCI_DEVICE(obj); + DeviceState *qdev =3D DEVICE(obj); =20 virtio_pci_reset(qdev); =20 @@ -2071,6 +2072,7 @@ static void virtio_pci_class_init(ObjectClass *klass,= void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); VirtioPCIClass *vpciklass =3D VIRTIO_PCI_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 device_class_set_props(dc, virtio_pci_properties); k->realize =3D virtio_pci_realize; @@ -2080,7 +2082,7 @@ static void virtio_pci_class_init(ObjectClass *klass,= void *data) k->class_id =3D PCI_CLASS_OTHERS; device_class_set_parent_realize(dc, virtio_pci_dc_realize, &vpciklass->parent_dc_realize); - dc->reset =3D virtio_pci_bus_reset; + rc->phases.hold =3D virtio_pci_bus_reset_hold; } =20 static const TypeInfo virtio_pci_info =3D { --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671229146; cv=none; d=zohomail.com; s=zohoarc; b=L2lBnlHGgrML/Ylr+NgCcFZAHBmpd13U5E8XY32HR3VwDw8FCZUc5tRnFxj0FolXC5DpbcZlgIcTMvGemAnOX4lXSNuXnA9GytESOl771nE+divpEaQjLEKsblPLigyt7MGUjB+gMzPea02SpSQSfUVhyqbcJEJbWJknuCkUYUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229146; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DtGHfxlSIosEKRzthGSrmphkcLPWydnWnesqa9WQ6L0=; b=SFLvXCOmsLZ+RdRhWzEb9UxsIQGOhJgUlzhVrK1M0KJ7VIeEb12HzkhlBxBhQutCTZ7NHp/vkfyEdNAC1Jlu1jUa0xMxYciiBeoDirZu0YrIZFPHVhbbWzf33f2lYbbxKooSv0FICiI7nvn/+joV2Z13jMzBGcLmRW3JGqd5z0w= 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 1671229146942528.9807722712693; Fri, 16 Dec 2022 14:19:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV6-0006lv-3c; Fri, 16 Dec 2022 16:44:16 -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 1p6IUC-00064y-Ok for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:21 -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 1p6IU8-0000fW-B2 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:17 -0500 Received: by mail-wm1-x331.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so2697903wms.2 for ; Fri, 16 Dec 2022 13:43:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=DtGHfxlSIosEKRzthGSrmphkcLPWydnWnesqa9WQ6L0=; b=NStxHI19wq88jy4P5MkMiy7uPWtWuqLOhlqKxggvvifXB7wRKhwc4D3+5F5JY69PrU HbscvupdRpiJhqdwrLu9wBNDyu02WOS3Z/8oS2Jjr/piKRe3CBt/tpMs3XoVZsj0QzQN GZPTi3uQ9V1J5qVHZdSSmK5v71KSY/eDvBg0Wyozm7xoGdBFgEWWNTpKrOHejofGajFh NHbxtb1eHTVDbfRo/ankmn7w/Jdq5DLuyoyZABFBv9pGjm2HqXEhoAebf5Az+ccqGMyE Lei/h4rjGE3PQwZiHum6jY+rqzw9BTQxKjynyAwN2BL4puZEyo3FYvZYEEVEhN+mI+nO AANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=DtGHfxlSIosEKRzthGSrmphkcLPWydnWnesqa9WQ6L0=; b=ooqORtmmmu5hkbXXD0+NbMsmHOVvcaUN+0tLljncQh+OnqJRyo2KERGTtLNxRwq3JR k15f7Q+R+Vvu5tVXK8NEAu46iEWkiAYYiXqhCsSvPI9YEER/NRja3btmZQ2jm/RPlUed CcAO3GmyFo7rUfRym8b0pof+Ff9KspusXMMSXwlDuwwNlShJ5oJXVHIWJ7d2LLhvKvm1 Ar7UxggexWLivIjFvH0moCcK20TA4tN2DsER1lleX2Lmb1Y8J4K4lRVuYBcAp408Y5ug iJD/TY4lUksvIUA7CEP/wVBbcy7Ew7p25IvVOlPATE5OwHbApyoAeuuYyeF0g7BZkIbR RssQ== X-Gm-Message-State: ANoB5pkX8fFpcjloRRIPIpFcfSzyh7/EqkcFB0k4/AUleuT+R4ZYtD+r FFPXkAMmJ9m9ReQUhkyOQ6KbdTzZgW7rxqN8 X-Google-Smtp-Source: AA0mqf5Hx145HmdAf7FciSFiDTdjPHWkfpoG6bWV1Wx0JjOX1zy8CkbyZJ4HB+sOZ63e6GhAJ885hw== X-Received: by 2002:a05:600c:1e8c:b0:3d2:381f:2db5 with SMTP id be12-20020a05600c1e8c00b003d2381f2db5mr11139069wmb.22.1671226995607; Fri, 16 Dec 2022 13:43:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/36] hw/display/virtio-vga: Convert TYPE_VIRTIO_VGA_BASE to 3-phase reset Date: Fri, 16 Dec 2022 21:42:39 +0000 Message-Id: <20221216214244.1391647-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::331; envelope-from=peter.maydell@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 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: 1671229147550100002 Convert the TYPE_VIRTIO_VGA_BASE class to 3-phase reset, so we don't need to use device_class_set_parent_reset() any more. Note that this is an abstract class itself; none of the subclasses override its reset method. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-3-peter.maydell@linaro.org --- hw/display/virtio-vga.h | 2 +- hw/display/virtio-vga.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h index 977ad5edc29..0bd9db1ceea 100644 --- a/hw/display/virtio-vga.h +++ b/hw/display/virtio-vga.h @@ -23,7 +23,7 @@ struct VirtIOVGABase { struct VirtIOVGABaseClass { VirtioPCIClass parent_class; =20 - DeviceReset parent_reset; + ResettablePhases parent_phases; }; =20 #endif /* VIRTIO_VGA_H */ diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 4dcb34c4a74..e6fb0aa876c 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -165,13 +165,15 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *v= pci_dev, Error **errp) } } =20 -static void virtio_vga_base_reset(DeviceState *dev) +static void virtio_vga_base_reset_hold(Object *obj) { - VirtIOVGABaseClass *klass =3D VIRTIO_VGA_BASE_GET_CLASS(dev); - VirtIOVGABase *vvga =3D VIRTIO_VGA_BASE(dev); + VirtIOVGABaseClass *klass =3D VIRTIO_VGA_BASE_GET_CLASS(obj); + VirtIOVGABase *vvga =3D VIRTIO_VGA_BASE(obj); =20 /* reset virtio-gpu */ - klass->parent_reset(dev); + if (klass->parent_phases.hold) { + klass->parent_phases.hold(obj); + } =20 /* reset vga */ vga_common_reset(&vvga->vga); @@ -203,13 +205,14 @@ static void virtio_vga_base_class_init(ObjectClass *k= lass, void *data) VirtioPCIClass *k =3D VIRTIO_PCI_CLASS(klass); VirtIOVGABaseClass *v =3D VIRTIO_VGA_BASE_CLASS(klass); PCIDeviceClass *pcidev_k =3D PCI_DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); device_class_set_props(dc, virtio_vga_base_properties); dc->vmsd =3D &vmstate_virtio_vga_base; dc->hotpluggable =3D false; - device_class_set_parent_reset(dc, virtio_vga_base_reset, - &v->parent_reset); + resettable_class_set_parent_phases(rc, NULL, virtio_vga_base_reset_hol= d, + NULL, &v->parent_phases); =20 k->realize =3D virtio_vga_base_realize; pcidev_k->romfile =3D "vgabios-virtio.bin"; --=20 2.25.1 From nobody Wed May 15 19:22:26 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=1671228841; cv=none; d=zohomail.com; s=zohoarc; b=YgIwJZCItpSJs6H8ANtgGWvUjSOONyl1qx8QlgKNjFAY80jvZPgl04eEI9qOFwLpFzz0hJerwLoxrbbRSFfElZDrfsFZ9G2M83j5Iyn//oDLqslGZ9yjKvOI3gLp2RH20QLhNQ058LFwsfz/okJNmtRVGklSmxcilI8uy/ycMi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228841; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wVHkl0SJwne+XihoGUblfNQhtc6oZLY6VgJtTl+eHTg=; b=I+1WcAIZNJ/Hdw6HxcZVmiYD5p+Un3ms6OMwA5kGcAjP3Q7GdR2UVxLEiI7envVXPbSeAJZT5V4Ng/AKvfRwoyGUQWB/xp3bT4URZHLwsCCK1hubpAgcnz8DFpV/NZedGtkN2RcGRRu+aFmemXTkUu7HoYIkXrEmoj0X422QcPw= 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 1671228841875435.9991586918302; Fri, 16 Dec 2022 14:14:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV0-0006gO-Nn; Fri, 16 Dec 2022 16:44: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 1p6IUE-00065d-0i for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:24 -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 1p6IUC-0000fE-Ed for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:21 -0500 Received: by mail-wm1-x32f.google.com with SMTP id v7so2786795wmn.0 for ; Fri, 16 Dec 2022 13:43:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=wVHkl0SJwne+XihoGUblfNQhtc6oZLY6VgJtTl+eHTg=; b=FCmpYAw630CIzGTFQnm5e10seeZg27awC1jHuFTZSivU22SE2uA7V5DZ/BlZJ3rXtm oaeNvA+hGsg4vl/tLEMZ83+h7Jg+C72nKgG6nRcAb2KlZf4vgXExRBmfH+k+TMC5NUVB TjmwrxDSDucGzUo8gNUc95jDzKjWjjwCjo3ihJrtDJFuC87eWwv/G9lvAB9rxuf42NKp aJjIRGSEInjBKIWfo/uaLRGWtTcbeX1Cpwy5iJ2OQQjzAAh/wz4wpVpmskY54jXFmr4N Z9i7jUfsSmO7icpIIHIkW/SD5FztKAu8VqhFJuTuNVKW5Lr+FasFupR7oARcoooWuye8 n6HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=wVHkl0SJwne+XihoGUblfNQhtc6oZLY6VgJtTl+eHTg=; b=BxwRZYjvofDG2LMMD2KMUFWmO1b+rau2HLDqeDb7d5oXrX0ZxbUrefz9WM3PoSWYVV fZm4RoMdA6jQwu9brW5n+JPwa20LHL6iUMAZbZja3JhjHHevnZ8a0snpkpm1/OJ+gx7s 5DzbT0hXjiSD5zE0yG4GPOu4KzOG4cmSxee90959kIHUXTLYJ7Mfu3tssq1F3jCtEw4t AYD1jiruKzfT5YBJK1kyQUnO7y2bz8Hd12Qix5T8b2uUDgUKOWbbGb6f6Jf40eTLY7LQ +S2shOPw/1D6Ib8NoqvCw4bFP+/DmbpIMcjVMOFhQncbvlqHt3E1jYw9oN9pgknUzWXu tlHg== X-Gm-Message-State: ANoB5pmVp8zoi898CEoADYNa7+YGHAzoG1nauDuQJQJ9gfx9GSjC9ZZL zH28H5IwIbwtDIqkh9bjUtO8FC4uI/H6ldHI X-Google-Smtp-Source: AA0mqf5fC7t27/OeKblrJmDmSs6J2MwF4dTCYYY7Rw9D1TuFiXgiyznNXwtQeEazVo4xgeHRGqXRrw== X-Received: by 2002:a05:600c:1e8f:b0:3cf:728e:c224 with SMTP id be15-20020a05600c1e8f00b003cf728ec224mr26222895wmb.6.1671226996409; Fri, 16 Dec 2022 13:43:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/36] pci: Convert TYPE_PCIE_ROOT_PORT to 3-phase reset Date: Fri, 16 Dec 2022 21:42:40 +0000 Message-Id: <20221216214244.1391647-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32f; envelope-from=peter.maydell@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 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: 1671228843320100001 Convert the TYPE_PCIE_ROOT_PORT device to 3-phase reset; this is a necessary precursor to converting any of its child classes. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-4-peter.maydell@linaro.org --- hw/pci-bridge/pcie_root_port.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 460e48269d4..36bc0bafa7e 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -43,9 +43,10 @@ static void rp_write_config(PCIDevice *d, uint32_t addre= ss, pcie_aer_root_write_config(d, address, val, len, root_cmd); } =20 -static void rp_reset(DeviceState *qdev) +static void rp_reset_hold(Object *obj) { - PCIDevice *d =3D PCI_DEVICE(qdev); + PCIDevice *d =3D PCI_DEVICE(obj); + DeviceState *qdev =3D DEVICE(obj); =20 rp_aer_vector_update(d); pcie_cap_root_reset(d); @@ -171,13 +172,14 @@ static void rp_class_init(ObjectClass *klass, void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 k->is_bridge =3D true; k->config_write =3D rp_write_config; k->realize =3D rp_realize; k->exit =3D rp_exit; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - dc->reset =3D rp_reset; + rc->phases.hold =3D rp_reset_hold; device_class_set_props(dc, rp_props); } =20 --=20 2.25.1 From nobody Wed May 15 19:22:27 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=1671229230; cv=none; d=zohomail.com; s=zohoarc; b=QY8k6KBq+qRaMkFZ/hx9b7cG0SBtiqb+rVGj1EvZrPZA14loSr+defEuHYAM308vvMwqQa/9K6SfnLQ5py9QaAhcWaukUdau/VgIjSBIsa9iChjfEkvmUYJTHvaQgyWJhr9ffvUAnd9f/49hR2C25mgLB3sG+AVsA3RxcjFGCEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229230; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0ZxK5GRCvx4dV7xPRhk8xfl4yfvHfLR/XlrA+S/2fsw=; b=e3CLVHqkhSyyHG8YVUaHHTppPvsDA1AKG0VNLy7Au7vplDGez/hSVu8Z6WJKJWbqGyVawwtM7tC4lAG2VHsyBgfHMKpiRm066CgZq04txgXOLAgNaqwjLhqwhoNpXKmSVaEyA8kUmZzpGG76RtL6V/HbrTcStgLtiEA2TBS6Nqw= 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 16712292306501014.8187963006222; Fri, 16 Dec 2022 14:20:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV0-0006gI-KT; Fri, 16 Dec 2022 16:44: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 1p6IUE-000662-AA for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:25 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IUC-0000iq-Fk for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:22 -0500 Received: by mail-wm1-x32d.google.com with SMTP id m5-20020a7bca45000000b003d2fbab35c6so2684042wml.4 for ; Fri, 16 Dec 2022 13:43:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=0ZxK5GRCvx4dV7xPRhk8xfl4yfvHfLR/XlrA+S/2fsw=; b=WlnkFwpRrWN+WAV7yxLK4eophbBeed2oaDIUuN0ZPxyNxf6vWa8eXyJsCrzDt1RGgr Fv8KDt4tkv1eBSGmmvKznFjJ55pD6g2RGNCt/4Pwd67pmaeFaJOqcxlqeZRYSqFNt8W2 sN3LOyew36Oe6bwMsf6uUZfq5EF+jLN0RaDG26Ii6zffr6pHlnlEiHbAPrbQkeLS9d1E Krn//nqDXDW337QQFFO+CpE9ZhhFUMkTqK+W5DzGlZ67MJhfEpT0n5t/HkrGb+bmyYP2 0+ZXatGixzLjJKQ9hj7PhzQIazFoigUhZmybCaloSzIauA0wMotcl2U5Jpr/nR8u3e0h W4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=0ZxK5GRCvx4dV7xPRhk8xfl4yfvHfLR/XlrA+S/2fsw=; b=EKp+mmvGTrSW4Lykz5B89REsfW+qtZdowPmgstfWM+3rJK1KvfPiWiDrHJYMPvjtMG VypN+9ry2Wg6rsCL38HSccJYlbZNUCDDhDHk2hdGo6M7vJg3yC74XV7kDo9965wTUEtk IuPMctypGnLmQL1Mhbs1XmflpGqvFAeATS+oJtBy4C6gJYIaBkoFopRS7qioxASowEPC vk27OcCWR2hj6YaNnwuazJYoWBdeLiyMa+n0KTzF7oPyrpR7voUZEq9WXQWQws6mHlSJ LZ30DlYu5zpY5F/h/fbwG4jhtrt38Lkf+/JWzdL3+1R4rAGjVYpjCsCWN4MaLnQ96iE/ ynvg== X-Gm-Message-State: ANoB5pl48sDeIpAnpJzya71cKcl9PAB2WJ+3eKssrHCywjiY1w9KN4rc ertEMDA+KD5SqCPR48vSA027F35MKb6YeCEK X-Google-Smtp-Source: AA0mqf6w8XqKA9GnedX1uz15QFkBLs/Y5Nyv6SCmosdGwOlqDqP0vyjXieuSAi1rq6iPge3j5OyAHg== X-Received: by 2002:a1c:7303:0:b0:3cf:a258:971 with SMTP id d3-20020a1c7303000000b003cfa2580971mr36356306wmb.41.1671226997301; Fri, 16 Dec 2022 13:43:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/36] pci: Convert child classes of TYPE_PCIE_ROOT_PORT to 3-phase reset Date: Fri, 16 Dec 2022 21:42:41 +0000 Message-Id: <20221216214244.1391647-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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: 1671229231952100001 Convert the TYPE_CXL_ROOT_PORT and TYPE_PNV_PHB_ROOT_PORT classes to 3-phase reset, so they don't need to use the deprecated device_class_set_parent_reset() function any more. We have to do both in the same commit, because they keep the parent_reset field in their common parent class's class struct. Note that pnv_phb_root_port_class_init() was pointlessly setting dc->reset twice, once by calling device_class_set_parent_reset() and once directly. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-5-peter.maydell@linaro.org --- include/hw/pci/pcie_port.h | 2 +- hw/pci-bridge/cxl_root_port.c | 14 +++++++++----- hw/pci-host/pnv_phb.c | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index 7b8193061ac..d9b5d075049 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -80,7 +80,7 @@ DECLARE_CLASS_CHECKERS(PCIERootPortClass, PCIE_ROOT_PORT, struct PCIERootPortClass { PCIDeviceClass parent_class; DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; =20 uint8_t (*aer_vector)(const PCIDevice *dev); int (*interrupts_init)(PCIDevice *dev, Error **errp); diff --git a/hw/pci-bridge/cxl_root_port.c b/hw/pci-bridge/cxl_root_port.c index fb213fa06ef..6664783974c 100644 --- a/hw/pci-bridge/cxl_root_port.c +++ b/hw/pci-bridge/cxl_root_port.c @@ -138,12 +138,14 @@ static void cxl_rp_realize(DeviceState *dev, Error **= errp) component_bar); } =20 -static void cxl_rp_reset(DeviceState *dev) +static void cxl_rp_reset_hold(Object *obj) { - PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_GET_CLASS(dev); - CXLRootPort *crp =3D CXL_ROOT_PORT(dev); + PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_GET_CLASS(obj); + CXLRootPort *crp =3D CXL_ROOT_PORT(obj); =20 - rpc->parent_reset(dev); + if (rpc->parent_phases.hold) { + rpc->parent_phases.hold(obj); + } =20 latch_registers(crp); } @@ -199,6 +201,7 @@ static void cxl_root_port_class_init(ObjectClass *oc, v= oid *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_CLASS(oc); =20 k->vendor_id =3D PCI_VENDOR_ID_INTEL; @@ -209,7 +212,8 @@ static void cxl_root_port_class_init(ObjectClass *oc, v= oid *data) k->config_write =3D cxl_rp_write_config; =20 device_class_set_parent_realize(dc, cxl_rp_realize, &rpc->parent_reali= ze); - device_class_set_parent_reset(dc, cxl_rp_reset, &rpc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, cxl_rp_reset_hold, NULL, + &rpc->parent_phases); =20 rpc->aer_offset =3D GEN_PCIE_ROOT_PORT_AER_OFFSET; rpc->acs_offset =3D GEN_PCIE_ROOT_PORT_ACS_OFFSET; diff --git a/hw/pci-host/pnv_phb.c b/hw/pci-host/pnv_phb.c index 0b26b43736f..c62b08538ac 100644 --- a/hw/pci-host/pnv_phb.c +++ b/hw/pci-host/pnv_phb.c @@ -199,14 +199,16 @@ static void pnv_phb_class_init(ObjectClass *klass, vo= id *data) dc->user_creatable =3D true; } =20 -static void pnv_phb_root_port_reset(DeviceState *dev) +static void pnv_phb_root_port_reset_hold(Object *obj) { - PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_GET_CLASS(dev); - PnvPHBRootPort *phb_rp =3D PNV_PHB_ROOT_PORT(dev); - PCIDevice *d =3D PCI_DEVICE(dev); + PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_GET_CLASS(obj); + PnvPHBRootPort *phb_rp =3D PNV_PHB_ROOT_PORT(obj); + PCIDevice *d =3D PCI_DEVICE(obj); uint8_t *conf =3D d->config; =20 - rpc->parent_reset(dev); + if (rpc->parent_phases.hold) { + rpc->parent_phases.hold(obj); + } =20 if (phb_rp->version =3D=3D 3) { return; @@ -300,6 +302,7 @@ static Property pnv_phb_root_port_properties[] =3D { static void pnv_phb_root_port_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_CLASS(klass); =20 @@ -308,9 +311,8 @@ static void pnv_phb_root_port_class_init(ObjectClass *k= lass, void *data) device_class_set_props(dc, pnv_phb_root_port_properties); device_class_set_parent_realize(dc, pnv_phb_root_port_realize, &rpc->parent_realize); - device_class_set_parent_reset(dc, pnv_phb_root_port_reset, - &rpc->parent_reset); - dc->reset =3D &pnv_phb_root_port_reset; + resettable_class_set_parent_phases(rc, NULL, pnv_phb_root_port_reset_h= old, + NULL, &rpc->parent_phases); dc->user_creatable =3D true; =20 k->vendor_id =3D PCI_VENDOR_ID_IBM; --=20 2.25.1 From nobody Wed May 15 19:22:27 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=1671229942; cv=none; d=zohomail.com; s=zohoarc; b=jjsiTpoV0IfjCs8aj+kZm4UWRZXuQTzuCHB5Y/EeTa90bGT2ynvWbhqvjlpRhsPjiPp79wbb+6bMdEzlkhF4ZKC5GGmrQowJudhxUJIQ89Zo0j/oZHuGc9PKpxzV1AgbHXaujcrSl/SdtTiClb4kyIvUwTDJL5NuWZvosnTbRKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229942; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W1JmqKacM9m8zOcJKdX5kBax+NSgUM13DsFDzRHKMZY=; b=mFnf9iZWAyY5maq+MJyXv/+7+fmA0o3+GAOwkrwozfcOvQhobIIoyF59v43tz07NpRzU6TpuCXFoNFAEk9apW0GYFUL9scvVLB+WpOW05j3JsqOTz2UJex0cfYtFKdDpxnb49935kPSMy8FG1eVRWwsTwwyMO9qyhMr7lNbFbFs= 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 1671229942037902.9899384814247; Fri, 16 Dec 2022 14:32:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV5-0006lL-0h; Fri, 16 Dec 2022 16:44:15 -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 1p6IUF-00066A-Dv for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:25 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IUC-0000iy-GJ for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id h8-20020a1c2108000000b003d1efd60b65so5041472wmh.0 for ; Fri, 16 Dec 2022 13:43:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=W1JmqKacM9m8zOcJKdX5kBax+NSgUM13DsFDzRHKMZY=; b=IpRsAea5we80r3KV7DT0PYJpVWBWz2DVg6RZjWbKAf1bVt3Qf0rOKuj13chZAgWnwX wdh2lNgpkduWKHJAJIDfzRjT6SMCFxQVCSrbLNvXAWwiUQBXKPJqlstI5m07q4c4Iqu5 a7vqxFdUthhoGXbkoQ3EXko9XFm/v6mAveRkMZTWNEHkgI7fcpkJnPBjrkMjNmXD80HJ 7IdVkM4YnEYkkvAdoDpMFggNEqLyn3rz2KkeO78BEH/Gcx+oegbGOg6EkyxVk+BTxWOG TNzOiv/dfvhCGYKK7cf0ohzM9VuBkZ6IagxeH+78/swV/r/5FaDNQIcFt3ATOnI5dQLe W4Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=W1JmqKacM9m8zOcJKdX5kBax+NSgUM13DsFDzRHKMZY=; b=ca0m+8S4d2Rm/3LbCJZ8O3jxQePnDQI3zMLnYTWkzHGPC315a8TgPJ0yRHyR6/OkvG GiEkqItnhO6egUK7MsdXeFNHOAmUxN/TXGBoDELpG2wsLtE61WElVSlfNkQRudexRWKs eUqzyg/B5WlIhLBE0sptYW+hLnwaon0T2J0Bay9M0gVPqtj3XZEwIq1YGVRmoGrkoLg2 TbjdpNH6GygS4lKhqrmYjG1Qqp6fQed3otFc5nwcNvl4ELQNL+TS92sbtmqRy0RXawzg fLiXt5EfrVNI7shbSyJqatlrmKyDPskVKb+7gXeLXnuJcXSO7iWPcKhm41Wn8AapWDA6 9j/g== X-Gm-Message-State: AFqh2kooo3TXhrW5twRwaDszRjWvBgxbymYsvkdjV+m/x9OMJAodN27N 5p31jupEDytx/F6Yh1B0YAE6Kb9+k4v1qd8C X-Google-Smtp-Source: AMrXdXt1fAT774BbM6h2sIdnSCpgP55+E8kmmLasHD+qV9Np8UdggKPBc1nKdAnXdohCF8GMVPOEiA== X-Received: by 2002:a7b:c856:0:b0:3d3:4406:8a2e with SMTP id c22-20020a7bc856000000b003d344068a2emr3159801wml.15.1671226998129; Fri, 16 Dec 2022 13:43:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/36] hw/intc/xics: Reset TYPE_ICS objects with device_cold_reset() Date: Fri, 16 Dec 2022 21:42:42 +0000 Message-Id: <20221216214244.1391647-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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 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: 1671229942480100001 The realize method for the TYPE_ICS class uses qemu_register_reset() to register a reset handler, as a workaround for the fact that currently objects which directly inherit from TYPE_DEVICE don't get automatically reset. However, the reset function directly calls ics_reset(), which is the function that implements the legacy reset method. This means that only the parent class's data gets reset, and a subclass which also needs to handle reset, like TYPE_PHB3_MSI, has to register its own reset function. Make the TYPE_ICS reset function call device_cold_reset() instead: this will handle reset for both the parent class and the subclass, and will work whether the classes are using legacy reset or 3-phase reset. This allows us to remove the reset function that the subclass currently has to set up. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-6-peter.maydell@linaro.org --- hw/intc/xics.c | 2 +- hw/pci-host/pnv_phb3_msi.c | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index dcd021af668..dd130467ccc 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -593,7 +593,7 @@ static void ics_reset(DeviceState *dev) =20 static void ics_reset_handler(void *dev) { - ics_reset(dev); + device_cold_reset(dev); } =20 static void ics_realize(DeviceState *dev, Error **errp) diff --git a/hw/pci-host/pnv_phb3_msi.c b/hw/pci-host/pnv_phb3_msi.c index 2f4112907b8..ae908fd9e41 100644 --- a/hw/pci-host/pnv_phb3_msi.c +++ b/hw/pci-host/pnv_phb3_msi.c @@ -239,11 +239,6 @@ static void phb3_msi_reset(DeviceState *dev) msi->rba_sum =3D 0; } =20 -static void phb3_msi_reset_handler(void *dev) -{ - phb3_msi_reset(dev); -} - void pnv_phb3_msi_update_config(Phb3MsiState *msi, uint32_t base, uint32_t count) { @@ -272,8 +267,6 @@ static void phb3_msi_realize(DeviceState *dev, Error **= errp) } =20 msi->qirqs =3D qemu_allocate_irqs(phb3_msi_set_irq, msi, ics->nr_irqs); - - qemu_register_reset(phb3_msi_reset_handler, dev); } =20 static void phb3_msi_instance_init(Object *obj) --=20 2.25.1 From nobody Wed May 15 19:22:27 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=1671227166; cv=none; d=zohomail.com; s=zohoarc; b=EXm790Wh355fMhq7Zx8tR3NJDy6ANiX7rJWPHfts6jMuUVWuSr+WLQMn5xLGxPrSDeutFHtH2KtDVPE58E+FtlhnZBu0JILMbk2TeY6svI0Htoyx7AWQ5j+5mVMLh0B4xkqGaDjyNvJMVAA4aHbYyw4jiiK88rhpQaXxTZgFjzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671227166; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SHJyhm2AvF1J3KhcjjNeB31fuKNh0dgEGUX5Ov6mrnA=; b=FwASKVMlWVEc669eb9h0lV4soPZw8CdIFoZEXLnoWEEnIe+26SRNJd2XjVWrMFf5rmNCnjnP0dQwb4Luhm9GuvlSCsmIkejLmiHSfrf1pglDX7CSHTvQxL76ijAZo55UclI/Ak5YmUJKviLm3OhYjZIXVrk8VVildqs4eVujkpU= 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 1671227166950937.8303712775228; Fri, 16 Dec 2022 13:46:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV8-0006pB-9C; Fri, 16 Dec 2022 16:44:18 -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 1p6IUJ-00067L-8D for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:33 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IUC-0000ck-Gz for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:26 -0500 Received: by mail-wm1-x32d.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so2678704wmb.5 for ; Fri, 16 Dec 2022 13:43:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=SHJyhm2AvF1J3KhcjjNeB31fuKNh0dgEGUX5Ov6mrnA=; b=GWVEhcJGJIJs6JULa7rzsirYlBUI9BPAylC7RjAWoFzMIbUWFDi7ewMJrx28QFX0ZV Lk9G8ZruKXD5eLY+yTwfUqSehPR8cXrDsSf1DByo0+s4LcQLTrvwtwzcixyJCvvFgKVm 0WD8/cyLzJJaEh6FmpiDX0PJyz2KJv9yPIM7kmO4R0znP6fHoix7btLfUq8VT78m5806 bc1Mu+AYKSBhI9dGxFPHfXZYaf5tVwiUH1QqWWMAkHg1iavIFw1oVZZ5lyiI+/ZJgxn4 Ba1Yznx7kQLB3fFVe8nIS/WNlOEf7DPqDH5R8MEWNCatjC33oIwoGOvJobCAgL31700m JzqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=SHJyhm2AvF1J3KhcjjNeB31fuKNh0dgEGUX5Ov6mrnA=; b=ybiaEpKSyjo8rAFfG3RCPvdeBfzXW8jmRcMZ1CJT2i+fgGt3dmuj0BC0/sqdX2ttVf TJqTjDKErHxhKZt9K4VSTPgkB9CU4s8hwtx/NnS2wxUqIEWH5V8KyWHx6rvC/E5OnXy1 usF86xjbO9nEGAkwInJTq4ikgWTMoBjQ3BNtMpMcsZ7a9nCP8kGPpGRdm0T8Cq2npvhf q/17ss83HI8PZ6rBpDEN5Ko4pH7snJIpgS1YdudEiJ1961T0iWyIXhceSHZXGGdfakCk VaDX9rRjWD1CJODPKDDeZUPIjjA34L0jKjZX1KGr126m0XLvu3E6MF/+MJknUsWidjwJ ynOg== X-Gm-Message-State: ANoB5pnwoaTYN8w4kn1LWAoeiMHHerL0WXENMYA758EIj3UXVDdv61ie sg0qzZof9coSKTY13bbCIK3VCGvZHvqBBPu/ X-Google-Smtp-Source: AA0mqf6uDzvDbwsaqwNTm+Dq9R930UOcHPxRkp5w8vCL7Pxp3eOAV52ejG5yjLnzNJSV5c9+d1t4TA== X-Received: by 2002:a05:600c:354d:b0:3d0:85b5:33d3 with SMTP id i13-20020a05600c354d00b003d085b533d3mr26138175wmq.16.1671226998925; Fri, 16 Dec 2022 13:43:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/36] hw/intc/xics: Convert TYPE_ICS to 3-phase reset Date: Fri, 16 Dec 2022 21:42:43 +0000 Message-Id: <20221216214244.1391647-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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 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: 1671227167406100001 Convert the TYPE_ICS class to 3-phase reset; this will allow us to convert the TYPE_PHB3_MSI class which inherits from it. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-7-peter.maydell@linaro.org --- hw/intc/xics.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index dd130467ccc..c7f8abd71e4 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -564,9 +564,9 @@ static void ics_reset_irq(ICSIRQState *irq) irq->saved_priority =3D 0xff; } =20 -static void ics_reset(DeviceState *dev) +static void ics_reset_hold(Object *obj) { - ICSState *ics =3D ICS(dev); + ICSState *ics =3D ICS(obj); g_autofree uint8_t *flags =3D g_malloc(ics->nr_irqs); int i; =20 @@ -584,7 +584,7 @@ static void ics_reset(DeviceState *dev) if (kvm_irqchip_in_kernel()) { Error *local_err =3D NULL; =20 - ics_set_kvm_state(ICS(dev), &local_err); + ics_set_kvm_state(ics, &local_err); if (local_err) { error_report_err(local_err); } @@ -688,16 +688,17 @@ static Property ics_properties[] =3D { static void ics_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->realize =3D ics_realize; device_class_set_props(dc, ics_properties); - dc->reset =3D ics_reset; dc->vmsd =3D &vmstate_ics; /* * Reason: part of XICS interrupt controller, needs to be wired up, * e.g. by spapr_irq_init(). */ dc->user_creatable =3D false; + rc->phases.hold =3D ics_reset_hold; } =20 static const TypeInfo ics_info =3D { --=20 2.25.1 From nobody Wed May 15 19:22:27 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=1671229741; cv=none; d=zohomail.com; s=zohoarc; b=FqRMCCbaRyZrNEPkDfUK8rZBy7DMT9SJyfP2mEn+3r1DXKL8yQKvj8xtjxiObMP12+Egwv9dYvvbyqvTo9RCzp4gY53dsQ4pkhJ1GPTEZ1BBtx/zHdYgfq/FzRn5HLoK/y9/0SnmPRD2Q8VyeePN4LXM1ju2rwf769b5KX1zWlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671229741; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=GgUSAct2fwErvtHfNadynMYLk7/rWkew3Pzbl88e6jiASby4dOWMYYdLMzW9hldw4HmQcYDp2SC+nuHTxdOuHdp22m2Y0zMK5ok/lthz9N6d2sPb+1N4+SV4l+MPoFojBT0zQQiWFBi0tj1L/lhWOUZwRwMWaMPnXSVICZya+cE= 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 1671229741126272.56806681495345; Fri, 16 Dec 2022 14:29:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV6-0006lu-3F; Fri, 16 Dec 2022 16:44:16 -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 1p6IUJ-00067K-68 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:33 -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 1p6IUC-0000b3-HH for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:26 -0500 Received: by mail-wm1-x32a.google.com with SMTP id ja17so2736807wmb.3 for ; Fri, 16 Dec 2022 13:43:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=hVWKA9fQ2t/WFzhF/LlZVMHlVn0VG9JBFIsixsL2xWnlUkVBqFUCy34yn9c1BZEHgf /Hb886HyO0fuuez9TQhaARasogVrq90p3AGqDYmjWqxLrdnC1zVKE2ynvAU/2JdlFhXT Xq1Q+zrAk4T4RBUN2sMEBTYinlyDtVBeSbVGMuWCHBVLQbrf1KlKFLjk2wwc9f70I374 6ZG2z93ZAaBYg+iA6aIb0+43Rg7A22UQGe2pjBx/Y9zgro67W+mDYUs0a8HSQT9umZ9c uTqIiSMH9qeJEJV864cxVfeRJbH+60cB12e1rBAbWcTKKGexvYATHpQcTnx5J+dmgYFf 79ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=jbCnVtRdo2HT9atZ9NV7caEX/5jtiH4/hmWAXMOmkUEgekC/mSl2/+TGVCTIGtPtky qIKIJbwHqkAij+/zqnxz26P17Xn+2jdWhB3/nDyYfs67y2AViL7JB7MVNBUbg+LvIPep jRZ0vjTmHntbwugEKyafXWz5jugdoa9GRHVMtfpATblipoVPy3jDld/m34zpQCCFofxS MES9Qll32V+R104ozAgx3ynuDyz0ri+KJmtWZhKNd9HO54PczPubKJPWFEC1CIE2aS/O saRGWHRdqOOGZCGnJStmOZYXGIZCtKPFBsZs3B4YSp0+2X+lSuaG/TH+6ap8o92nw/yY F7kQ== X-Gm-Message-State: AFqh2krbhogsUtQatvDYXwXFwc0xW7UBnGHKZOJGeSx6D9bMTmKLaoid d5OPEnDiAfEB0SiRWT8UxPT8BgukTQAikspf X-Google-Smtp-Source: AMrXdXtLIjFwD5oyukE4kP4wXEH8sYLuiijQXol3sthNGsPajaFF1LccfMT/bM+kVGpDNotQefOl6Q== X-Received: by 2002:a05:600c:5126:b0:3d3:3c60:b2bb with SMTP id o38-20020a05600c512600b003d33c60b2bbmr5903150wms.23.1671226999786; Fri, 16 Dec 2022 13:43:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/36] hw/pci-host/pnv_phb3_msi: Convert TYPE_PHB3_MSI to 3-phase reset Date: Fri, 16 Dec 2022 21:42:44 +0000 Message-Id: <20221216214244.1391647-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-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::32a; envelope-from=peter.maydell@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 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: 1671229741573100001 Convert the TYPE_PHB3_MSI class to 3-phase reset, so we can avoid using the device_class_set_parent_reset() function. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221125115240.3005559-8-peter.maydell@linaro.org --- include/hw/ppc/xics.h | 2 +- hw/pci-host/pnv_phb3_msi.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 00b80b08c27..95ead0dd7c9 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -95,7 +95,7 @@ struct ICSStateClass { DeviceClass parent_class; =20 DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; =20 void (*reject)(ICSState *s, uint32_t irq); void (*resend)(ICSState *s); diff --git a/hw/pci-host/pnv_phb3_msi.c b/hw/pci-host/pnv_phb3_msi.c index ae908fd9e41..41e63b066f9 100644 --- a/hw/pci-host/pnv_phb3_msi.c +++ b/hw/pci-host/pnv_phb3_msi.c @@ -228,12 +228,14 @@ static void phb3_msi_resend(ICSState *ics) } } =20 -static void phb3_msi_reset(DeviceState *dev) +static void phb3_msi_reset_hold(Object *obj) { - Phb3MsiState *msi =3D PHB3_MSI(dev); - ICSStateClass *icsc =3D ICS_GET_CLASS(dev); + Phb3MsiState *msi =3D PHB3_MSI(obj); + ICSStateClass *icsc =3D ICS_GET_CLASS(obj); =20 - icsc->parent_reset(dev); + if (icsc->parent_phases.hold) { + icsc->parent_phases.hold(obj); + } =20 memset(msi->rba, 0, sizeof(msi->rba)); msi->rba_sum =3D 0; @@ -287,11 +289,12 @@ static void phb3_msi_class_init(ObjectClass *klass, v= oid *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); ICSStateClass *isc =3D ICS_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 device_class_set_parent_realize(dc, phb3_msi_realize, &isc->parent_realize); - device_class_set_parent_reset(dc, phb3_msi_reset, - &isc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, phb3_msi_reset_hold, NULL, + &isc->parent_phases); =20 isc->reject =3D phb3_msi_reject; isc->resend =3D phb3_msi_resend; --=20 2.25.1