From patchwork Fri Nov 4 16:15:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621370 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp358599pvb; Fri, 4 Nov 2022 09:16:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wM5/pW/r86/CYYWBIhBl59ivfXlAIb/FpR0M8jY2eF67eUkUvok9Iqpq9tmRxscSJy9Uo X-Received: by 2002:a05:620a:9d5:b0:6fa:d03:aa03 with SMTP id y21-20020a05620a09d500b006fa0d03aa03mr26318025qky.453.1667578577567; Fri, 04 Nov 2022 09:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578577; cv=none; d=google.com; s=arc-20160816; b=X0cIyBdt95usRT8g0mHUYMhyKjWzmjMtWnWEUHAIX+K5VApcyW59uHpocplMjwRGWQ MA3AjZPYtMGO0Kl0rW5N3k8o1vL1Vq/U3yiCOdhcaVx6wnuEpPjETfJxkn0K0M0edTCM hVI0TJtdob1wdHRUKCAeG/HKeL9UIyd5aYIMWtFW0K+GS8WLq//k7TtCNmUrLaZEau7l rYD4Uhe7vmqXeqoDlfDCkX/qlXRJTflxVlP1C1CZhSlgapKtoArh2CsPFjpyfaXYC3cW sBHeaB9CiLW5TzvB1wTaXTnHKREpLONZy1CMtC6rbckoS6aSgNmu5OnXYCjUxIHf77qx J2Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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:cc:to :from:dkim-signature; bh=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=FLP/02Livjq/G9rLd1M5Io0omllbOV/dfshBpH4eB92vJ/qRiSQCafaVDC1nJLUlg/ /DC9dSaNaUCdEmtH5YKkLVRQLD0Y0CiBdzDWSqLNecK1tSHhXGHEswpYx1t7nILgBUjQ 90WIOk0zK5A2+PnagAPnuH4qMyyqUGHX6otus8mHebdNQESb8ZzQkYwSuxr+2zlXkwDl /otQU02DLFEi1mfcDt8vDgXtJXSW7vlF6Q/Xjvn1z8WO7x5bG/RJ3Dq92QHhEP0wDAxn O7d/ejJaK0OMv2ixRJluJFXUCKnJcmALVRsnv4foizfhQ6x6KSqAoaVBsBeJd2+/zlUC Dfmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6AiWZfG; 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 ke24-20020a056214301800b004af9a0d2479si2749814qvb.6.2022.11.04.09.16.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:16:17 -0700 (PDT) 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=f6AiWZfG; 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 1oqzMF-00076s-GJ; Fri, 04 Nov 2022 12:15:52 -0400 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 1oqzLx-0006Ua-11 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:38 -0400 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 1oqzLq-0000h9-9U for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:32 -0400 Received: by mail-wm1-x32f.google.com with SMTP id m7-20020a05600c090700b003cf8a105d9eso3469809wmp.5 for ; Fri, 04 Nov 2022 09:15:25 -0700 (PDT) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=f6AiWZfGjfV7sC62uy+i3tQqAbE4yiuhdFonGVNorS5TVGNgIIjrjdeqPGgHBir6CB Bcgq+RmD7nxhEsel5mayWoLui9skUdvI7bjhr841x2U0v/JH7gPcjb1CxoM/e7gT3DPc 7Sxw68q9KUIHJW4jFKEzAM6dY8+/e+ZsVX7vXDCQxz9xeCitA6FJS+SvG/K+UfwHw+yw nWGNyFk+Gnn3WudySZLvh72YXeZm0k/xcZnKrbIEN6spFwZEEHwXLH2sNUUkwTzj0nGk OXDM5+KnpBcRpjmNW73tFhAwMrUWBPIjFro1fHorsUIOkkUBzR/HSjp/laLcGZRk3sSN LnkA== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=sOMS0/4Pb6sQ+4Mb/steNFhFt9I9qcijmTWUUEoEEetnCVDcWi0QZyFZcl/VvAl+V6 yaApZmvGqyWLsN5Y46+CnRvQrpYxIJ4MJlvar60IjyIC8a6jnVKjlJC7LsIl783fMD4S cZZn7NaY1VPlpPcxcUoJa1jq96mr+KpMRbl0kwlbSioebXs0FH6n3NVPs9baC2pW7OMc 70jinehyskBRvhxwDO3y4+72mm4zEioXN3NYPrxN8cr2sJ20Em4z6ZzaD3HiXLNqb8Uy f4aohLlj2rae8/WdfYtjvt0b27ME+15PKUWuXv/6y4qV2sLcpPR/3j921jWPvwZNm9hq o3Bg== X-Gm-Message-State: ACrzQf1kqcQ7QJQH10/h8txU4jdkGluS3E3wEI1sxQIidK4Ysk9nxnUd ZQFH8kssHWpSTOqVDlqGYOQYk6qMVChUwQ== X-Received: by 2002:a7b:c009:0:b0:3cf:6b95:73c8 with SMTP id c9-20020a7bc009000000b003cf6b9573c8mr21109806wmb.121.1667578524612; Fri, 04 Nov 2022 09:15:24 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:24 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 6/9] hw/hyperv/vmbus: Use device_cold_reset() and bus_cold_reset() Date: Fri, 4 Nov 2022 16:15:10 +0000 Message-Id: <20221104161513.2455862-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Reviewed-by: Maciej S. Szmigiero Reviewed-by: Philippe Mathieu-Daudé --- 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 30bc04e1c4c..f345f310b0f 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -1578,7 +1578,7 @@ static bool vmbus_initialized(VMBus *vmbus) static void vmbus_reset_all(VMBus *vmbus) { - qbus_reset_all(BUS(vmbus)); + bus_cold_reset(BUS(vmbus)); } static void post_msg(VMBus *vmbus, void *msgdata, uint32_t msglen) @@ -2035,7 +2035,7 @@ static void vdev_reset_on_close(VMBusDevice *vdev) } /* all channels closed -- reset device */ - qdev_reset_all(DEVICE(vdev)); + device_cold_reset(DEVICE(vdev)); } static void handle_close_channel(VMBus *vmbus, vmbus_message_close_channel *msg,