Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2027010imm; Sat, 4 Aug 2018 17:11:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeV3VMTxbl7zRBqGc9zksvOEcwOFdXf3qxeqa4iOOeHzkVZXNwexAkGvy6rgbf6XAcGTZbK X-Received: by 2002:a63:220d:: with SMTP id i13-v6mr9401955pgi.212.1533427864511; Sat, 04 Aug 2018 17:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533427864; cv=none; d=google.com; s=arc-20160816; b=ijqsdmabLKkIySj0hTmWCJxN/MWY5SdvvUOeIpi8mHj2AldkwgTPsu22CnLFOtf5om tVhaKwKf8efZjin58+5f8CETm6BgGUrb0E/tOXfsJkxHBnrXk1/HrS5DeioXEKks5UKa wHayMfgwlzbLIGlcM+ESFEbm5gbSbD/XEld/cwyULAqP0J7e9oo662rdUGJ1/BtVfBPj TivJvcxlmyf3JgFeykZOo/UsNNlUXqTS6pCEf9hTSjY53goTXsKZxg0SWHWl0lyQwLW7 Joj9BS/Hry44N58yRR6N6wpUELaJq8ueXZpkng9jHoKF81zS6+PQVax5jIF8lpQpP5vW qwqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=CsidgOTrmwXxXq6mLYXRczAoSH0VZBODr6ykhLkGz/4=; b=wC+NcEJaYauAl/BNjrRcqm5L9mdLlXA1b/2TWUS5xDl0eQfeu2qmulZsHDChlW+uFe v3YlcDeLB0T7pwVH2/jmccDpy3f/MeAc2zCNWaVLMiHcGpOqpfOFr4PPCLVRWZu66JeT l5qjCYH2B/GQuvVUffRmD/A9b4z2dOZZwbYfEJj6qYy6KFGGCCXKUuMeHif7v5rzLFgw 8ERi7j5MDVruBBdeY0rImtJtu3sKvk4AoMaIloBM4IpQLVZRnGy7XYUqchjuVB//GpFA bMHwHCIDrKPHXmqb3ofFiRZ8X6tUMSEQ13iYYoGh6vVtEhRLLdckiUiB9kxDYGi7KMHP iVvA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21-v6si7918367pgn.222.2018.08.04.17.10.49; Sat, 04 Aug 2018 17:11: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729838AbeHECMa (ORCPT + 99 others); Sat, 4 Aug 2018 22:12:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729690AbeHECMa (ORCPT ); Sat, 4 Aug 2018 22:12:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4ED74400E978; Sun, 5 Aug 2018 00:10:02 +0000 (UTC) Received: from redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with SMTP id DA0731055461; Sun, 5 Aug 2018 00:09:55 +0000 (UTC) Date: Sun, 5 Aug 2018 03:09:55 +0300 From: "Michael S. Tsirkin" To: Christoph Hellwig Cc: Benjamin Herrenschmidt , Will Deacon , Anshuman Khandual , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, aik@ozlabs.ru, robh@kernel.org, joe@perches.com, elfring@users.sourceforge.net, david@gibson.dropbear.id.au, jasowang@redhat.com, mpe@ellerman.id.au, linuxram@us.ibm.com, haren@linux.vnet.ibm.com, paulus@samba.org, srikar@linux.vnet.ibm.com, robin.murphy@arm.com, jean-philippe.brucker@arm.com, marc.zyngier@arm.com Subject: Re: [RFC 0/4] Virtio uses DMA API for all devices Message-ID: <20180805030326-mutt-send-email-mst@kernel.org> References: <26c1d3d50d8e081eed44fe9940fbefed34598cbd.camel@kernel.crashing.org> <20180802182959-mutt-send-email-mst@kernel.org> <82ccef6ec3d95ee43f3990a4a2d0aea87eb45e89.camel@kernel.crashing.org> <20180802200646-mutt-send-email-mst@kernel.org> <20180802225738-mutt-send-email-mst@kernel.org> <20180803070507.GA1344@infradead.org> <20180803221634-mutt-send-email-mst@kernel.org> <20180804081500.GA1455@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180804081500.GA1455@infradead.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 05 Aug 2018 00:10:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 05 Aug 2018 00:10:02 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 04, 2018 at 01:15:00AM -0700, Christoph Hellwig wrote: > On Fri, Aug 03, 2018 at 10:17:32PM +0300, Michael S. Tsirkin wrote: > > It seems reasonable to teach a platform to override dma-range > > for a specific device e.g. in case it knows about bugs in ACPI. > > A platform will be able override dma-range using the dev->bus_dma_mask > field starting in 4.19. But we'll still need a way how to > > a) document in the virtio spec that all bus dma quirks are to be > applied I agree it's a good idea. In particular I suspect that PLATFORM_IOMMU should be extended to cover that. But see below. > b) a way to document in a virtio-related spec how the bus handles > dma for Ben's totally fucked up hypervisor. Without that there > is not way we'll get interoperable implementations. So in this case however I'm not sure what exactly do we want to add. It seems that from point of view of the device, there is nothing special - it just gets a PA and writes there. It also seems that guest does not need to get any info from the device either. Instead guest itself needs device to DMA into specific addresses, for its own reasons. It seems that the fact that within guest it's implemented using a bounce buffer and that it's easiest to do by switching virtio to use the DMA API isn't something virtio spec concerns itself with. I'm open to suggestions. -- MST