Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1444164imm; Fri, 15 Jun 2018 18:10:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIuwoeVt82f0PUSivzOo6LulFwZ5gcFOGOteW0DPJpxz7bqXSmVvmJ+HkcxiPDoBBr8fADC X-Received: by 2002:a63:8f0d:: with SMTP id n13-v6mr3680761pgd.109.1529111404513; Fri, 15 Jun 2018 18:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529111404; cv=none; d=google.com; s=arc-20160816; b=IchzNdTxGgiBETwD2ib/C2gnLNiXZU/oBhTCV7CF/qphjPO3BVqJ6CFF8CcKLGTj9V ZZx2yHWxUpJ0fxe2k/R0/epwg8b1cOpfekQtJ76Jge0sexWR1HKeEXqRUuSxt82NC6pA S7hV4Z+1r/lwWpLbH+2b+jFUuy966HreplGt+ZDJEXBmsT2+I7ftUJgK0sX3dRo8oi+J gUDj6yLX4+iXW83rW2WLnEGe/nhhJvptxHdRP0qFLmFSWpSDYrBZHdMxTdyiioeHEt/6 RGv6Wg1MbZJ5pgDZTUkZmb2d74Cp2umRLWtyKLpBQA52OmnF4YATcWFGYHjeFTFmRsIq 1fYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=reQOGrY1DY/s1/IQnjoGSkIe69olM7F780Ln/kDIghc=; b=zjPxVCOEaQFWHBWfyLoDSWxPQjrHaZ1P8VlPg5AgnT+EL85D8G5TVZvlqeViYKG5wQ d+Z4rUxpvT+sCylEye5NEpHcTHZ41t73NV73J3LzFwZcreREmwRSRUQa5JzipwJ2KP6n 6+9B4m5l0KbkLZ9L10dosNnbBw4/hej+p3DVVXkaDbatt1sc5yXlTNybKZpARyNQr37f NRJdTHd4B2MfrghH7I43uKjkldaPdRq/Sp+4LQl4dyqh/jgU3npcrnJgX37Fa3zhdZ+e EB67vGX7/rQdV3KR6pGW704B+/5v8d9/J1RWkrNXWPOg+rkq1ER2g85eRMlpgBo+VjCq f2OQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g19-v6si7554455pgv.127.2018.06.15.18.09.46; Fri, 15 Jun 2018 18:10:04 -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; 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 S1756164AbeFPBJT (ORCPT + 99 others); Fri, 15 Jun 2018 21:09:19 -0400 Received: from gate.crashing.org ([63.228.1.57]:36427 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753724AbeFPBJS (ORCPT ); Fri, 15 Jun 2018 21:09:18 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w5G17OqR030994; Fri, 15 Jun 2018 20:07:25 -0500 Message-ID: <1b4732c5015ee4377fef1de0270065174cde397a.camel@kernel.crashing.org> Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices From: Benjamin Herrenschmidt To: Christoph Hellwig Cc: 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 Date: Sat, 16 Jun 2018 11:07:24 +1000 In-Reply-To: <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> <20180615091624.GA1064@infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1 (3.28.1-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-06-15 at 02:16 -0700, Christoph Hellwig wrote: > 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. Ok and on those systems, qemu will bypass said offset ? Maybe we could just create a device DMA "flag" or (or use the attributes) to instruct dma-direct to not use that for legacy virtio ? Cheers, Ben.