From patchwork Fri Mar 19 16:19:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12151393 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 194F9C433DB for ; Fri, 19 Mar 2021 16:22:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7B89061963 for ; Fri, 19 Mar 2021 16:22:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B89061963 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=desiato.20200630; 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=adaDCu+ehMlje0U8SUcrivRKk55/iDcUsUP44C0kpfY=; b=cIugM4YH0Kl1L777bxDD0m2AUG 3See/dfLc/ZW/LyHDmmvjFT5GY1IEgAGeSsOqBKoPGMztItTAqIt/068Y8XT2IBPZeu7N8TnC3hIE 5wOkdeRVIjXBxhHfekxGjJstw0Jprxdzr2Z3gSe5El5kH2U0hJbOTVdAwmfZurlZAap/rBUEKF5Lo OEzQt9sK2qH6Y226CZm1YQRqXjSShJ8asxM1UyiDwLE2/hz5+5F4w7Lac8wABTKnbisVnahAxwACd Q5yDtqW2DQuJqq1J97/kei+xCPdirUwlXIRmGEeHAdEAb9WBLe8YDN/4gdGTOqdELLig3g4boLnJX dwNfGX4w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHry-007h6y-8a; Fri, 19 Mar 2021 16:21:03 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHrV-007gws-1s for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 16:20:36 +0000 Received: by mail-qk1-x72b.google.com with SMTP id y18so3436040qky.11 for ; Fri, 19 Mar 2021 09:20:31 -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=YTqkIslzd3cZ3YjBiwLXA1sHZhbzdhxR9PRY9kOersA=; b=XEj7xRWm32bCF4yjMzjwpA6QUw4nqoK//unFI76siTlkarCqwbUdgOu+9sRIGeIaFR CpBJPZojis5xSZjzRVswDmA+bmsff91MSDWioPQU0OAiC4Z+di46w3deJDjzganWXNTb /cITW1gUvdJQPwqXzNfQbtDB6G0E6Kf26TGuoMxZPnKnTGVibnM8yZ53dFrryqTINTcS /Huin2H9VArXjOF1pMhLqdMcS+ydze50OT0CHq/7V5e34Z5/+hFWye8Su57wM+9GwqmU veCUyEDOW2G/L0iPZF22+EZdem8PNA7GUgY9LJmyylGO4bI5ba820jBQIHqjefDbdTC8 dwuw== 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=YTqkIslzd3cZ3YjBiwLXA1sHZhbzdhxR9PRY9kOersA=; b=U10hKJD6wirz/86jKUiFLCGu7MwbgmIZVyqkEt0mcQgBpIYcMQkbgWgbzjMxV15kHU tRjkUUkDkoarB7+UORx4VGisHl4uHJ2yzWd98IgQGrWNrviIPF8Nj6BEsvQnqGF+1iDK zgv5E2kBrmA0UwHlTw5F/5QDqtWOXFfltXdHkOo2gSwe2cznR8osDBplpVAMTtZ3YeWf wLWOWlQ5OLYbiu22D3+3g6U5PLItpF8DottgN+5SHwsZ9gMhQl42T1nw0fi0jhEsJdrk StkWTxEp/kgE9Lj5sFEzS2X+FNq6+atCLpMF9JQBj7zHMrqkVlvstJ3NqOJmuVA9bfru j11g== X-Gm-Message-State: AOAM533tdt6Wj6m9K/0cfPO58PhOzwB0X8ECkNyZWkgrj7uSIlBFGp5x uVvcfk3L/P+j4aM6Na0zPag= X-Google-Smtp-Source: ABdhPJwOQCi4eHUF3JKAOaJ7+W1gOiAy5rQZqz7Rbbbu3aBu7rigEKpd0Od6PXSPRjxdLrQWaD6gZw== X-Received: by 2002:a37:9c51:: with SMTP id f78mr9994953qke.228.1616170829706; Fri, 19 Mar 2021 09:20:29 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id p1sm4781938qkj.73.2021.03.19.09.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:20:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 11D1D27C0060; Fri, 19 Mar 2021 12:20:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 19 Mar 2021 12:20:28 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeeuohhquhhnucfh vghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrthhtvg hrnhepieejhfelvddtgeduhfffueegteevleeugfekvefhueduuedugfevvefhtedvuedv necukfhppedufedurddutdejrddurddvheegnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnh hgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: from localhost (unknown [131.107.1.254]) by mail.messagingengine.com (Postfix) with ESMTPA id 8F1E124005B; Fri, 19 Mar 2021 12:20:26 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Lorenzo Pieralisi , Rob Herring , Clint Sbisa , Boqun Feng , Ard Biesheuvel , Sunil Muthuswamy Subject: [RFC 0/2] PCI: Introduce pci_ops::use_arch_sysdata Date: Sat, 20 Mar 2021 00:19:54 +0800 Message-Id: <20210319161956.2838291-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-20210319_162033_306954_AF721E8D X-CRM114-Status: GOOD ( 11.89 ) 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, I'm currently working on virtual PCI support for Hyper-V ARM64 guests. Similar to virtual PCI on x86 Hyper-V guests, the PCI root bus is not probed via ACPI (or of), it's probed from Hyper-V VMbus, therefore it doesn't have config window. Since ARM64 is a CONFIG_PCI_DOMAINS_GENERIC=y, PCI core code always treats as the root bus has a config window. So we need to resolve this and want to reuse the code as much as possible. My current solution is introducing a pci_ops::use_arch_sysdata, and if it's true, the PCI core code treats the pci_bus::sysdata as an arch-specific sysdata (rather than pci_config_window) for CONFIG_PCI_DOMAINS_GENERIC=y architectures. This allows us to reuse the existing code for Hyper-V PCI controller. This is simply a proposal, I'm open to any suggestion. Thanks! Regards, Boqun Boqun Feng (2): arm64: PCI: Allow use arch-specific pci sysdata PCI: hv: Tell PCI core arch-specific sysdata is used arch/arm64/include/asm/pci.h | 29 +++++++++++++++++++++++++++++ arch/arm64/kernel/pci.c | 15 ++++++++++++--- drivers/pci/controller/pci-hyperv.c | 3 +++ include/linux/pci.h | 3 +++ 4 files changed, 47 insertions(+), 3 deletions(-)