Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp996980ybl; Fri, 24 Jan 2020 13:27:12 -0800 (PST) X-Google-Smtp-Source: APXvYqycSRD6DXUdcfyMAKl7W2/38z+kEfdQ1KkHxBAQgE67CE+DVhv7gbEqD/c4DEb0T6J++Nxj X-Received: by 2002:a9d:6f0d:: with SMTP id n13mr4338801otq.165.1579901231938; Fri, 24 Jan 2020 13:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579901231; cv=none; d=google.com; s=arc-20160816; b=dxCjvMUEcfDlnv1sIgit83Bf6kH6wNUpDButREgNBrV/2NWEHT/VJgZKHR+Fg49Iiq swKPLBEt9DhUOTPmPymmwzcBDoXrX791qTXxHHEJsm3ROLX3sngxmWy0vGvSql57Dv3t mjuPZvAS+su+M56tTUrG7SK+9UtS5u6a2qRsQjGYSnLFINOBusTW+kFpKMqZ10yetDW0 L3wjn8djcXaCgLqRHzwAiYi+MP8YGEntORcRr+13ZJb/SstG/cUA09G1Nl7O3xRd0qVd V7iblZog26wFmhP41ROEWVAn7u4WcieJDRxLEfyvL/SU/8HqXfxox92qqHWYGoedwcz/ 39SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7WJvYw6BG8AN+9sejDTzeDJEZaELXZLd1pKBfuTKYrs=; b=m9jPVFWW8xNojmC9vOdD82Nb9I3n03HErlGy6EBkanIJNv8hyKtd1iMEDA2xAtzlin U7de6Ml3QYuHRo8EQGFSrg7DyZApYGHTWwmQkrIkbXJ8npzEA+1PM7T7Oc+n+mN7n6oK 8fSk+q4PVwhMdkD6DC3fvK4PlCzM5eyg5EjM8/u1I/iU5hmsFFK3Ar17EFHY91JWU5K6 T0d2Obb0y9TGGVfjbO72PPUsE3t/MUmjfkx257W2h2Ovyt5iukV7Ee0KnyoYJ+aQNw00 0VJZomxaakJ863MOHYTV+z2maNLU7HlAzfhETm4U1tpaj7B60N2izqaEJq4KIoGs4vnR 08Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=C2pA3Zwo; 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 b8si2100559otf.32.2020.01.24.13.26.59; Fri, 24 Jan 2020 13:27:11 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=C2pA3Zwo; 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 S2391836AbgAXT1p (ORCPT + 99 others); Fri, 24 Jan 2020 14:27:45 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51374 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389270AbgAXT1o (ORCPT ); Fri, 24 Jan 2020 14:27:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7WJvYw6BG8AN+9sejDTzeDJEZaELXZLd1pKBfuTKYrs=; b=C2pA3ZwoU3tK2mDyg4OmcM4V+ RW3N0fTO9ecXiUibg92EP+DbmgXruYCrrSj0l0tUQhde5zOHFlFSM/E6+dWu2iOfLMCSFQ7aFFLeR 5E6Lk9e4HtdLBK753+WT9MpW2y74pbbv/Apca0vhvhryvS2VNWZN+bvsRUrlqysdPJj+YQyZ02k4o f8rbcnUgAO83X9VTCacsbMPwYnGXoj4oxDhpWslAld5nI9CCpz6QWKxayzGQZD1Vn9xAJ5YRFkziw NDG2IFlBUvR5IAUyf3nMOJ4AJUY0lfZNUDtWB0XYasMxG3Yeb2jDwZ49hDzuYqdSQsZ/QUqo+WXGR sfGWLaYiQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iv4cJ-00071l-8c; Fri, 24 Jan 2020 19:27:43 +0000 Date: Fri, 24 Jan 2020 11:27:43 -0800 From: Matthew Wilcox To: Chen Yu Cc: linux-pci@vger.kernel.org, Jonathan Corbet , Bjorn Helgaas , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , "Rafael J. Wysocki" Subject: Re: [PATCH][RFC] PCI: Add "pci=blacklist_dev=" parameter to blacklist specific devices Message-ID: <20200124192743.GL4675@bombadil.infradead.org> References: <20200124144248.11719-1-yu.c.chen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200124144248.11719-1-yu.c.chen@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 24, 2020 at 10:42:48PM +0800, Chen Yu wrote: > It was found that on some platforms the bogus pci device might bring > troubles to the system. For example, on a MacBookPro the system could > not be power off or suspended due to internal pci resource confliction > between bogus pci device and [io 0x1804]. Another case is that, once > resumed from hibernation on a VM, the pci config space of a pci device > is corrupt. > > To narrow down and benefit future debugging for such kind of issues, > introduce the command line blacklist_dev=> to blacklist > such pci devices thus they will not be scanned thus not visible after > bootup. For example, > > pci.blacklist_dev=8086:293e > > forbid the audio device to be exposed to the OS. This feels really unsafe to me. Just because Linux ignores the device doesn't mean the device will ignore I/O requests. I think we should call this pci.disable_dev and clear the device's I/O Space Enable, Memory Space Enable and Bus Master Enable bits (in the Command register, config space offset 4).