Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp499333pxb; Thu, 30 Sep 2021 10:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE41H7D9HMrm1vHwW8h5YggQJMgDYzwyEMI8mSS/hLPpFKRU60KdwegJYkX2mcXlloPPHV X-Received: by 2002:a17:90a:d01:: with SMTP id t1mr7578637pja.122.1633022806549; Thu, 30 Sep 2021 10:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633022806; cv=none; d=google.com; s=arc-20160816; b=szEs2+Ll5TbaA1nOwclrw952FifFx+HsSlN0TTh/ijbAtL76De61eblRdVjq7Kn9lN ibc1dwXQK7kXcv0FtMdruA+tHoFDbHK8psYHyZNV2j/Falam78OHB59jjyt5wAC+XmDC jKjgwWoH6rBkqPtEhwGSgTr10cORkPUhbEl0UxuNH1AP49KvZToLqVDIUg4za6jRQab+ 7urYs6TTbmNnzAkEpXCjTMQTOhQPmL1gUcHSbk3cwGS3a6pnqYDxX8SlwEhPXJlqeN6Q 3IE5Ap0SAjcHTL5hV/nOtNVgmTsTI/3R721DyMBUac8MkEgAFWjLA7k9ku7gUPPnuCFJ CtoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CfPD2WmpabmT70XVQ67f9lWFoVd/TorhTkw5tc5mjEg=; b=Nh6RLsAQ/3PA3AOr6vUSc1vDeQiN3YNIuCusjd62ROh2SP3srxriS+HoSlnjoXTdox ad/MSZicoQmeKPYqh4HxW+TAN6mtlrBHUPV7p48q/UCdDJwkeVg3YZ5H/PEwxIT/mSsp OgwHd1YAG/k/uwyCrsS88ezYF7JWibWiBfhYSjQEz6cQrmQXOhjl9w52cjFoT/QyEHRt nVjb7EJ7aFfGuvAyX5kxNsyjIdFci1cz+T4A1dOf6FMLwdbc5IKjfQ+xatMmIDsLSfS5 1ztlUG4F0wO5W1XlJxqZy8hVfG6kKyraB7xZhhCYyTte+Lvm/P5ZsPkhFYizbJRSC2ux piyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CgXtKWuO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si4068308plg.209.2021.09.30.10.26.33; Thu, 30 Sep 2021 10:26:46 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CgXtKWuO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352595AbhI3RZi (ORCPT + 99 others); Thu, 30 Sep 2021 13:25:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:39870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbhI3RZh (ORCPT ); Thu, 30 Sep 2021 13:25:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9AB20613A0; Thu, 30 Sep 2021 17:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633022635; bh=5tePxdCWKV6n9abPoiedDR+S/Q6cb3pBjIOwiHhDGUE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CgXtKWuOlomRjLMXskRL9wb0BnYsyELUL6upXwxZ0TfFVCT89Jt9Y5Q72o+qxmEEO GBflVXV4mLsttSTo8bjOuUBHG5ZxGnlXFDM/TnEmlw6kWmVaZqyFyZbvtQVOzir9SG NPfh8I8VF2F9QcuitqSzdMgMtz3j61QxifmcEbyo= Date: Thu, 30 Sep 2021 19:23:52 +0200 From: Greg Kroah-Hartman To: Andi Kleen Cc: "Michael S. Tsirkin" , 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" Subject: Re: [PATCH v2 2/6] driver core: Add common support to skip probe for un-authorized devices Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 10:17:09AM -0700, Andi Kleen wrote: > > > > 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. Are any of them in the kernel today? PCI drivers should not be messing with this, we have had well over a decade to fix that up. > The legacy drivers could be fixed, but nobody really wants to touch them > anymore and they're impossible to test. Pointers to them? > The drivers that probe something that is not enumerated in a standard way > have no choice, it cannot be implemented in a different way. PCI devices are not enumerated in a standard 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. That's horrible, don't try to protect the kernel from itself. Just fix the drivers. If you point me at them, I will be glad to have a look and throw some interns on them. But really, you all could have fixed them up by now if Intel really cared about it :( > If you want we can send an exact list, we did some analysis using a patched > smatch tool. Please do. thanks, greg k-h