Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4043512pxb; Mon, 30 Aug 2021 17:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz71Nr8P+Sb9O6gZLEh4GEMByKUhIVDQzit/60qVTJqLmCqA+/pcuRlI0M2QQJXWWB3S+nd X-Received: by 2002:aa7:c559:: with SMTP id s25mr12184484edr.379.1630369511701; Mon, 30 Aug 2021 17:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630369511; cv=none; d=google.com; s=arc-20160816; b=GE/MRnb7DeyDtTOBgiO4V6rl0NZG//J00yXvvuerfAb8iWzyYb0JwYc0evZhr3WTDo dpao1ciA8gZZlTNqeJdnxkOrzAFKAhSg+oUBNebKw5qcGgWE23vZdSpGyVHRveBU9C7c JzvGzqFho3eT+jbBnF1hiw83P+rF3zuMeC5iDed8x3nJtwn9Sfv3wn2bdENMXUTzD63G UmwBvuhhMd0bMpEb3I4zhkiX862ZDyCQrFaAiVKHBia1XlIszg4TLhCwuOvc8O/E4JP1 MJLlqwV+6QKz0p77idajbEPJK+cBGrxgqeuFb9KL4h6unMmkGFPGJofjDlqkKv0PKS94 M1oA== 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=LC3pr5ZPNQAO+yrFDG+Xkm2Nr7QObtoSDc92rzwW6r8=; b=PVdOg22Wh18VfgubuLM2frIbXKcOXT/YYi16nICVNNOD0m0XqDs8pswsbR1N+kJqhJ D713/XQ4rK/FCs9HXpR8ZOoYOnliEsr8yst/vSRhRft2VUVCiRB5kNiPNlWvrdznPifV 5Psk1E/hpc/sK/T0NqhMivyS4hAM+dldPfSg8TKaiLbn/oukSLui/JICoOXkcxhNhb3a gEUFfvmh1QPTNGZab1UExmi/cfJ3lnVUMDKlxBzeKWcUl2kvluQ+wvBf8fXWWFn2EBcA P0cZkscAamIMfpVbDGMKeuukxEo0s+0PHnosQ0FSldb12s1UqW4SBtBO3sKr03DTR2iM HUIw== 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 s21si15460083edt.17.2021.08.30.17.24.47; Mon, 30 Aug 2021 17:25:11 -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 S232360AbhHaAYP (ORCPT + 99 others); Mon, 30 Aug 2021 20:24:15 -0400 Received: from mga18.intel.com ([134.134.136.126]:4596 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbhHaAYO (ORCPT ); Mon, 30 Aug 2021 20:24:14 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10092"; a="205506671" X-IronPort-AV: E=Sophos;i="5.84,364,1620716400"; d="scan'208";a="205506671" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 17:23:19 -0700 X-IronPort-AV: E=Sophos;i="5.84,364,1620716400"; d="scan'208";a="540780855" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.223.22]) ([10.212.223.22]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 17:23:18 -0700 Subject: Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range} To: "Michael S. Tsirkin" Cc: Dan Williams , "Kuppuswamy, Sathyanarayanan" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , Peter H Anvin , Dave Hansen , Tony Luck , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , X86 ML , Linux Kernel Mailing List , Linux PCI , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch , Linux Doc Mailing List , virtualization@lists.linux-foundation.org References: <20210823195409-mutt-send-email-mst@kernel.org> <26a3cce5-ddf7-cbe6-a41e-58a2aea48f78@linux.intel.com> <20210824053830-mutt-send-email-mst@kernel.org> <20210829112105-mutt-send-email-mst@kernel.org> <09b340dd-c8a8-689c-4dad-4fe0e36d39ae@linux.intel.com> <20210829181635-mutt-send-email-mst@kernel.org> <3a88a255-a528-b00a-912b-e71198d5f58f@linux.intel.com> <20210830163723-mutt-send-email-mst@kernel.org> From: Andi Kleen Message-ID: <69fc30f4-e3e2-add7-ec13-4db3b9cc0cbd@linux.intel.com> Date: Mon, 30 Aug 2021 17:23:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210830163723-mutt-send-email-mst@kernel.org> 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 On 8/30/2021 1:59 PM, Michael S. Tsirkin wrote: > >> Or we can add _audited to the name. ioremap_shared_audited? > But it's not the mapping that has to be done in handled special way. > It's any data we get from device, not all of it coming from IO, e.g. > there's DMA and interrupts that all have to be validated. > Wouldn't you say that what is really wanted is just not running > unaudited drivers in the first place? Yes. > >> And we've been avoiding that drivers can self declare auditing, we've been >> trying to have a separate centralized list so that it's easier to enforce >> and avoids any cut'n'paste mistakes. >> >> -Andi > Now I'm confused. What is proposed here seems to be basically that, > drivers need to declare auditing by replacing ioremap with > ioremap_shared. Auditing is declared on the device model level using a central allow list. But this cannot do anything to initcalls that run before probe, that's why an extra level of defense of ioremap opt-in is useful. But it's not the primary mechanism to declare a driver audited, that's the allow list. The ioremap is just another mechanism to avoid having to touch a lot of legacy drivers. If we agree on that then the original proposed semantics of "ioremap_shared" may be acceptable? -Andi