Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1471325imu; Wed, 28 Nov 2018 10:02:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/VtWlvkX/Bmk55sUY09LMsVlZJJRx573LVc9JmGqZryA2ZM8cEf398OqT4xPIMA04Yw5c16 X-Received: by 2002:a63:1204:: with SMTP id h4mr34009614pgl.51.1543428132095; Wed, 28 Nov 2018 10:02:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543428132; cv=none; d=google.com; s=arc-20160816; b=0f0CAXjL/3aaiZPX+d9oIzHZNtiy8zoiA4vG9tuYdPG4DYW8wmYByop3z0r2ggh6D+ dpdamJJT6o5RKrrwnhb7X1Ra/xQ8u3cVbCgWw+8ErJO1Vx2/0ks0DESQn6auVh5Goxm4 4FlBvuYG4lJkdOyETH4zETGqm0j4rRi74cbGlFUYXetv47wtOH+hjrkBacM7+jforgaM +aAc34BAF6eSFvEdxHXLvE9/j9msBavtX/nVuTHgbC3IAU1YMi0LXLXeg+YR/7atIx/w CaE9VrrEZug34W5sCtdDjK5+wXBfTl++yZcBYW961BOnFfFt32kgliRo5Woih3S49brg HWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ESkwdHBBDasYizEIp40J7493QYQPcDQi32FjrB5LM38=; b=OhAZ9EuYSy4IKuI2XM+MKQg9sJ8j1/jlZZ+vGKAebI+P0slpR6N/QkB5111OQRBVYG SGjMU/BtDsVHCPbNN6RXe5F6wLTzjieJCSDu6TZ4ugiMcWbrYMbRsIVtp25qHD5Zq8rC 3lGqx4YH7M9PNzkFoVyRpxdiwnCAIc33PvgIXNNL/CUt3plgShLyeJgALF7/w/ehTIYV 4O3SRAXclyMND9zH10Ce6UMFbCh7iNOltQqyWhnEA3fLfXKFg2P9maOljWuSFkcdnG5M p3ULcCUkxdioEEgbZ8dLHImFSAQNBSqABeOH95FrucJDZ31X/JDx/xJxtq9YClOBukpJ U2zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ElBEfMzs; 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 u4si7812984pga.91.2018.11.28.10.01.51; Wed, 28 Nov 2018 10:02:12 -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=@linux-foundation.org header.s=google header.b=ElBEfMzs; 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 S1727047AbeK2FCz (ORCPT + 99 others); Thu, 29 Nov 2018 00:02:55 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33844 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725266AbeK2FCz (ORCPT ); Thu, 29 Nov 2018 00:02:55 -0500 Received: by mail-lf1-f66.google.com with SMTP id p6so20072713lfc.1 for ; Wed, 28 Nov 2018 10:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ESkwdHBBDasYizEIp40J7493QYQPcDQi32FjrB5LM38=; b=ElBEfMzsPx+DweVR8IVClFnR3MS28XOgn5rhuriDmS4mK9Lmr4ytbx9nIEu026kwAo iqUtNEVKmggXCmEV2uxk655ZI1Re3dhqjrcZF4uxRtP0ggO3/CUo3Aug+F0auWcb3sEW hc5bgqxvFNOAfIU9IKuVgmAFJHREPOkY+cbjQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ESkwdHBBDasYizEIp40J7493QYQPcDQi32FjrB5LM38=; b=JRSlbtSTAN76yv4HOTLmcMw1GK4+quDnw5G1zIiJlWfFB+S6JjvfvCRNExSWpxTf6/ ymAGPlDYd3pQDaHZXB/pu0bWbYyT6sqj7kfW/5gg7iu/tJQSFge6EBcU8032kRoDCDtF MpW0YwKBfz5WrQ5TrI9ky0RPHA1Je/WoVIv+W1pT75ZDniJ5V0Sin7eglWQvOscKnRI7 LnM8RfMFnYQj+zrcqGcvX80+DSgOAXBMuJ+H8NEy7ghiLl8jQiYqGkLI4fQhGxmcHbBQ EB+DpqDsOi8hOOMmX9c25fZ/gduX/hhrAMoAQbcZ+r+KuGmVVXOZmBZzlWaODotEGLIO LHxA== X-Gm-Message-State: AGRZ1gLCtnPNcWeyqxQJJUHJfXHbDVRCfffcYcYr3NX0/62Eb8+YEyIH cfHEiVf5Ab/lm2m4OOlF08eonjS77J8= X-Received: by 2002:a19:24c6:: with SMTP id k189mr23108470lfk.77.1543428024933; Wed, 28 Nov 2018 10:00:24 -0800 (PST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id y9sm1300191lfe.75.2018.11.28.10.00.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 10:00:23 -0800 (PST) Received: by mail-lj1-f177.google.com with SMTP id l15-v6so24263269lja.9 for ; Wed, 28 Nov 2018 10:00:23 -0800 (PST) X-Received: by 2002:a2e:9983:: with SMTP id w3-v6mr25570388lji.133.1543428022781; Wed, 28 Nov 2018 10:00:22 -0800 (PST) MIME-Version: 1.0 References: <20181122140320.24080-1-hch@lst.de> <20181122170715.GI30658@n2100.armlinux.org.uk> <11829e3c-7302-f821-cf5c-863e5267a17b@arm.com> <20181123065511.GA17856@lst.de> <20181128074117.GA21126@lst.de> <20181128174545.GJ30658@n2100.armlinux.org.uk> In-Reply-To: <20181128174545.GJ30658@n2100.armlinux.org.uk> From: Linus Torvalds Date: Wed, 28 Nov 2018 10:00:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: remove the ->mapping_error method from dma_map_ops V2 To: linux@armlinux.org.uk Cc: Christoph Hellwig , linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, robin.murphy@arm.com, "the arch/x86 maintainers" , Linux List Kernel Mailing , iommu@lists.linux-foundation.org, linux-alpha@vger.kernel.org, xen-devel@lists.xenproject.org, David Woodhouse , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 28, 2018 at 9:45 AM Russell King - ARM Linux wrote: > > > I don't think this is a huge deal, but ERR_PTR() has been hugely > > successful elsewhere. And I'm not hugely convinced about all these > > "any address can be valid" arguments. How the hell do you generate a > > random dma address in the last page that isn't even page-aligned? > > kmalloc() a 64-byte buffer, dma_map_single() that buffer. No. You already cannot do that kmalloc(), exactly because of ERR_PTR(). Not all memory is accessible even to the kernel. If you have memory that shows up in the last page of phys_addr_t, you just mark it reserved at boot-time. Which is what we ALREADY do for these exact reasons. If the DMA mappings means that you'd need to add one more page to that list of reserved pages, then so be it. The whole argument of "every possible piece of memory is DMA'able" is just wrong. Linus