Received: by 10.223.185.116 with SMTP id b49csp4657745wrg; Mon, 26 Feb 2018 23:46:33 -0800 (PST) X-Google-Smtp-Source: AH8x225tdbMSmp7hduCDrTXpwqq/ggTLEAi6Ce/CuW5Zzry70/CbA8Q1aDQcPHCuWitKzlsDpE9f X-Received: by 10.101.83.3 with SMTP id m3mr10639442pgq.396.1519717593037; Mon, 26 Feb 2018 23:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519717592; cv=none; d=google.com; s=arc-20160816; b=uBUDYV5TEerSKmiDOnUy0oF3xReO7XmUtD5DJKR09KChhO0eRCigP/5iBtI9VX3gc8 TdAdAdrHP/a1yKr6DaGITZUZJxvWC4Ex76O1KiLqMKPg90VtRUY6RGKsbueheJmpf1Ky aOvlOwIn2kzVBAvMoa61x7nwH+nOiwdmtwOIpxpkpEkMDDqS1IGFs5Z0xpM1mb2K1GVv MZTkiF15esdyXYKmHsOzt50O5RTZkOIW0iVZ6CDiSzJL20KWC3pmkq5PrNkz2S9zmPvT +O2yfwfA09d8tDFC19P/ExRGhu7OJ5r0HoKKaLIM1c0jN1iBXQZl6OUBoZ6bpzv/3L9F KqRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=7rRxPNA+Mc3G+DyDfWlcHQekpvjnLZO/Jbv8DKVGnR4=; b=mVlTjhrlMKkA3JioCuag+lLWlf7jscf8QO6U+WvkkE1S7J0dKu01l+SwBUUHRSm9Z6 vxEXTupT2oDiPB5Ki0hUNEzgK8teQsQB+VpMZZmUkVjeqKqtLkoZ5rjfdegCBUmemiIw uCEhzB/wPVYTBZS5Wnr9oSaNo2to/5CMi0Dr3opjne4TPkEpcmPCmoE+qQJ7oejIlO44 0EPDrwW3G+FnAnN9ufEFTOJu9CgvR/hGsZqpciux8wXeEUp4kiRf4nI279RjxLoO5Hs5 egg+QqYFBxdKPn8VdhUsefJcjzOtt0DGNKefvZj0J4FfMtWZlt5d8cQmHzub/CdnPng/ 4JKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si6626383pgc.820.2018.02.26.23.46.18; Mon, 26 Feb 2018 23:46:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752480AbeB0HZ7 (ORCPT + 99 others); Tue, 27 Feb 2018 02:25:59 -0500 Received: from thoth.sbs.de ([192.35.17.2]:53472 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbeB0HZ5 (ORCPT ); Tue, 27 Feb 2018 02:25:57 -0500 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w1R7PjgL025771 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2018 08:25:46 +0100 Received: from [167.87.43.190] ([167.87.43.190]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w1R7PjWl032349; Tue, 27 Feb 2018 08:25:45 +0100 Subject: Re: [PATCH 2/6] pci: Scan all functions when probing while running over Jailhouse To: Bjorn Helgaas Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Bjorn Helgaas , x86@kernel.org, Linux Kernel Mailing List , jailhouse-dev@googlegroups.com, linux-pci@vger.kernel.org, virtualization@lists.linux-foundation.org, Benedikt Spranger References: <66bfcfc6dc1832baa3fbd8e4879764d36aa9c1e7.1516601570.git.jan.kiszka@siemens.com> <20180222205753.GE16519@bhelgaas-glaptop.roam.corp.google.com> From: Jan Kiszka Message-ID: Date: Tue, 27 Feb 2018 08:25:45 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180222205753.GE16519@bhelgaas-glaptop.roam.corp.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-02-22 21:57, Bjorn Helgaas wrote: > On Mon, Jan 22, 2018 at 07:12:46AM +0100, Jan Kiszka wrote: >> From: Jan Kiszka >> >> PCI and PCIBIOS probing only scans devices at function number 0/8/16/... >> Subdevices (e.g. multiqueue) have function numbers which are not a >> multiple of 8. > > Suggested text: > > Per PCIe r4.0, sec 7.5.1.1.9, multi-function devices are required to > have a function 0. Therefore, Linux scans for devices at function 0 > (devfn 0/8/16/...) and only scans for other functions if function 0 > has its Multi-Function Device bit set or ARI or SR-IOV indicate > there are more functions. > > The Jailhouse hypervisor may pass individual functions of a > multi-function device to a guest without passing function 0, which > means a Linux guest won't find them. > > Change Linux PCI probing so it scans all function numbers when > running as a guest over Jailhouse. > > This is technically prohibited by the spec, so it is possible that > PCI devices without the Multi-Function Device bit set may have > unexpected behavior in response to this probe. > >> The simple hypervisor Jailhouse passes subdevices directly w/o providing >> a virtual PCI topology like KVM. As a consequence a PCI passthrough from >> Jailhouse to a guest will not be detected by Linux. >> >> Based on patch by Benedikt Spranger, adding Jailhouse probing to avoid >> changing the behavior in the absence of the hypervisor. >> >> CC: Benedikt Spranger >> Signed-off-by: Jan Kiszka > > With subject change to: > > PCI: Scan all functions when running over Jailhouse > > Acked-by: Bjorn Helgaas > Thanks, all suggestions picked up for next round. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux