Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3325786pxb; Sun, 29 Aug 2021 22:13:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz60oGStyl3vkT5U8kLLjDM7iSlToJirRikgP79btuNB+P1xiUxCM9QMj9HYFq9900uxj52 X-Received: by 2002:a17:906:368e:: with SMTP id a14mr24194042ejc.60.1630300429088; Sun, 29 Aug 2021 22:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630300429; cv=none; d=google.com; s=arc-20160816; b=NDMStwnjVwWI/meGCtqh0jLqwWuDFOj6GvjhKU8sv/Xo9xPjiQ4yOJSQOBV7ZShzZc 53Sg3peQKhcTS2tEbgiFh7rLpsUcyoLxmsMGQZ1xLi6UZWGHEQD3oeqcLdB5rPVmwSze qbM76zdM6KhQWmNOVfLseEbteN7vkmVLV6CUTAlK6SNnimdOGByWA9+x/BfhEWwnXi4h DWvRaY/P5PrMWA4d62BET6x+6aa14lx7Wz1haFFjVTOY8TZJltYjF/tKhNkgDHtkw8Aq xwhWufP/VGVXJm1vxywCFdcb1yKfMn7DfgC2xv/pg2sEZuiRG282wZfCG1TqHySWPbNu eMWA== 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=ZsyIkvo3ox4imG72emcUl0EmBgpkfgwRRC85VKR0/Hk=; b=MPDKGrsvGjoxUzBG46Za9P3IHQQQWyzUVYFeYCKPv6HapGXPvcYlaw8+1VGuMdGVV5 dIGFfB+zE01ytzyJXFrxes1QL003OAyLUpqxKPTJfF/vtd0E7yvT+NQ05qEMd0lmw78+ CU2bGA32+fQPrmiHXM17ML8JpGP1MsbMS5hCv8xbZ1lqzjq9L3mantSTEOhUouhQ7+Rn 3oquEh4OozcFeC8zny/O1x5ChL1dlw7Q6z2pOKeT3vbz9MFv3QjoWHc+j4lK/3D5lpBd jjYTbKHbSVyj1EVnMpX1AsLthbqjlUNsWMMQUk6rmb/R5gnMYr0Sd7NCNuzy9N1iIO+B OXkA== 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 cq26si10060866edb.411.2021.08.29.22.13.22; Sun, 29 Aug 2021 22:13:49 -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 S231426AbhH3FMn (ORCPT + 99 others); Mon, 30 Aug 2021 01:12:43 -0400 Received: from mga14.intel.com ([192.55.52.115]:7792 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbhH3FMm (ORCPT ); Mon, 30 Aug 2021 01:12:42 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10091"; a="217926786" X-IronPort-AV: E=Sophos;i="5.84,362,1620716400"; d="scan'208";a="217926786" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 22:11:48 -0700 X-IronPort-AV: E=Sophos;i="5.84,362,1620716400"; d="scan'208";a="497257549" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.238.58]) ([10.212.238.58]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 22:11:47 -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: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210805005218.2912076-12-sathyanarayanan.kuppuswamy@linux.intel.com> <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> From: Andi Kleen Message-ID: <3a88a255-a528-b00a-912b-e71198d5f58f@linux.intel.com> Date: Sun, 29 Aug 2021 22:11:46 -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: <20210829181635-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/29/2021 3:26 PM, Michael S. Tsirkin wrote: > On Sun, Aug 29, 2021 at 09:17:53AM -0700, Andi Kleen wrote: >> Also I changing this single call really that bad? It's not that we changing >> anything drastic here, just give the low level subsystem a better hint about >> the intention. If you don't like the function name, could make it an >> argument instead? > My point however is that the API should say that the > driver has been audited, We have that status in the struct device. If you want to tie the ioremap to that we could define a ioremap_device() with a device argument and decide based on that. Or we can add _audited to the name. ioremap_shared_audited? > not that the mapping has been > done in some special way. For example the mapping can be > in some kind of wrapper, not directly in the driver. > However you want the driver validated, not the wrapper. > > Here's an idea: I don't think magic differences of API behavior based on some define are a good idea.  That's easy to miss. That's a "COME FROM" in API design. Also it wouldn't handle the case that a driver has both private and shared ioremaps, e.g. for BIOS structures. 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