Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751796AbdHRP5X (ORCPT ); Fri, 18 Aug 2017 11:57:23 -0400 Received: from mail-co1nam03on0081.outbound.protection.outlook.com ([104.47.40.81]:60672 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751036AbdHRP5U (ORCPT ); Fri, 18 Aug 2017 11:57:20 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; Subject: Re: [PATCH v2 3/3] vfio/pci: Don't probe devices that can't be reset To: Alex Williamson , Jan Glauber Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, david.daney@cavium.com, Jon Masters , Robert Richter , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Jon Masters References: <1502957663-5527-1-git-send-email-jglauber@cavium.com> <1502957663-5527-4-git-send-email-jglauber@cavium.com> <20170817070017.1e9c9456@w520.home> <20170818134231.GA3464@hc> <20170818081251.2bbffe56@w520.home> From: David Daney Message-ID: Date: Fri, 18 Aug 2017 08:57:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170818081251.2bbffe56@w520.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: SN1PR0701CA0049.namprd07.prod.outlook.com (10.163.126.17) To MWHPR07MB3503.namprd07.prod.outlook.com (10.164.192.30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 669b8d99-2d1a-45ba-dc84-08d4e651cde1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR07MB3503; X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3503;3:L5X+hQ0DxEG8ZrLgNgbwAUK1Di6+iV4xkPqdujgBtE1NbV1W0t6GghSC4nUOt9Lq8eezrL/EhSNX+N972cGukMBL1x34qXMMdy5pispDKIqvzUJCAoj4ZTieUJNLW0Lh+GO68nvI9E7s1mNSWezar1p8bthyq1dxUOohouHNxYOB7MSU6rSnYew9hJK2oWrgNMGTr4BrBFPfxMrlCRdyp1rP4jD5o3TpttSnuGtAqlpjNgbmIKjAzuDf/tX6vS9K;25:QliNTUJOO9Tb0/1Ucnrs2/mzsZaYbnQAh/YTnKz2wdPTSDImxZ2ckwn+n+NXOcwCZcdJ32wJbZvJ7Sn+ygtTVVvKBKOiRNhRjbI8CFhYVZ9VnI/+eAOF9b8zgZGFvnTcDlGG5UYYUbFa4jmqkajmxGIwdrU9OgwETbryJVFZrO7X26+GMQH8sMPmJxs5Kedvo0kXbGxYNdkejNvshVu1wWSsyssyV9R6u9XakVWqdjOOdtRobGt8BKynfpejBTEHNLpNARKZBGb4Jby7GSrjIRd29OSl2akdx9tQedQnwglExlT3GR4E/wuIHAMBzC26yxT5gsg4EMxDY1YEQdsGsA==;31:RFuf6XZPnXgO3Q2xmjX6qDriEZf5IFrHHAvToDrobebyMQ9EHuSbgd+n0nm8lTWFfIv7hzFmpFQuow6MAfEGiqrW93DB99BrAbTtgEmVYrY4aMqw/lv9iP7U0njHNHBpQqxOXGYlIqz9En7FrJrH76+yihJECJv9i9D5NvmtbAwNSwIygcOHrL4mXZpWakePiqkPzSqVWQWlXVQOJYEY2WZ11NsepLj9+3QAehTJ1oY= X-MS-TrafficTypeDiagnostic: MWHPR07MB3503: X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3503;20:zP0eYA1Nh7eDnV3pErl9X+OZIhQTPAjD9EMTL+aeEWeZXtu8E3HV3mvP3EHS2Jos/F9D/S6iJZntwQyd/1s7BIz0MyubSojAmphHxmG9l0jqabTyzZPZrslor+E/Gw3WyL3+GZon0hnBCwG3pFzx5RwXbuFxcDqOe2YsFU6OmQRIwiCpTluaZ1stCHlt7KogWOknGHdSpT+PoJk2XocoCFLPfvV8iBuqS0YqsNDHFZmZud9EmNpxIFK6YpIrD/4iruZuWIvdj/8Z9T/AwtsDMM9IweGOzAomAnQPrc+DGyxfzsZnzM/l7el1BWF3kObQZFTLCQZku7Uvg/OLmFxaa36Bu5YnB5he2x17Y+pkxGhgvgdpsaIkDUkenkxLH1JRfSNSYznF1OhyomigyiJoDMvFxycu7iCWx4GStyO26PZ8rm+mf33L7FxomxaQuG6BtYRW7Hls0SKwX2x//hA1G9Jt4ra6PBfEdY2qnxOEntJP+tmHMNW8+7XHnqndUZmylOgnrTNYHK4U55n9TGbIEFfaOWvSuEYwTXmzV6gHZUGf9NXTu1riWYxBX9wpzLZDvI4vR2ADhR/uQfB9VDDD/kZmpN0VHkDtXQ5kVunbmBU=;4:s2Oxa+uidZzFvD8sfkgaa6UKY/V26CVG35gUC/ODMR57pLm8K8X4Hx9jVXPbSkMHzQ2bc2lQQkK/+vR/TT+e2KqPGTtccS+fulevTgsT+YNa77ZqQBTOlkn9gTeMrZuqhZOK6GHHTB1hs9z8VsMJfEFxa4rTGmy+owcF06A/ZtzAbnYHxNHCNcatNKgEjv3607LXFY1mVur4cvJvLFPewUlEqvAlja9F7zBVoxkaujH1ZffMBZ0R1ShuUQGHC3j+ X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR07MB3503;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR07MB3503; X-Forefront-PRVS: 040359335D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(24454002)(377454003)(199003)(189002)(25786009)(47776003)(6246003)(69596002)(31696002)(65956001)(189998001)(66066001)(50986999)(478600001)(53936002)(65806001)(76176999)(101416001)(54356999)(6512007)(42186005)(5660300001)(23676002)(72206003)(2906002)(36756003)(68736007)(65826007)(53416004)(54906002)(230700001)(105586002)(106356001)(53546010)(42882006)(2950100002)(97736004)(8676002)(3846002)(33646002)(64126003)(4001350100001)(6116002)(93886005)(6666003)(31686004)(7736002)(6506006)(81166006)(305945005)(83506001)(4326008)(81156014)(6486002)(229853002)(6636002)(7350300001)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB3503;H:ddl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjA3TUIzNTAzOzIzOjlSbTVkbDBXSVcrYy9vRzZWc2krRjJpTzlS?= =?utf-8?B?OHNoNmk0K0wwaGthcTM4R0lFVmhqTVg4VFkzeXpkekV0N0l2bXk1MXZDMzV3?= =?utf-8?B?OVZhUlVISDhxNUR3SjNJNGRsQjgrTFN2czYzd0JUV2pqODFkU2pxaHZ2Rk1P?= =?utf-8?B?MzJINllaVG9GZ0x3ZUNCTGxYZUhZSWdhQm9BbXRYOEtaUXlFMFNQUWYzdWxN?= =?utf-8?B?Q0Nxc3o0WUJNQzNhMHk4b1VLOHp3Z0gxMnNqYVdUQnRTZFh1Vjg5Rk9NSVhM?= =?utf-8?B?a3Rwd0lKOWc4MkZFSjhvY1grRTkyb0VUOWlWc1kwN0lzTGtRQkpQ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D+ZgTzISvHtV4nqO1s3qsLO0XIN2Px4COXS5R947j/wrKTxlhIRs0tiguUkTZz/6xBAWSk0wabZUa8KqUGXVc/x2PQVQlflXaEfPEA4hYhUx4c7b/2PbGkacZONhpFjGJS1xCFeReRVNHJ3q5+ETJerGBprcm30z5sexsSZA551kEMaqAM50bGNRwseeA61m3L+CG+sBTvpw==;5:OCIGX0grlVFi+E1mu4kUxgNnLbts2Ql6iE9Z4Wbp8X97Kytfal96UJsqtmpTZHZngthNCDuiiJloF9jrgS5STCXiwNKqc3x1RXe61ol7OD+ScCviZYBobby48nelI8V5UAjLw42/PCXf63AtmHbkaw==;24:Y6us7TbZ9MSWY7WLwZ1n6g1lAyaFNmjxqm3h542CCG85fHyJriT8sbzf/0yyBOua+IB01km2fkPEIrL7Jii7r5AIpS0lJKWcU9Ge5e6yf0c=;7:Yt3czFZI3C0K2vVuVvLZBWnevqhhWUFFgJA5ZsLFnAKNrVZgccOJ8T2osB/RJYuo4PQYjmUkHoRgXjQTs1BbivtPMKxVRpRit8f5DGTZ5LNqMFedJsqp1mjzG/OTRqNWIRWutaNaPnmWFWn79T4Cdl81ex47Ft46M6QlMt/e6xW7/UbZyuIpJ3KFNs1ShvBrFAeBGoKqAAomi1he5O334uFpZ0EMbTV/HvwiA716xjI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 15:57:12.3827 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3503 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1930 Lines: 52 On 08/18/2017 07:12 AM, Alex Williamson wrote: > On Fri, 18 Aug 2017 15:42:31 +0200 > Jan Glauber wrote: > >> On Thu, Aug 17, 2017 at 07:00:17AM -0600, Alex Williamson wrote: >>> On Thu, 17 Aug 2017 10:14:23 +0200 >>> Jan Glauber wrote: >>> >>>> If a PCI device supports neither function-level reset, nor slot >>>> or bus reset then refuse to probe it. A line is printed to inform >>>> the user. >>> >>> But that's not what this does, this requires that the device is on a >>> reset-able bus. This is a massive regression. With this we could no >>> longer assign devices on the root complex or any device which doesn't >>> return from bus reset and currently makes use of the NO_BUS_RESET flag >>> and works happily otherwise. Full NAK. Thanks, >> >> Looks like I missed the slot reset check. So how about this: >> >> if (pci_probe_reset_slot(pdev->slot) && pci_probe_reset_bus(pdev->bus)) { >> dev_warn(...); >> return -ENODEV; >> } >> >> Or am I still missing something here? > > We don't require that a device is on a reset-able bus/slot, so any > attempt to impose that requirement means that there are devices that > might work perfectly fine that are now excluded from assignment. The > entire premise is unacceptable. Thanks, You previously rejected the idea to silently ignore bus reset requests on buses that do not support it. So this leaves us with two options: 1) Do nothing, and crash the kernel on systems with bad combinations of PCIe target devices and cn88xx when vfio_pci is used. 2) Do something else. We are trying to figure out what that something else should be. The general concept we are working on is that if vfio_pci wants to reset a device, *and* bus reset is the only option available, *and* cn88xx, then make vfio_pci fail. What is your opinion of doing that (assuming it is properly implemented)? Thanks, David Daney