Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp477031iob; Thu, 28 Apr 2022 06:39:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbyZCgxggt3DIWl7IwonoAnHrMqzz1XtYydkK9cfF0secNVkCg9irBc0ODA8ugX56todpS X-Received: by 2002:a05:6512:1382:b0:445:9536:903 with SMTP id p2-20020a056512138200b0044595360903mr24268010lfa.89.1651153156591; Thu, 28 Apr 2022 06:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651153156; cv=none; d=google.com; s=arc-20160816; b=I23P1nqD4+Zzf2FKkcp36ZTERVpbKfw/mrUJYJKGOCCKLkfCS26/xt92xQogSRGyZh 0b/ART3s7KDoSSgR+Mt158Cg1BjqJQfCCgCo/L6/XP2S7bE3De1ifoUBL4vPnXAMCKVX YlexEnVeCT/kLt+sn3+Mi5bWA3i1UVnFL8uxkaOIhofBVkG6gXKLoU0gxmoQsjke8pmR 6+YVIj6UNwyzZQeuUryro54dYz86QnX4+UX/z28NVLc7oAWVHKedH4DAF1JfWdRvjvl5 n2lmJhrqdVb6Dw7VxFImdsT0DiAeg9JkSd78ezg0T/zXYslbxq6E2FxrtwknJNgUhHoi 06OA== 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=qfctt0SRFWfzytu+vKLBltv9JFaIw0/H/9eUVZuhlnFTqCYmI2wMUYBxSYYofmQ2Rn U8ou+ARlyZHslzH3X3Uwb/0vgCkqH1th2xL3c0lB6beB/Ualut+sMScQebhEqONNcwKa LPPRtEq3B06SYK+qQnNBE7T4fFYQGlsMV8WEGWrdpYAlPEfGcC3VkVEsiirkFIWXli6R gDQkISg5V3NHuU5qAuoaE96roygFNG37b2fq+IcTYOfYAw9T1ZKAR581eb5X/OzIeOU4 A1XsQ8yCgWjn74lSf1vtdyBCJo2+4i5s3zi2HYgJf4UsCd4mwDE5s/5YCK2Om+Mcpjdg oimA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QmzuhcrA; 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=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a0565123b0700b00471fcfd6ed6si5321771lfv.547.2022.04.28.06.38.45; Thu, 28 Apr 2022 06:39:15 -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=@ibm.com header.s=pp1 header.b=QmzuhcrA; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343948AbiD1IL3 (ORCPT + 99 others); Thu, 28 Apr 2022 04:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343831AbiD1IKs (ORCPT ); Thu, 28 Apr 2022 04:10:48 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74C96128D; Thu, 28 Apr 2022 01:07:29 -0700 (PDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23S6rcVR021034; Thu, 28 Apr 2022 08:07:25 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=QmzuhcrAdntGVUDOv14y7hNtrW3WliShITFtxC5xyUCQBHCOjeIZKmFD0rlxHC0vNOyh FGdzjDDqeuDx69dc+cqx5BkHf6dqsIrfNqU923rJGoZ1ktLvwnXrlSlu9fRqkYLU4OH1 T3OqNnvNit/vtR7sBpECxmM7gXrCcsUx291LUD0v+TgtdWVJPNAQIQ5k/wh0OxaXCTZE OFfVemTTMjak9p0E8sxSrn32tRVsRPPxSG8zuqP5ZaXYIQ67WwRTGMForEVTmRcjeHqK ZiNxRdSM/o2Z3Cl2/nspsy5458nKm6h4p5mSyo8ZBgQU1OaEyH0kTYfRueLfR/kQYKUZ dw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqp2ahdem-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 08:07:25 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23S80Ehf027610; Thu, 28 Apr 2022 08:07:24 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 3fqp2ahddv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 08:07:24 +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 23S7whh0012182; Thu, 28 Apr 2022 08:07:23 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma01fra.de.ibm.com with ESMTP id 3fm938wmd7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 08:07:22 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23S87J1623462186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Apr 2022 08:07:19 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAF514C04A; Thu, 28 Apr 2022 08:07:19 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79AF54C046; Thu, 28 Apr 2022 08:07:19 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 28 Apr 2022 08:07:19 +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 v5 3/4] PCI: Extend isolated function probing to s390 Date: Thu, 28 Apr 2022 10:07:17 +0200 Message-Id: <20220428080718.3094464-4-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220428080718.3094464-1-schnelle@linux.ibm.com> References: <20220428080718.3094464-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: hF0KEBPr7YeZ1OczsSRlpTs9XSHTCEFo X-Proofpoint-ORIG-GUID: 08pUsJU316UAjGNJ5zfbsDQg0wrIyl5U 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-04-27_04,2022-04-27_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 phishscore=0 mlxlogscore=719 spamscore=0 adultscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204280049 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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 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