Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp494077pxb; Thu, 30 Sep 2021 10:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyCEE89gx6ZfmMUZ2AH6KiBGR6oXLe6o4iSbtC2wRH8nIIrewYOjM3/UsS8uA9GKRdSRLz X-Received: by 2002:a17:906:fad6:: with SMTP id lu22mr384928ejb.567.1633022396476; Thu, 30 Sep 2021 10:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633022396; cv=none; d=google.com; s=arc-20160816; b=OsSvtdNZ41gfELDdlNVbxKSWXTZW72+Pumjl8AmqmPoEzuS9a7QoaOs3QATtU10oAJ tvC7AcKRBVRvWry3tWT1rFfWfb5/ZWR2wcYiJsuYai9wiT5L8vWBNL+HLASc2lxQcv/Y NOQgJZXYoYWfFxdZo5Ivu5STUneuL4stpobg4dWe7k963LyOxae6JpazWfkFyQINcdw3 PiREbPrtz468j8XSg/wWqgSVGLLFp3oTdUptc4ZuJeWYtnr+JF4JdLamfncbppOraFci NVImZByM1ED5PtTRFMTkyulO2s8N+PsV3vn27qtwwLIHiD2CX7Qj4eAmyH6AxzFD+aTv vMtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=7vRS7FR93lEUQJjWf5v2+QE4mMXoiYTWQav8lzhBwIc=; b=gmpv66wjht6ocIWL0EiyM5qUfCQNjs2iW1kDV2O6KSMrsvHAaBVgADQhg5/kjODfj3 2iMkmfYmA1jVf0PlFLvyutQWWbkVNC984P4iI55MSMgvMuYONwjMiD1SeeUWy5UGoTDx fAkbblhuDNNoembtn0IMS0OFUdHTlDaqxLbD+p5UUxH2afCCwhJZA7t7QkjE1gW+DLIl 4bl8iPS+wvpxwmPfSiXCSg/giJJtKWJWiGbgDLcmeiOfO/JqBepRUq1H54VmskMwpo7s wjqb9yVYzRBmIUc9A8ZBlKNW0AtbUQvZesy15GRctBNVxnABwh41Phv/9fo35hJ1oox/ J2uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si4807024ejj.696.2021.09.30.10.19.28; Thu, 30 Sep 2021 10:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351879AbhI3RTF (ORCPT + 99 others); Thu, 30 Sep 2021 13:19:05 -0400 Received: from mga09.intel.com ([134.134.136.24]:23826 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351834AbhI3RTD (ORCPT ); Thu, 30 Sep 2021 13:19:03 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10123"; a="225283798" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="225283798" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 10:17:20 -0700 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="438120652" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.252.134.229]) ([10.252.134.229]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 10:17:19 -0700 Subject: Re: [PATCH v2 2/6] driver core: Add common support to skip probe for un-authorized devices To: Greg Kroah-Hartman , "Michael S. Tsirkin" Cc: Kuppuswamy Sathyanarayanan , Borislav Petkov , x86@kernel.org, Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Andreas Noever , Michael Jamet , Yehezkel Bernat , "Rafael J . Wysocki" , Mika Westerberg , Jonathan Corbet , Jason Wang , Dan Williams , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org, "Reshetova, Elena" References: <20210930010511.3387967-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930010511.3387967-3-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930065807-mutt-send-email-mst@kernel.org> <20210930103537-mutt-send-email-mst@kernel.org> <20210930105852-mutt-send-email-mst@kernel.org> From: Andi Kleen Message-ID: Date: Thu, 30 Sep 2021 10:17:09 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> The "it" that I referred to is the claim that no driver should be >> touching hardware in their module init call. Andi seems to think >> such drivers are worth working around with a special remap API. > Andi is wrong. While overall it's a small percentage of the total, there are still quite a few drivers that do touch hardware in init functions. Sometimes for good reasons -- they need to do some extra probing to discover something that is not enumerated -- sometimes just because it's very old legacy code that predates the modern driver model. The legacy drivers could be fixed, but nobody really wants to touch them anymore and they're impossible to test. The drivers that probe something that is not enumerated in a standard way have no choice, it cannot be implemented in a different way. So instead we're using a "firewall" the prevents these drivers from doing bad things by not allowing ioremap access unless opted in, and also do some filtering on the IO ports The device filter is still the primary mechanism, the ioremap filtering is just belts and suspenders for those odd cases. If you want we can send an exact list, we did some analysis using a patched smatch tool. -Andi