From patchwork Thu Sep 16 13:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 1528842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=anisinha-ca.20210112.gappssmtp.com header.i=@anisinha-ca.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=GnqwDdqL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H9J5P0HSfz9t1C for ; Thu, 16 Sep 2021 23:36:25 +1000 (AEST) Received: from localhost ([::1]:42802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQrYs-0003hq-PR for incoming@patchwork.ozlabs.org; Thu, 16 Sep 2021 09:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQrS0-00058j-C7 for qemu-devel@nongnu.org; Thu, 16 Sep 2021 09:29:16 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:40476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQrRy-0007fR-Jg for qemu-devel@nongnu.org; Thu, 16 Sep 2021 09:29:16 -0400 Received: by mail-pf1-x431.google.com with SMTP id y8so5865980pfa.7 for ; Thu, 16 Sep 2021 06:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+iszYVUB0DKqhl5sOh/2W/mwXnntZoka/E6VSQbFFN0=; b=GnqwDdqLHOnH0ttjLSRHLqWS5hNXf/HDh7UDdV6Fdxcy0jTFnFHNvfX62Tp+haJzbM ZfzZJg1iaLodQXENQCeTNb3PYNG3P7B+tTDp3/rWKlhivapAdxmqLUm7k4MZ+NPtMwu7 28GcBM01m7asZ6o+O/VY2ectc7nqV5nvvmkI6I543ScJH2uULdfhnEaojGs7I6b8EJvL 2dujiaN2D56DOPo6UvKED+edOAW55xnhw24stUMw4J0ANJV41CMBwSkg2N9oqvdYolxB STawYpXkinviZlLVjQC+KyvfmNUuy2B1r6Lm4A2L57wrJKIxJfProKtNKjeqk5HqMSLw LFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+iszYVUB0DKqhl5sOh/2W/mwXnntZoka/E6VSQbFFN0=; b=cUSnoPs6FLuSnW5QvYRP/l9whQWNIqiIaTTf1HPLRhTqPbSkQ2CfVYuZpOrSzIHSvy bwNZh8ILTqdBgvU0ljS3j3jrIXOlMOBM3saIkpr6FneDoMqpl4BOsmw2VGgWAzalYYjU cQjnRF55hLjWsa0bKmblL+2v3KSxd8j2Kgovwow9hK2zLZ8J1nBM47UGkaAEHTbufYlr MvrGkAYGiL6CNRdBqCLEPUGncOCDrROsMVqlGquigVvFSbaezrmqDTzZIbguGC7tNxIm 4Se8euxgg4PIECHI3XzBras0Rzu8UNqVHRaqBisaQef3lQCDYD3I+OcrKxzZgVqkrlGI p9og== X-Gm-Message-State: AOAM5318YMPL1IaCBmChh3RGPBJe3g7Aiup4c+Iz852FVQtUH8yHuadV DZ6otUOa1a8k39r2CgD0eR9H5T1kQTgObQ== X-Google-Smtp-Source: ABdhPJxrIfm8cQjNiUv6tN8+6bn2TntVjCKVTfW4HZTTuoFDwykxaoOgiAAIrAe32JGVm9jLA3N6Cg== X-Received: by 2002:a62:7f48:0:b0:43e:7d:a4b1 with SMTP id a69-20020a627f48000000b0043e007da4b1mr5094602pfd.16.1631798952904; Thu, 16 Sep 2021 06:29:12 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([203.163.233.134]) by smtp.googlemail.com with ESMTPSA id w67sm3458272pfb.99.2021.09.16.06.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 06:29:12 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, qemu-stable@nongnu.org Subject: [PATCH v2 2/3] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35 Date: Thu, 16 Sep 2021 18:58:37 +0530 Message-Id: <20210916132838.3469580-3-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210916132838.3469580-1-ani@anisinha.ca> References: <20210916132838.3469580-1-ani@anisinha.ca> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::431; envelope-from=ani@anisinha.ca; helo=mail-pf1-x431.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S. Tsirkin" , jusual@redhat.com, Ani Sinha , Igor Mammedov , philmd@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35") selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was written but the final version of the patch was not yet pushed upstream, this address range was free and did not conflict with any other IO address ranges. However, with the following change, this address range was no longer conflict free as in this change, the IO address range (value of ACPI_PCIHP_SIZE) was incremented by four bytes: b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device") This can be seen from the output of QMP command 'info mtree' : 0000000000000600-0000000000000603 (prio 0, i/o): acpi-evt 0000000000000604-0000000000000605 (prio 0, i/o): acpi-cnt 0000000000000608-000000000000060b (prio 0, i/o): acpi-tmr 0000000000000620-000000000000062f (prio 0, i/o): acpi-gpe0 0000000000000630-0000000000000637 (prio 0, i/o): acpi-smi 0000000000000cc4-0000000000000cdb (prio 0, i/o): acpi-pci-hotplug 0000000000000cd8-0000000000000ce3 (prio 0, i/o): acpi-cpu-hotplug It shows that there is a region of conflict between IO regions of acpi pci hotplug and acpi cpu hotplug. Unfortunately, the change caf108bc58790 did not update the IO address range appropriately before it was pushed upstream to accommodate the increased length of the IO address space introduced in change b32bd763a1ca92. Due to this bug, windows guests complain 'This device cannot find enough free resources it can use' in the device manager panel for extended IO buses. This issue also breaks the correct functioning of pci hotplug as the following shows that the IO space for pci hotplug has been truncated: (qemu) info mtree -f FlatView #0 AS "I/O", root: io Root memory region: io 0000000000000cc4-0000000000000cd7 (prio 0, i/o): acpi-pci-hotplug 0000000000000cd8-0000000000000cf7 (prio 0, i/o): acpi-cpu-hotplug Therefore, in this fix, we adjust the IO address range for the acpi pci hotplug so that it does not conflict with cpu hotplug and there is no truncation of IO spaces. The starting IO address of PCI hotplug region has been decremented by four bytes in order to accommodate four byte increment in the IO address space introduced by change b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device") After fixing, the following are the corrected IO ranges: 0000000000000600-0000000000000603 (prio 0, i/o): acpi-evt 0000000000000604-0000000000000605 (prio 0, i/o): acpi-cnt 0000000000000608-000000000000060b (prio 0, i/o): acpi-tmr 0000000000000620-000000000000062f (prio 0, i/o): acpi-gpe0 0000000000000630-0000000000000637 (prio 0, i/o): acpi-smi 0000000000000cc0-0000000000000cd7 (prio 0, i/o): acpi-pci-hotplug 0000000000000cd8-0000000000000ce3 (prio 0, i/o): acpi-cpu-hotplug This change has been tested using a Windows Server 2019 guest VM. Windows no longer complains after this change. Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561 Signed-off-by: Ani Sinha Reviewed-by: Igor Mammedov Reviewed-by: Julia Suvorova --- include/hw/acpi/ich9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index a329ce43ab..f04f1791bd 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -29,7 +29,7 @@ #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/tco.h" -#define ACPI_PCIHP_ADDR_ICH9 0x0cc4 +#define ACPI_PCIHP_ADDR_ICH9 0x0cc0 typedef struct ICH9LPCPMRegs { /*