Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp136671ybc; Mon, 18 Nov 2019 21:58:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwJqUu444A2978oBFos7FFL74bd8kCneAdN+Uy+KJBdWoFubvk7+SJHo/C7RclPaqO8g8F5 X-Received: by 2002:a17:906:24d4:: with SMTP id f20mr33555775ejb.182.1574143134279; Mon, 18 Nov 2019 21:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574143134; cv=none; d=google.com; s=arc-20160816; b=Q7GNHFJbhOvlUf+ohpM49UU5++wRziZvvj6FBCSEm3lIYDU+TXLD6pNnFUr+4X6p3c Lun7tI64xUoJ13g3K4Ftg+7pNW4XG8ybM10B5rcn33P8MIPoo4P6HkQ4C6UNVjAqaKuD 938zokek1M/A2p5dk10ZkU/UMgBBUKDCwvoCSBxeV+kBcx+T2QVozsYYfngjsRQwUilD 7W6Zim9Vek09zQLqvTRkfulrVmVwREkB9t6YPKLcxD+nyupvZ82LJzAizy0efRKqjv+9 YHW5g92CUXCPOYnBsX5EQbKdlgMPDcK+L4CJi2yVoAs5uguW74tLe2nOV8U0Groz+9aY DJ3A== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w8y7sO79qJn9v10P4k1GmNs8RJzkt5CrAeMJlJ9Fdyc=; b=rb2iSZlLSZ8bI985z/HfmzoHCaLOZn6k+Zt862x0NbxEVvPrE5tJcEx+ahud1RNdDd /NEN1S+MY60uiSlkRA7e6ERgbgD/U/CuU6C6+TutqaI87XzsxfFC3Q6rsexAY4QbhcAK wHmnvLHQInwokdfPSuF6aRRp0rQbfMrUCXYIi1vVGIv/gsncE204Sk9QLu2VPZpcwDZ/ c3z9pfNHurogD89noubsK+A0P6akyPR/R+PX+hINkgkr2y5jezG7vvyPR+Rgl5NtNjr3 89m5Y/oxGlmYSk/DgphqlejcIpInfMwpdtdJALyebNdjz2IGKFE0GH6+qwcDbK7bAvJx F2jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v+5Lacgw; 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 v11si15263874edc.410.2019.11.18.21.58.29; Mon, 18 Nov 2019 21:58:54 -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=@kernel.org header.s=default header.b=v+5Lacgw; 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 S1731032AbfKSFzF (ORCPT + 99 others); Tue, 19 Nov 2019 00:55:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:53340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731631AbfKSFzE (ORCPT ); Tue, 19 Nov 2019 00:55:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 815F7208C3; Tue, 19 Nov 2019 05:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142903; bh=XnRIcdZVlp6No/mC06k2e6r9GyXH2JlTE8agqW0ry2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v+5LacgwIOsKzdi4lBiPfXvwoYMFddsgOMcfKAStDHtdhxIiX5ylhJymm88hKL/UG 6/bVhMcD6vCLDkx7+P0zJlohd6ljaOJFZzHSd4g1mWH3Veb1MLiaUN1QFcS+Tjrh4m 8YfHOb9OJw95vcAsQryFvJKLuEOni7SL+GvtpGQ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dexuan Cui , Thomas Gleixner , Michael Kelley , "H. Peter Anvin" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "devel@linuxdriverproject.org" , Olaf Aepfle , Andy Whitcroft , Jason Wang , Vitaly Kuznetsov , Marcelo Cerri , Josh Poulson , Sasha Levin Subject: [PATCH 4.14 214/239] x86/hyperv: Suppress "PCI: Fatal: No config space access function found" Date: Tue, 19 Nov 2019 06:20:14 +0100 Message-Id: <20191119051338.898151241@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui [ Upstream commit 2f285f46240d67060061d153786740d4df53cd78 ] A Generation-2 Linux VM on Hyper-V doesn't have the legacy PCI bus, and users always see the scary warning, which is actually harmless. Suppress it. Signed-off-by: Dexuan Cui Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "H. Peter Anvin" Cc: KY Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "devel@linuxdriverproject.org" Cc: Olaf Aepfle Cc: Andy Whitcroft Cc: Jason Wang Cc: Vitaly Kuznetsov Cc: Marcelo Cerri Cc: Josh Poulson Link: https://lkml.kernel.org/r/ --- arch/x86/hyperv/hv_init.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 2e9d58cc371e6..2653b7b25d176 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -17,6 +17,7 @@ * */ +#include #include #include #include @@ -101,6 +102,22 @@ static int hv_cpu_init(unsigned int cpu) return 0; } +static int __init hv_pci_init(void) +{ + int gen2vm = efi_enabled(EFI_BOOT); + + /* + * For Generation-2 VM, we exit from pci_arch_init() by returning 0. + * The purpose is to suppress the harmless warning: + * "PCI: Fatal: No config space access function found" + */ + if (gen2vm) + return 0; + + /* For Generation-1 VM, we'll proceed in pci_arch_init(). */ + return 1; +} + /* * This function is to be invoked early in the boot sequence after the * hypervisor has been detected. @@ -154,6 +171,8 @@ void hyperv_init(void) hyper_alloc_mmu(); + x86_init.pci.arch_init = hv_pci_init; + /* * Register Hyper-V specific clocksource. */ -- 2.20.1