Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4168447ybl; Mon, 27 Jan 2020 18:12:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyRtIbv2v3yUsI4s7QxOfSNzB56R1zPAd5EqzqSv3ofasp75GXwjEKujMVtm1lMjwV60tSc X-Received: by 2002:a9d:5c10:: with SMTP id o16mr15321368otk.286.1580177535896; Mon, 27 Jan 2020 18:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580177535; cv=none; d=google.com; s=arc-20160816; b=Uo8vqunxN1eHSPH21nduxwDiUIeKCQzSsJZaOSUsYhd2v5osrnvAFlNXfIFCgHFlMF lJ09FcIVE1P0xBoLs7WLy4jqmzg+VzcPtwfVpCuFlw9fxKf6lVU0HZhSdKtrtZiQoHG2 Oz8gNPOfceklHhrjaaT5si7LgAFWnBo3QxPpiuK+peJUpfoQdjgiP6dKvka3aGbdepzX a0ypC23A93QaSOPzSvaGpvt4YcDwgasrZYviKtY/8xaakeld9QQmNPZm1ZQZg+FUsdNx WJ6h2+sRwvqm9KePvbhrEdt2X5YFdnHqNwcK8Pn3GzfzIpVJymNkvx6j0d/RQ2kWWEhz NQaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Jqeka4BRN4QCngINzPSMLmJvVtJZ+1civQXaHl9LEDU=; b=j5CRVBQzrZWLrSHRUEHk1Sc0D6K2LlFdEwCdL1jPEKKIri99wns4o7TcQIU6Y5t5Il UTb1HOycAKIHD4Bp2fZUkhTgrT8+Ei6Rd7erjsbHyk25Xb8VJKPrTk1d8JOED4zyLqcB TvdkQu9iz1uyEvKbw2KwGjaUuEaRUZZaoRrJCFBcjQt2Ue5u8KlPTHE0zHO00mJ1/A9I S/YFIElUadCAckT1ociVGk/Js1UK0JyRbNw7Got1wg4/jeOmEjBamGcfHtY9Sk/UqtPR lKv3oMYzm5dGIP0z7RiTJwsaVepSd2gG7cnanS7zkIVZk6Wx+/BNxEYT1wnPe8hbzhaF VaHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C2nySqPo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si5715otk.154.2020.01.27.18.11.54; Mon, 27 Jan 2020 18:12:15 -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=pass header.i=@gmail.com header.s=20161025 header.b=C2nySqPo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgA1CJU (ORCPT + 99 others); Mon, 27 Jan 2020 21:09:20 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:41095 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbgA1CJT (ORCPT ); Mon, 27 Jan 2020 21:09:19 -0500 Received: by mail-io1-f67.google.com with SMTP id m25so12450837ioo.8; Mon, 27 Jan 2020 18:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jqeka4BRN4QCngINzPSMLmJvVtJZ+1civQXaHl9LEDU=; b=C2nySqPo3DP5zUI8IHxkiPq3mjvT9ZQJ2FWeALKWoafxbpxXKAbIzhv3ZNS55XAx36 L5jUaL3lhl9wM2FZJSY9jOPEJU9DrAaTWlNu/uJzhcUEOD1uI07VSn/rz4Sx1HVEM+SX rUOhFR0QiCRR7vb9Toywv7Eg3nSJp02dUIZ7PsBhqTHjjlI46gGYrP/jKBxRHcD+t6Ny iTErSIWGrSxsmE4hV6bsPiHhW9+99BM3BbX/kWWWeNAT06b4zYLKx83/XdVFWrYzdn2v xLRtABKiTjYUnx2T7CihXALM2CACMml8iUqpyuuDGGYTHZEIe7xpsOVk77b79SYqbcFT qpRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jqeka4BRN4QCngINzPSMLmJvVtJZ+1civQXaHl9LEDU=; b=cBbCseaOXkt6lYPxD+Qvrkd0IUVNX5uhj+IWnARJhPcE/nNEUJp/5IcSYDb+sbZb7P VF5kqVWYVYDop87/OxLzIwGx8ubwanM+Wczu3wfRa0cE2MvXcyVPGxTMP6KYDUkAE6+g jvwtIay2qOa2uW7r7nP2LZeM9xfTvUWKBBfFaf2L7rTy7o8gp7yU0VFj8ztvEPjRRZvc 2cHpudfsOtkqqxiT2OiI53AvJ9dMvE2IJD8kMqK2t4Ffx7fQMPSlK7/jE7j7rru44h7k 1CLg5gAIeH8MNRtlBc0920Fz716RzT3+PfMzxSdZIrQP5san3MbuGxeRsxB6uyWXCaj6 KsYQ== X-Gm-Message-State: APjAAAWBMEanF74XCMmplbI3UTMYCmLvMBuGnJN1WJhEVIAakaWhvN50 AzwC+PT7K3/qXFLHSsYES+TTT3O28SLyj5YEpmfadg== X-Received: by 2002:a6b:4e1a:: with SMTP id c26mr13878144iob.154.1580177358558; Mon, 27 Jan 2020 18:09:18 -0800 (PST) MIME-Version: 1.0 References: <20200124144248.11719-1-yu.c.chen@intel.com> <20200124192743.GL4675@bombadil.infradead.org> In-Reply-To: <20200124192743.GL4675@bombadil.infradead.org> From: Chen Yu Date: Tue, 28 Jan 2020 10:09:07 +0800 Message-ID: Subject: Re: [PATCH][RFC] PCI: Add "pci=blacklist_dev=" parameter to blacklist specific devices To: Matthew Wilcox Cc: Chen Yu , linux-pci@vger.kernel.org, Jonathan Corbet , Bjorn Helgaas , linux-doc@vger.kernel.org, Linux Kernel Mailing List , Len Brown , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthew, Thanks for repy. On Sat, Jan 25, 2020 at 5:01 AM Matthew Wilcox wrote: > > 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). Oh right, the BIOS might already has enabled Memory/IO space in the config during boot up and thus has already claimed the resource range for this pci device. I'll summarize the problem I found currently in Bjorn's reply and let's discuss it there. Thanks, chenyu