Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp552174imm; Fri, 15 Jun 2018 02:17:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIli9Uy95/4yMmr+qdwLt9YtRn9sc4AIjEcIhTWOtwB4FVcVzRomnnWuFiEAqB+cm9X11as X-Received: by 2002:a65:6310:: with SMTP id g16-v6mr824076pgv.271.1529054242303; Fri, 15 Jun 2018 02:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529054242; cv=none; d=google.com; s=arc-20160816; b=YO1whGbEh6JtzbL5I3ppWosEZxqJoHB3CiU+/k2uloRAx5BKgm3+2H/VjbPc/N3/TR INx1f3p4N5qkMUsuQVWdhbgra9uNm1T2AVz3W2dySH01MPNZmT5mi7KYIuza2H/cJZ/v ZGSFPughPRjWw+q69jxKQFkvg2QWnyH6KdrbiHminiVtPJb+kxd7TLIy/FG4gdzKThTz VKYmjn92PnIhb9+e7JU0fx96umfEBTUUcQ5xNZJy26F+f2kfhGI3eBOURqRZ+2zvZOKy eYjN1Zb2sgeDaEnaSuOHcYFDLmV/GxFboMqO+13Z8wKP2Fn7OSBw1tidtcxSuV+aAL1D /Vwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7XGI5O/B4FOb/uJyH5vWb6+ZJbhPouCTnX2JoA+MZu4=; b=yhCj/4VLNvGDe/3ysGAuLQK6U+yorOAx+5UGI6KYboXHgf2K3YDfDQTPE72OZp8J49 HN1cbgXkNlOtevRN33VYWvGNLpMhZhCCgoxDwqzES4R6+EkVUNMEQbD/ExawT/VZW5jK NrcYFAP3//RM5usg8MTV6NjfYkZwpmRQ3XBPFxz1B4uXmoNwf27tH+u0HVy0drH8xVdi kPqLdT521YSPcwnzH7oh1aYRzU/ghjMKn8CnnoifhEhVdPf3KLS/mOxCG5eutDLhWour M/WB84pci5DgVJpS/X7i48QNScvy7FkwRBQPEC8aLVddQPpsxvKEXNSwh+3XFh8lD7x8 cJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UzKBZtwt; 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 p3-v6si7458169pld.408.2018.06.15.02.17.07; Fri, 15 Jun 2018 02:17:22 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UzKBZtwt; 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 S965595AbeFOJQd (ORCPT + 99 others); Fri, 15 Jun 2018 05:16:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46342 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965488AbeFOJQc (ORCPT ); Fri, 15 Jun 2018 05:16:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7XGI5O/B4FOb/uJyH5vWb6+ZJbhPouCTnX2JoA+MZu4=; b=UzKBZtwt9EzM4mmfrRr3DW/HH jSx8vwh98EXPXZU6mPg5Xha9UiTsDKYX1tDhG4fmA5m0jJHbGpGTNEcvJPDcW0S0FKYl9VnE394FC k0q3MibRnRiEPphyvdTF1aBznYJpgaxBjKU52w6XqLyUP7K/B3BuUg/VwFS8YaMAZ12QP/dct0BMk 7zajpTMXM9McVnylgx8Y8hkD8S8qVInByJhYSSr/pPBHQ7BqvqlBcrbFc38GmjBOSNy4zhPiNKTF3 VAhOg+3IOKNgW6zzLZsPXJC/VRJb6exjvH0M3g5SpKmLFh6IcrwVIdy7e8aaG1wcbWE/j0KxJz1hH VM18+zmWg==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTkqH-0002H6-0t; Fri, 15 Jun 2018 09:16:25 +0000 Date: Fri, 15 Jun 2018 02:16:24 -0700 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Christoph Hellwig , Ram Pai , "Michael S. Tsirkin" , robh@kernel.org, pawel.moll@arm.com, Tom Lendacky , aik@ozlabs.ru, jasowang@redhat.com, cohuck@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, joe@perches.com, "Rustad, Mark D" , david@gibson.dropbear.id.au, linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net, Anshuman Khandual Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180615091624.GA1064@infradead.org> References: <20180524072104.GD6139@ram.oc3035372033.ibm.com> <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> <20180531204320-mutt-send-email-mst@kernel.org> <20180607052306.GA1532@infradead.org> <20180607185234-mutt-send-email-mst@kernel.org> <20180611023909.GA5726@ram.oc3035372033.ibm.com> <07b804fccd7373c650be79ac9fa77ae7f2375ced.camel@kernel.crashing.org> <20180613074141.GA12033@infradead.org> <5dbcafa73b065bc619fd6adc9ef47eb6367b8378.camel@kernel.crashing.org> <10bbd7122aaa67f51de7a8328df8154212a13f23.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10bbd7122aaa67f51de7a8328df8154212a13f23.camel@kernel.crashing.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 11:11:01PM +1000, Benjamin Herrenschmidt wrote: > Actually ... the stuff in lib/dma-direct.c seems to be just it, no ? > > There's no cache flushing and there's no architecture hooks that I can > see other than the AMD security stuff which is probably fine. > > Or am I missing something ? You are missing the __phys_to_dma arch hook that allows architectures to adjust the dma address. Various systems have offsets, or even multiple banks with different offsets there. Most of them don't use the dma-direct code yet (working on it), but there are a few examples in the tree already.