From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC1E1C07E9B for ; Tue, 20 Jul 2021 14:02:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9FEC6113A for ; Tue, 20 Jul 2021 14:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239604AbhGTNTr (ORCPT ); Tue, 20 Jul 2021 09:19:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239051AbhGTNGg (ORCPT ); Tue, 20 Jul 2021 09:06:36 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B6BC061574; Tue, 20 Jul 2021 06:46:30 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id m20so540082ili.9; Tue, 20 Jul 2021 06:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UqleALOEBIm8KewjJS4m2YoZXF1tGe3ZuXoD4Uil2lI=; b=rB5Lr/SXz6zRIJH22xI0zBsJHqVnUjFHYWbkpc11KHz1U8ifq0vksXkEYQ36mqzCmV U7zBMVdR+uC0kW8XBZUJ8P7dvEgrkskuf5c21Fc2JXlNHGk2CLW629zjqbuhMzEsq5O0 gIQ2yIfB/YICdwemcSeWjZjr8UbrQVfbSfhgYYoO4JEfSb1pKjegxsZSwOHl7yV8YGx5 16Jg0iFQKCZdNnFzrVwB3sEcdiKYuMP+zD2+DP4bym2iMkOFiuoya7lKM02NvwZvUJw+ a+2sZb36y2QzyTZCD7DIeAra2Dcxf0Uxm1BhDTaxQyYdlDuEMPGy7KitGkxbfHMCOaV1 pCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UqleALOEBIm8KewjJS4m2YoZXF1tGe3ZuXoD4Uil2lI=; b=qRyLQ4vqZs4d6jm1QhTi3yE3uWWpRHfEzfmaA4LbgxgR3/DFbThvuzz/ujC9bZzGrn PASxykHZ/LgYKHTU9HXMvlYE4L8EC6K02p6S/g54Lv/h/GAnCZ58gR0ZYa+byayKDRV7 +of7nZLNyr5tT+1zqMapelIGShD48e/mWd0ieHdPwxGQ6m8Ag07kJxeEN73QsSTdvACd 1H0+NBlW7wcReYz18UIBVhGU46hBNJeUntZw2Z2pRSqDhGtYa/a6SDMbXSV+BvCIeklf 1MMgS1rXsC6a6QXuvcMT8+3beuwC7ud1ij/3JpKlJ1T1NkQ6o8nvM8uyzUV6w+INWdvu iBBg== X-Gm-Message-State: AOAM5331PR07emeLa+O3dHeUpOLfotA33eO4nmf6kULmQUlxVOZ1rVc3 yTMtgjwxtXfawoDyJa7/z48= X-Google-Smtp-Source: ABdhPJyIva65aopC9qc9dUyC7XykA+J49f+qwM5h7xk2CouBK89XwULCCFGHAK0hZyzzLw9ht0EBQA== X-Received: by 2002:a92:d4c4:: with SMTP id o4mr19508497ilm.39.1626788790235; Tue, 20 Jul 2021 06:46:30 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id q5sm4292697ilt.75.2021.07.20.06.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 06:46:29 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 79ECD27C0054; Tue, 20 Jul 2021 09:46:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 20 Jul 2021 09:46:28 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcuhfgv nhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtthgvrh hnpeeiueevjeelheduteefveeflefgjeetfeehvdekudekgfegudeghfduhfetveejuden ucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnh hgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jul 2021 09:46:27 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Sunil Muthuswamy , Mike Rapoport Subject: [RFC v5 0/8] PCI: hv: Support host bridge probing on ARM64 Date: Tue, 20 Jul 2021 21:44:21 +0800 Message-Id: <20210720134429.511541-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, Arnd and Marc, This is the v5 for the preparation of virtual PCI support on Hyper-V ARM64, Previous versions: v1: https://lore.kernel.org/lkml/20210319161956.2838291-1-boqun.feng@gmail.com/ v2: https://lore.kernel.org/lkml/20210503144635.2297386-1-boqun.feng@gmail.com/ v3: https://lore.kernel.org/lkml/20210609163211.3467449-1-boqun.feng@gmail.com/ v4: https://lore.kernel.org/lkml/20210714102737.198432-1-boqun.feng@gmail.com/ Changes since last version: * Rebase to 5.14-rc2 * Wording changes (Capitalization and more explanation on why) as suggested by Bjorn. * Split the patch #3 in previous into two patches as suggested by Bjorn. The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is pci_config_window. However, Hyper-V PCI provides a paravirtualized PCI interface, so there is no actual pci_config_window for a PCI host bridge, so no information can be retrieve from the pci_config_window of a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge, which introduces a special case when trying to find the ACPI device from the sysdata (see patch #3). With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development. Comments and suggestions are welcome. Regards, Boqun Arnd Bergmann (1): PCI: hv: Generify PCI probing Boqun Feng (7): PCI: Introduce domain_nr in pci_host_bridge PCI: Support populating MSI domains of root buses via bridges arm64: PCI: Restructure pcibios_root_bridge_prepare() arm64: PCI: Support root bridge preparation for Hyper-V PCI: hv: Set ->domain_nr of pci_host_bridge at probing time PCI: hv: Set up MSI domain at bridge probing time PCI: hv: Turn on the host bridge probing on ARM64 arch/arm64/kernel/pci.c | 29 +++++++--- drivers/pci/controller/pci-hyperv.c | 86 +++++++++++++++++------------ drivers/pci/probe.c | 12 +++- include/linux/pci.h | 10 ++++ 4 files changed, 92 insertions(+), 45 deletions(-) -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F2CFC07E95 for ; Tue, 20 Jul 2021 13:49:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0235361164 for ; Tue, 20 Jul 2021 13:49:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0235361164 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3qLiChOWvmVXKQSzSuTr12CKMHs0XOYzjgJfz6Hg4nU=; b=0drM28JWlUqWV2 TUOKzcPBUbvLo9Xw8cHnSts3FUPOOn8UvBTf4LwdkovRfPxFbtEGALK/A3BlowEwfogP8Ps8V4jG0 LwCxsi1ShmBzm/AM37/pNXDZs3t7zP73TT5zGf16pM3wEAu4sT1F6qOMZ5IJ+fNMm3l+BXj6UltfH K9caKFqHK6ttyBmwnMUM1Zd17QIJBvdXekG3m8MCoXAx/UIc8qmz2/yj6OhnMXXYd8ppOzJqBDIkG twPc0vAAS/Z5Q60QvgB8EF4HWm6i3tHgeO8qenOfh3OA+nrvHT+yMj8ybXY1cjKJW7I7FUTCaneP/ d29GqHejXJnh2ThJQMvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5q4x-00CzLT-H3; Tue, 20 Jul 2021 13:46:35 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5q4t-00CzKG-K9 for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 13:46:33 +0000 Received: by mail-il1-x136.google.com with SMTP id w1so19139754ilg.10 for ; Tue, 20 Jul 2021 06:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UqleALOEBIm8KewjJS4m2YoZXF1tGe3ZuXoD4Uil2lI=; b=rB5Lr/SXz6zRIJH22xI0zBsJHqVnUjFHYWbkpc11KHz1U8ifq0vksXkEYQ36mqzCmV U7zBMVdR+uC0kW8XBZUJ8P7dvEgrkskuf5c21Fc2JXlNHGk2CLW629zjqbuhMzEsq5O0 gIQ2yIfB/YICdwemcSeWjZjr8UbrQVfbSfhgYYoO4JEfSb1pKjegxsZSwOHl7yV8YGx5 16Jg0iFQKCZdNnFzrVwB3sEcdiKYuMP+zD2+DP4bym2iMkOFiuoya7lKM02NvwZvUJw+ a+2sZb36y2QzyTZCD7DIeAra2Dcxf0Uxm1BhDTaxQyYdlDuEMPGy7KitGkxbfHMCOaV1 pCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UqleALOEBIm8KewjJS4m2YoZXF1tGe3ZuXoD4Uil2lI=; b=RZ1TY1TAt3QD+xVy5JHcwv3MNKXU3TbccrGLBmKyFY41kJRqqsi8MsZNVqixT42CQz oreBzbQBNGdVpP6ATOx69XZbYN3BMA+4+zdd+1C0+5WJizYDTLfTh73PIggwT3+I+xDn QmAzhZ4O/suWAw3CkKq/JKSA1ruNQ6QlvmceOMSxa6XeJCH2ttnmBMsoV06G+XpvLip4 W0ry5SjT3Hp1yL88OIdxIStggA4V6NBbO16lUm6LVgOvlzX0AiYEhUkA7ywyTHvX+uMj Q+AtxTe9/9OBGsh6OlRTJgHM3OYw08OOZkDBPXd0cwnYxILCRIw9RI21hCdtCCPW5V5X 6GYw== X-Gm-Message-State: AOAM533SEyDyv8QfSBdkm6jjlxUwoAkq1siC5YseRSnq5/bI5IXhgXKa zC7cxqpG/TmDcQQW54g4pXxWDM1WhrxSLw== X-Google-Smtp-Source: ABdhPJyIva65aopC9qc9dUyC7XykA+J49f+qwM5h7xk2CouBK89XwULCCFGHAK0hZyzzLw9ht0EBQA== X-Received: by 2002:a92:d4c4:: with SMTP id o4mr19508497ilm.39.1626788790235; Tue, 20 Jul 2021 06:46:30 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id q5sm4292697ilt.75.2021.07.20.06.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 06:46:29 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 79ECD27C0054; Tue, 20 Jul 2021 09:46:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 20 Jul 2021 09:46:28 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcuhfgv nhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtthgvrh hnpeeiueevjeelheduteefveeflefgjeetfeehvdekudekgfegudeghfduhfetveejuden ucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnh hgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jul 2021 09:46:27 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Sunil Muthuswamy , Mike Rapoport Subject: [RFC v5 0/8] PCI: hv: Support host bridge probing on ARM64 Date: Tue, 20 Jul 2021 21:44:21 +0800 Message-Id: <20210720134429.511541-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_064631_710761_B4949750 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Bjorn, Arnd and Marc, This is the v5 for the preparation of virtual PCI support on Hyper-V ARM64, Previous versions: v1: https://lore.kernel.org/lkml/20210319161956.2838291-1-boqun.feng@gmail.com/ v2: https://lore.kernel.org/lkml/20210503144635.2297386-1-boqun.feng@gmail.com/ v3: https://lore.kernel.org/lkml/20210609163211.3467449-1-boqun.feng@gmail.com/ v4: https://lore.kernel.org/lkml/20210714102737.198432-1-boqun.feng@gmail.com/ Changes since last version: * Rebase to 5.14-rc2 * Wording changes (Capitalization and more explanation on why) as suggested by Bjorn. * Split the patch #3 in previous into two patches as suggested by Bjorn. The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is pci_config_window. However, Hyper-V PCI provides a paravirtualized PCI interface, so there is no actual pci_config_window for a PCI host bridge, so no information can be retrieve from the pci_config_window of a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge, which introduces a special case when trying to find the ACPI device from the sysdata (see patch #3). With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development. Comments and suggestions are welcome. Regards, Boqun Arnd Bergmann (1): PCI: hv: Generify PCI probing Boqun Feng (7): PCI: Introduce domain_nr in pci_host_bridge PCI: Support populating MSI domains of root buses via bridges arm64: PCI: Restructure pcibios_root_bridge_prepare() arm64: PCI: Support root bridge preparation for Hyper-V PCI: hv: Set ->domain_nr of pci_host_bridge at probing time PCI: hv: Set up MSI domain at bridge probing time PCI: hv: Turn on the host bridge probing on ARM64 arch/arm64/kernel/pci.c | 29 +++++++--- drivers/pci/controller/pci-hyperv.c | 86 +++++++++++++++++------------ drivers/pci/probe.c | 12 +++- include/linux/pci.h | 10 ++++ 4 files changed, 92 insertions(+), 45 deletions(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel