From patchwork Thu Oct 13 17:19:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 614755 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp368996pvb; Thu, 13 Oct 2022 10:21:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WDtLSOETlobGkxQ4SHfesOb8q0QIzg0YVBxykcYRBTTMFgAeB8m823B0eDMhQEYIH9dM6 X-Received: by 2002:a05:6214:2584:b0:4b1:933c:d86 with SMTP id fq4-20020a056214258400b004b1933c0d86mr860140qvb.41.1665681679832; Thu, 13 Oct 2022 10:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665681679; cv=none; d=google.com; s=arc-20160816; b=lH+ccmoUr5XmZ/rh2zuNovCg5/Fo5FqKply5WlKzgaCBWjRIWbtuxElDezXDtD4WZz XS3D2tYWeuFdSWrT8aLautlPo0KPPTuSCtAkSwqgqxOe3LM9DrjGDG9/jzfNldiPi0ed 0DkxLTjVIRWuEIZtYar8lT8Hp6ucLQRl/2p2eYbUsVCw4/kJM9gY3O+EQ2clz7w7hkgb aXxAxduZshy21lUqC1BdDPc8mbp/XzNOJRypeMREEft9QA4DeN8iGMSxj1uQTV1e2jWA hy1W/GBpVO4hX22Ft+D8OikaL6UwyMuFbT4eS4vSIHojHuBHY4wkq078IVPaoMeZw3bD VF0A== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=pA/r/wR34UCRcAHrPtSKaI1T56yoEpb2xy7U6UnAWQE=; b=K3ufDSJhQKg3GFzkuNAUH/UQKdv2CKGzShtXmEHcw+lkyj3mFOD0jGAbbrpZY1cgTU 6eF1ra0lghijE36ap7YQta/GNPu/1xMZpI/WzPWi8zcRAFsjoyFAr4Oy9aonOKVdOJ4s J8tMfCAcogSVV3jHZW+PIotBi1AcJIk3fle90vHZ8R+PiV5S666guXxaHspU+HTUxutH LxyeFEKCxjqhSfmxVyNEyoVSnp24EzH1FhqpLIT3hpSorEnhk0n2loSM0+b96JklUd6/ /W2J1VBukbn2jm2JT5KnFJXxxdRiFYEJsONM9mZtPg0nPX1+YEGOrURPwdTeuPCHDfaa FVew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lCVEc6Vo; 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 h7-20020a05620a244700b006eeb3abb7afsi174485qkn.4.2022.10.13.10.21.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Oct 2022 10:21:19 -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=lCVEc6Vo; 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]:46760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj1tX-00087Y-Bf for patch@linaro.org; Thu, 13 Oct 2022 13:21:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj1ro-00086S-TX for qemu-devel@nongnu.org; Thu, 13 Oct 2022 13:19:33 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:35674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj1rm-0005kN-03 for qemu-devel@nongnu.org; Thu, 13 Oct 2022 13:19:32 -0400 Received: by mail-wr1-x42a.google.com with SMTP id u10so3894686wrq.2 for ; Thu, 13 Oct 2022 10:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pA/r/wR34UCRcAHrPtSKaI1T56yoEpb2xy7U6UnAWQE=; b=lCVEc6Vo8crY9lEgq5QiBPSGrBjZxoVr6gJr3U+wNvHMXMarw2Qo4xKngUucwWswkb LSBednjh3DP0O1v09QUjif297XvXl1BSBN/LHj5tW///TGcnVHKHd/e3szqkQI00y6ju w0d5uxsTwwDANoHLIQptery9A6QbxLpp/uEJDIE6MQCJP2pGQvhCh3grWh5JQDF45qsD C/vDFxkk4F6zz1ORmXu+Bu7SGrwDA4KgvG1ebzgyJ1gesM2TSk1co2fROp1lZCiET0Uh gB05oHpPr4ePE4/161ZKrKvJSqBqAy5BUT+pH3t/6eGuxW1JOg7hbbRAhX+gji8UA9hK yWPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pA/r/wR34UCRcAHrPtSKaI1T56yoEpb2xy7U6UnAWQE=; b=TFxNLh/fBpm+hZ2tsOmyjT2pn9HBPjfwQSIHVo7fHqjhY0hKY42HeSaEaFOkrd1pj3 IKgewl1PmtP0nAhVld2UEZ48G5MRCqQPHS1f+y5i2C/sO/K2yitHOvG1MningAlnqTgg 8EJ6pGrv+4TffGg5ty3fnQM+mNdcl3SGd6IGrpa6FDN/ventahe1sC/Qp7EtxTYalLBe gIaU09XXjRtqRrY2hvPxWoZyjOscX64jbb1TI2X+PaRmMMneh4of84Sj4CiqgHguR+CB GFAalAcYrNZvIs3PdgbdlV/DLvrjy/2hcJQ6AX8h8SBTmZQZbqgUjjgdEal61oi5hPbs gQjw== X-Gm-Message-State: ACrzQf3IXtfz4X+nwuI17LjUF1esHK6s9Cl+fUz9iy3ZxtDYBfQf1/Bt gPudywBZDcN1jkWK8vXOsHXrOlj6++LxQA== X-Received: by 2002:a5d:504a:0:b0:22e:3edd:3c86 with SMTP id h10-20020a5d504a000000b0022e3edd3c86mr747490wrt.360.1665681568307; Thu, 13 Oct 2022 10:19:28 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id s1-20020adfeb01000000b0022cc3e67fc5sm96617wrn.65.2022.10.13.10.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 10:19:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Sergio Lopez , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH] hw/i386: Use device_cold_reset() to reset the APIC Date: Thu, 13 Oct 2022 18:19:26 +0100 Message-Id: <20221013171926.1447899-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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" 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. The pc_machine_reset() and microvm_machine_reset() functions use device_legacy_reset() to reset the APIC; this is an APICCommonState and does not have any qbuses, so for this purpose the two functions behave identically and we can stop using the deprecated one. Signed-off-by: Peter Maydell Acked-by: Michael S. Tsirkin --- NB: tested only with 'make check' and 'make check-avocado' hw/i386/microvm.c | 2 +- hw/i386/pc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 7fe8cce03e9..0b08010bf0a 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -486,7 +486,7 @@ static void microvm_machine_reset(MachineState *machine) cpu = X86_CPU(cs); if (cpu->apic_state) { - device_legacy_reset(cpu->apic_state); + device_cold_reset(cpu->apic_state); } } } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 566accf7e60..2b2d0bc2b33 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1860,7 +1860,7 @@ static void pc_machine_reset(MachineState *machine) cpu = X86_CPU(cs); if (cpu->apic_state) { - device_legacy_reset(cpu->apic_state); + device_cold_reset(cpu->apic_state); } } }