Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3425962imm; Tue, 29 May 2018 07:05:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq3DnfK54dZukN7vP1jOyli13g1TlXyYIMOqD9VWKdGaHBaF9cVHevt7+R1cL2AeCywTQQf X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr17545038plk.96.1527602749266; Tue, 29 May 2018 07:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527602749; cv=none; d=google.com; s=arc-20160816; b=K9VuDMPvBfAuXU0vRRhwWC3gMMQQEwje8GFGCHtAXcgFXVLVxfEYeo9uRBdj2hCrW5 uI6CJhrwJVVPPOTeKc/xTdLw48j014eOKJrjVg8sSekmY+BrE+qXHksCo1vuT29p+ckD RaFF2Pn3gpxqr8c9n/rpGsGGeigSy7iki5nltr6zUfXR7Kp/pTNXapYCbaXdFlM/wzrI NDarmITu9SyBbTLmoaAKR5crKbuW+R4ZFo2jJUr0LCQm6re9R/qlccIdw7aOpuMYSNzH vT1vYf+A9SknpLJqKCkbgR5KqPxeGt73DYHTaJb6/IeDywUN6tYSGzdsh5SxkqYjAWZC sUxg== 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=gDw7kawjZhsxavSNe6IkePaTN8XB7roh88iMcl4gNSA=; b=FN86UjNhnEzoHS7OskD6+TjVZfPRrEcjvVjujpScs7co52sF7W7wHIKE0bvH5Eo447 CEs6QpbsBvbqrNF6YSg0sVy7OsSnJs57qRz0ugArdWu6Bv1DYHZf3Z04FoJMxrSwIkke muGVLf1IYMVn65MRYyT83dtUVCS3cMN1Sob4bFnaG8Ba+dKuDgo1awPej2L4kOfWN+dg NA47/te4POCH92syB1V4IF840+vtrlKOo4/28sS0LGJRzGZpJAWs3x0rhV6/bF4hb72u yHlw6na/rOWrZkBckqkZizXXCxH+7tizZYud7wHWBbEPaiSqAfDoil67i052D8bOeQSw SUwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JljQgTQD; 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 e11-v6si25646358pgr.423.2018.05.29.07.05.34; Tue, 29 May 2018 07:05:49 -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=JljQgTQD; 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 S934906AbeE2ODZ (ORCPT + 99 others); Tue, 29 May 2018 10:03:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45650 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934751AbeE2ODY (ORCPT ); Tue, 29 May 2018 10:03:24 -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=gDw7kawjZhsxavSNe6IkePaTN8XB7roh88iMcl4gNSA=; b=JljQgTQDE7XJLD4DG3HLHnSd3 Q9w6PlqhbOJxL3YbwCaBtWz4ERd+a2wDUkgopAViApgBxtWY+sPNNcbWYMXOiYjUH/ern9q6SD6N0 WjdAlhbzU0XPyy1d8Vqzxy464+kCuKLlG4UtzvBTImPa3zQ0LLKK3p4RyhmlxTooPWcxedVdOVN5z onThA4jQXLfV6FvYrO22kT47yfj3KkAsnPOlRXIRABpBZftGNOCfmtj35gmsba2N+6vae30/44MCV BQ8Doy7gNwtWsMbgeTzmmBPSSAC4AEs2RqB7+TClT7FAW6nTqwpnYCSVXedL2muS33GI8MUH7Wkv5 r0RtnEuig==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNfDc-0006if-97; Tue, 29 May 2018 14:03:20 +0000 Date: Tue, 29 May 2018 07:03:19 -0700 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: "Michael S. Tsirkin" , 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, hch@infradead.org, luto@kernel.org Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180529140319.GA19972@infradead.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180525202300-mutt-send-email-mst@kernel.org> <6fff9f5d67361653e6072570a857cf0d1009a123.camel@kernel.crashing.org> <2f1d48cf029c1f0903f3cffea946ae5b85f60ec0.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f1d48cf029c1f0903f3cffea946ae5b85f60ec0.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 Tue, May 29, 2018 at 09:56:24AM +1000, Benjamin Herrenschmidt wrote: > I don't think forcing the addition of an emulated iommu in the middle > just to work around the fact that virtio "cheats" and doesn't use the > dma API unless there is one, is the right "fix". Agreed. > The right long term fix is to always use the DMA API, reducing code > path etc... and just have a single point where virtio can "chose" > alternate DMA ops (via an arch hook to deal with our case). Also agreed. When Andi added vring_use_dma_api it was marked as temporary. So I'd much rather move to blacklisting platforms that needs this hack now than adding another exception. And then once we have the blacklist move it to a quirk in the arch code that just forces dma_direct_ops as the per-device dma ops. I don't really think this is crazy long term, but something we could do relatively quickly. Interestingly enough the original commit mentions PPC64 as a case where this quirk is needed.