Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4719289iob; Sun, 8 May 2022 23:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuGiHafLzKn3OJ4SENCV2uWQE4eRiDt2+n9R99U473HJykWqUN41Pn5OS5MREzuODTrmrK X-Received: by 2002:a63:5949:0:b0:3ab:77b8:24a5 with SMTP id j9-20020a635949000000b003ab77b824a5mr12132188pgm.545.1652076570017; Sun, 08 May 2022 23:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652076570; cv=none; d=google.com; s=arc-20160816; b=pnI3tHic+q2kOb1RBkMYZfQQRqviWQ/LIiBMZIII2TJx9DCtbrO/N33doat5D5vG45 mEAbpx/vKkd3NorBF8XtYL28tPfAMJBtP0wf5xBCvaoTrcaZrlcOMpo1wqnWuGgSdeUi I7hj0sf9/BrQmToJWPHMGkaJy1LLHgdfQueYdkZ8QIlVSARkIt+KrKoPeKyfQHgo7O6w bcCQLYUbwSf9OYyAFwkOCpZ1hrkw1fRD+TF1k/rsaK9nxxNFV9BCAXmRSU6vNKOCZ3mF hWhMi0sIwW592h8xxbev5xVHa+4pRGV3Z2gXpqRlCdXP5V7u/6XxgJyAN8MCjIQIi/aq 3zKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M1zvcLMG92FcPS3g1DuhwhZILf+zrGpIaNaaLno10YU=; b=svUKg5M/lPuTaPyxYaBOkE1pfKrnEeqaLW5nAPzX8o5TtVcuGFGNf/l/0iUpYUAvKu GaW3riOEFKvKevJU+1eLu3WYvkFVTYQmN1A4BjaGIzLiyNvwz2dS9g2ScuF9ezDcb+ex 5H4PrIvAT++U7lpS4eq4E2e5j4t4bLdHmGzCM/3w9icXpgcv/wDGCe21/bVBGRIOv8SC 594Xs273a1CqNvuUgXaSakJHAEILZ5FHAJKr8sS7LB3HeeFKwLYM0bTC3M35INwurutP yTQ0U+kqeMh1VMHAPGl1xD03ZLx7fyblJHjkBxKJJi0AQHEmI/6xF73ovJHZunxuKs1W quXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rzQQIlyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bj8-20020a056a02018800b0039e45222007si5357286pgb.227.2022.05.08.23.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:09:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rzQQIlyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2431D45; Sun, 8 May 2022 23:09:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349858AbiEEImc (ORCPT + 99 others); Thu, 5 May 2022 04:42:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346179AbiEEIm3 (ORCPT ); Thu, 5 May 2022 04:42:29 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A449B49C80; Thu, 5 May 2022 01:38:50 -0700 (PDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2458E8Vh003693; Thu, 5 May 2022 08:38:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=M1zvcLMG92FcPS3g1DuhwhZILf+zrGpIaNaaLno10YU=; b=rzQQIlyG9QLWACBzo0S5tel4b9OaKNqPSFSNk0mlIp5hfZk8b6RrGCTZLPMaxTpDnyqC qXeNYp+kr5HUOG7DGEK3iLIuuOaCnd8noyqZC1KP1CpoUdqH6xDb/Z2mvSB6rHZVLu7M Ehiy7SOUDafIRQvq+US98tywR1VZ+/zUaPWe8+xKlOFo/ZGlgFU3V3Wy1EbB53bYDWve 9ujceayJHbZIZXg5zYh38gLoy5b8vXb+02eRG+GAQccBTLp9lbQ0YkF42oyrax4pKa9e 8OBa4LyCHK93NFiMqyK/9clKopDVFSi6+Op2BAq0fgjzw/QlMbIol98BdqjGfqcFLEUv bQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fvavw8c8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 May 2022 08:38:46 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2458Ltni013170; Thu, 5 May 2022 08:38:45 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fvavw8c8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 May 2022 08:38:45 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2458ZARJ015579; Thu, 5 May 2022 08:38:43 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma01fra.de.ibm.com with ESMTP id 3fuxwkrnna-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 May 2022 08:38:43 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2458cecG48038174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 May 2022 08:38:40 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FF5211C04A; Thu, 5 May 2022 08:38:40 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C01011C050; Thu, 5 May 2022 08:38:40 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 5 May 2022 08:38:40 +0000 (GMT) From: Niklas Schnelle To: Bjorn Helgaas , Jan Kiszka , Matthew Rosato , Pierre Morel Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-s390@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH RESEND v5 3/4] PCI: Extend isolated function probing to s390 Date: Thu, 5 May 2022 10:38:38 +0200 Message-Id: <20220505083839.1315705-4-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220505083839.1315705-1-schnelle@linux.ibm.com> References: <20220505083839.1315705-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: NneUbkkqHQCD1bqXHyEtMSnl21YNPwNm X-Proofpoint-ORIG-GUID: yM2KTLT7oIWxQms6Ex6487p6gnFJ_iHR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-05_02,2022-05-04_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 clxscore=1015 mlxscore=0 mlxlogscore=725 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205050055 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 3029edc68ff7..4e27cc929095 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2663,7 +2663,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(); +} + #endif /* __LINUX_HYPEVISOR_H */ -- 2.32.0