From patchwork Wed Jul 14 10:27:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12376643 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 C6BCEC07E9A for ; Wed, 14 Jul 2021 10:32:22 +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 8EFFB6024A for ; Wed, 14 Jul 2021 10:32:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EFFB6024A 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=6rFT+4sWueU/CG346ZmJtvevOTzcEDmswtNMu6n3eH0=; b=3BJLX4ZiULq9MC TdwIkP+F+wT3CJ4gF3hEeJiPx8FRDaZDJeX9n7fOsPfiImjfP8EDlYpcQrYWwHi+CCqmqs/1PFq9F MwtRH8wibiy3oqmwu2xR4RMNF76wP5v+tHOqzWaYoPlrR/XbmdLhqGHNQH1rxXOxA3LqDoTC+iNpO 1P1pXUNwjT+4HlC2fFVBnXkASC3V5DkeQzSsZDst0pMnRiIf4sqt5HNVD8n/gAMTKLx2e+OKJseQN bsf9uAshGdydKe07ohWj/3Up9KkYz4JbEg2fMx+BPMHzKMS5QCqnHnGpVoEzAGS8OjcfGc1EE4Fw9 k7q5psLg2Ww6f0HcaXug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c96-00D8sD-Ug; Wed, 14 Jul 2021 10:29:41 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c8x-00D8nc-13 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 10:29:36 +0000 Received: by mail-qk1-x731.google.com with SMTP id z9so1054741qkg.5 for ; Wed, 14 Jul 2021 03:29:29 -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=gX+DylQFl+b5aUUhEFVAqofxq/SEoe+L/4Ef9sTaObs=; b=Q+oIjxWan9rWu2vHb/qP/x9du4L5QsWJ9jpepPvnbmM+3WNvgKn4Ibm7zwwYFOJ7fk 0NwyVaPd3q7Ap0OdhZzQOjqNfW9jUWppfeXmSUZWhgAN0Ql41A+a6Hd9ofJ5RCXgSXNs hoNonFwnuyAR567DDdQDdm/vezNuamvzzNS7YkIIOKONwpwA2RS8FU4e0pBc/gRMPbfS L9gBWtnQ9n5So9k08u6Aa8oSUmjpma7G5jb1ySKyQcw/yk10z/BEpHvaIeZtkG6nysvF nZ46Qwg/5wwU5G9lxT2kSE46q9KTktkgFWxaeDod9zo8erkv8ByCrmT22v3wXqvVfEgX nukA== 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=gX+DylQFl+b5aUUhEFVAqofxq/SEoe+L/4Ef9sTaObs=; b=mbvLouxHpFy+BuxJdK8ptzKBS1MGUals5MtwL0T7kOcJ0XQ9g6PsAghe4XcOTa/d/K oJFsvgNY5MGuFOwc53LO9nBig/ZZsV3ADbPdF3mPzfhM2oS0LdxNP7UMsvSZJpseu94X j3yx/7TrqWG1a1B//bDWtnNuongpo9QIAGQxgoo1bYNaZkzUAH9Y1WUeTc85ovXgrN0u 2oZLt/epuscIvqHuFTJOh0Naq41aT3D+pY3RlcV7wqFqBRvCPs2iWHdKmUhzqeYy0TSR sfgbyNYRjC+B76WE2Ax7Wn4OY8nWnO046GBQ+/wYVl1wXxIZNuQa/RiBnC1u+XB16qbO hJDQ== X-Gm-Message-State: AOAM530xLP++1BNX5ilz9MPAxAL7xWkql/dLJYsI7rJyMNJXgtdUVeOj Lxxwu/p1eJ9jIfVF0iKMC24= X-Google-Smtp-Source: ABdhPJzoXMzoj4ECc+ahSyiMClRxrusvrrEi+GiSacx8hbeCnlSRQIvBzrJmLLC5yNLTtMDOAUHl6w== X-Received: by 2002:a37:ac14:: with SMTP id e20mr9317563qkm.362.1626258569161; Wed, 14 Jul 2021 03:29:29 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id f19sm836967qkg.70.2021.07.14.03.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:29:28 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id D94AF27C0054; Wed, 14 Jul 2021 06:29:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 14 Jul 2021 06:29:27 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcuhfgv nhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtthgvrh hnpeeiueevjeelheduteefveeflefgjeetfeehvdekudekgfegudeghfduhfetveejuden ucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnh hgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 06:29:26 -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_Wilczy=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 v4 0/7] PCI: hv: Support host bridge probing on ARM64 Date: Wed, 14 Jul 2021 18:27:30 +0800 Message-Id: <20210714102737.198432-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-20210714_032931_166065_BB217727 X-CRM114-Status: GOOD ( 13.11 ) 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: , 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 v4 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/ Changes since last version: * Rebase to 5.14-rc1. * Change the ordering of patches, now the first three patches are non Hyper-V specific ones (i.e. patches touch general code), make it convenient to review. 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 (6): PCI: Introduce domain_nr in pci_host_bridge PCI: Allow msi domain set-up at host probing time arm64: PCI: Support root bridge preparation for Hyper-V PCI PCI: hv: Use pci_host_bridge::domain_nr for PCI domain 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 | 8 ++- drivers/pci/controller/pci-hyperv.c | 86 +++++++++++++++++------------ drivers/pci/probe.c | 11 +++- include/linux/pci.h | 10 ++++ 4 files changed, 76 insertions(+), 39 deletions(-)