From patchwork Fri Dec 16 21:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 634490 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1087749pvb; Fri, 16 Dec 2022 14:31:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4UFZcuAySAfV2lM/8xSGp3AuvpQKEbAED/oDIc57khGhrc4rcr6O1akX6eh9TdOiJqOgks X-Received: by 2002:a0c:c58e:0:b0:4b4:a3d5:fe4f with SMTP id a14-20020a0cc58e000000b004b4a3d5fe4fmr41317471qvj.6.1671229869435; Fri, 16 Dec 2022 14:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671229869; cv=none; d=google.com; s=arc-20160816; b=y8dxTZxBuWf1pgOkUvqyr0t1obsTDEWXW6r9cR2LE3YwP6YuWTvVxw+2WG6d2fkvuK 6y9TZBQF88DkEanaThZCWsfH8fnXKxYPL9x4wIJ+ovF3RXXt9VBL0rfuoa5dtJJXg2Dp 6LpMGsWPX4Wr0VuViK7CJCsynRuW0nCy+B6+xcNwnxUeR0pT2qQmSGiRAou0BCAXEF6L BPj/thereMxQBPZ4uD14YhQp6Sj5gozrm4LueooIqlo1MEHuC5vPQA5E93lHWH7gjQGy Tk/b+z60/6FjPNOAg4821fddt4PU0Vp95x7rCO0/Evc2AvWbo7GeJFJY/5TQbZNiGuKC vlxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=p23dzeVMJeBlC5T/z5p/oWaIFlDAiyWvA9icRXV99Mg=; b=VBqd1mh2D9Emrb3EoCh6c60fn12/CyX1i+WXC1ulygL5Lidx99AShWR95BaRbXAXBZ T85XyMjkxAxv8prQrMCxG5MCytPjlRqJwvDk9a7fZbmA9/zWTp6sjy68MBSFg5gB/RDV 38ZXTRabEsqrBWZ7RO35sDBMFDWQqLMBfbwLYr3Kxbp+woKF+DWJV07+rDvmbWsc20Ay U+rVcPOGxn3md1Q1byEC4xfiK655mz+BpmZ9l5g0SiSzpuqU4dRgCBXhNssiLGleWorU /xyRb3D/3ad/QskPjRM5HrRw4HSpi9Rx8b+369SSQWKZP/gpXQp5/LM6xW1tyIDa6SlC UhPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbRwThVG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a13-20020a056214062d00b004c77e7bcaa4si1527477qvx.198.2022.12.16.14.31.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 14:31:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbRwThVG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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) } } -static void virtio_pci_bus_reset(DeviceState *qdev) +static void virtio_pci_bus_reset_hold(Object *obj) { - PCIDevice *dev = PCI_DEVICE(qdev); + PCIDevice *dev = PCI_DEVICE(obj); + DeviceState *qdev = DEVICE(obj); virtio_pci_reset(qdev); @@ -2071,6 +2072,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); device_class_set_props(dc, virtio_pci_properties); k->realize = virtio_pci_realize; @@ -2080,7 +2082,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_OTHERS; device_class_set_parent_realize(dc, virtio_pci_dc_realize, &vpciklass->parent_dc_realize); - dc->reset = virtio_pci_bus_reset; + rc->phases.hold = virtio_pci_bus_reset_hold; } static const TypeInfo virtio_pci_info = {