Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp995363imi; Fri, 22 Jul 2022 14:32:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCdRjyPcJS4Ns8AXZj2lUpC69JV3hKsYh5K+5k5NnnWYFrG2N6ixrUhb0jtFnln6B9JUxy X-Received: by 2002:a63:5456:0:b0:419:fdbe:11af with SMTP id e22-20020a635456000000b00419fdbe11afmr1464314pgm.151.1658525564507; Fri, 22 Jul 2022 14:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658525564; cv=none; d=google.com; s=arc-20160816; b=s0HHK5jTn1z8xdF3MHk9/yG68XNIpew76Zpf2pRpdtTsjJjfbssspuF/G/5V9rBfyY 8YJ7QDpwETqBnUI5P0nsipVP2Joui1pRwRQYY6rGU1E3+2TysJURayz7j9yI4KtP4Zy8 Au4Ya8emFN1yEGsYNBvWJCxIF9oMUpj6NZKwz/dnK+AeOp/dbtTJaCOH/PLwqom65ITK fKw7I66Cg2KzmZk2AlE+iWswGifcWgsGMvax3MdJ88p6G7HgUOiNEs/R/OqnlH7Xs2nI R6u9zKOF7C5uiMkZnm4xh4b8lfgY7krxW5GvpItgOJnFz9RPe29e8OSzzM+yTgkMwRCo l/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=blMo8vhjx/Gt3eo+/r7It2pxG23gkltHrTSNS924Owk=; b=rYuQExCVy82C2cyP4CxKh0ZiHkW28rnUpPi6Zu600EI208wNz+sc4Sft3qr804MLC9 ++ypWdps+cX7sHZ7kE4ekmyn7skk4TW82HyRdn6zanujy1omimpXsdWYhn7Wr8PaFSoB PQ3B0DMaASgQVj4tKMVPJ3/8PxBiqd4BHVNNQv5KWm50h6pnPvM5qizhBVSriaTuX5jL WvS0gC/alWLKYJaPu93XXb7629fPx8DXAhw0faVs9N8Cvre3xEXiijxYkncCfIwKq7s4 Zblb0HyBG2vK5tre/Tds7CIl8R/7eA7sn/ja4hVEiOe2fZwYHt9UBgS/Qh6EBZgBSgLL TJNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7h7pC3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a17090a74c600b001ec9e142438si10330520pjl.177.2022.07.22.14.32.26; Fri, 22 Jul 2022 14:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7h7pC3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235739AbiGVVNg (ORCPT + 99 others); Fri, 22 Jul 2022 17:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiGVVNe (ORCPT ); Fri, 22 Jul 2022 17:13:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECA9B504E; Fri, 22 Jul 2022 14:13:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC061B82B1C; Fri, 22 Jul 2022 21:13:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46E77C341C7; Fri, 22 Jul 2022 21:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658524411; bh=Msfql5pg85Ax6GZuIhAfLpJ9yluJf279FymZfm9pLYE=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=a7h7pC3Q21q8A7UeiC8kGfMcTAWnUU42P7avg0TJkl6C/w+lszyRY4z/9g7JVv2o4 hU2iqB4gdzpt9e9Q/gAJO+QRRxSfpi+YYEaism01NVZ6KJQ34JILv1/i0tvWbdCNS5 qWUZlXbHN6sXLsWMHoVONhMTMJ4Pri/TVwKhXF0x4gwjadGlgHQeAkYEG3kzOXZ4mp qsUxETQWSLZeV6hWgi53OON/6sA4DRqVRwuvdjqBKBgnT+Lt5mBjWbAJuvcAH9KG+u Q77Oeuhs6TYhlhwIS2JqioBcfHLEJqD+GB32KlDHQsf7J5Tb1QXrEUtEWFxnD1MbP8 lp+SbYYzoWE9w== Date: Fri, 22 Jul 2022 16:13:29 -0500 From: Bjorn Helgaas To: Niklas Schnelle Cc: Bjorn Helgaas , Jan Kiszka , Matthew Rosato , Pierre Morel , linux-s390@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 4/5] PCI: Extend isolated function probing to s390 Message-ID: <20220722211329.GA1935284@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220628143100.3228092-5-schnelle@linux.ibm.com> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 28, 2022 at 04:30:59PM +0200, Niklas Schnelle wrote: > Like the jailhouse hypervisor s390's PCI architecture allows passing > isolated PCI functions to an OS instance. As of now this is was not > utilized even with multi-function support as the s390 PCI code makes > sure that only virtual PCI busses including a function with devfn 0 are > presented to the PCI subsystem. A subsequent change will remove this > restriction. > > Allow probing such functions by replacing the existing check for > jailhouse_paravirt() with a new hypervisor_isolated_pci_functions() > helper. > > Cc: Jan Kiszka > Signed-off-by: Niklas Schnelle > --- > drivers/pci/probe.c | 2 +- > include/linux/hypervisor.h | 8 ++++++++ > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index a18e07e6a7df..156dd13594b8 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -2667,7 +2667,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn) > * a hypervisor which passes through individual PCI > * functions. > */ > - if (!jailhouse_paravirt()) > + if (!hypervisor_isolated_pci_functions()) > break; > } > fn = next_fn(bus, dev, fn); > diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h > index fc08b433c856..33b1c0482aac 100644 > --- a/include/linux/hypervisor.h > +++ b/include/linux/hypervisor.h > @@ -32,4 +32,12 @@ static inline bool jailhouse_paravirt(void) > > #endif /* !CONFIG_X86 */ > > +static inline bool hypervisor_isolated_pci_functions(void) > +{ > + if (IS_ENABLED(CONFIG_S390)) > + return true; > + else > + return jailhouse_paravirt(); It looks kind of wasteful that jailhouse_paravirt() searches the DT for "jailhouse,cell" several times when I think that's an unchanging property. Obviously you didn't add that in this series, and s390 avoids that cost anyway. But the jailhouse folks might consider optimizing it somehow. > +} > + > #endif /* __LINUX_HYPEVISOR_H */ > -- > 2.32.0 >