Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp867191imm; Thu, 31 May 2018 10:45:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIGX5j2urzaXz4cVyjOLanKNpKI/zpxhO4FJ39YqmhWCc0BTDJq/HWNyFxPBakugMpFuZqD X-Received: by 2002:a17:902:43:: with SMTP id 61-v6mr8019054pla.112.1527788734097; Thu, 31 May 2018 10:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527788734; cv=none; d=google.com; s=arc-20160816; b=wcCbLR0aH3J6+dJJfgK2149vdCJIGutAFkl2xCehYVi9JIClZ2lW3ymBTXJQy6Z1n9 c76qblbYNOP9oBUdTh9EUE+t1QWizdtrscogtDIeme2lfovZr24iTeh6YQC61b6JsIbo 3W3jx6Q2fnqW9fsD/vlPpW7SdeOIcSyEcRtm8tEQ3zeGrprVWH9vpLdPav5bwVajbxE7 8PvQbLhgfPamUnWGGyonozCByGuaG9uks5lw214ksVi/AadalIOanE7wXuvnCgpDhHFa cnyus0PwEw4n6cTmxku5UBaJ7GvUHmL3+qwcuIDcOABhPrnP0+ymNFa6JnGItSo2uj3c hliw== 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=EEvGMerg8/Wo5sMa/Y9Qxa7jhZ3CuT3FofXdXPKApBo=; b=HwFR6Aned/wAu29PUmU/XkyBjAS3ySBJv8T3XPrLOW0jXj6VZ4zqABB1xN1TTEMomn 9KQ066VMB0DozLvUblkS7xo6mBJBPE9w7TJSFu+xANJ9BcSUtxU4CmUEjqPUvMWZ3BCj tMlM6PkXkaFlll++3ahWsOEuiZ0QT0x1VNPZacuVf3rqAjovzAAYfCKHt2TxvxJ0Pm5a s82Kf9SP9jcR9nnCNUU+clk+TLhMKbGLNAgnlDaMYec0Y5QUEe70tuWjYYDwF4B/RHx5 Pqu6oLxTFCS6D3cGIhC3Kb5vrKv/jKolIcpNNzM+2v+wkBuSjNg7ZTiXq4cbEDDXfMlu /Log== 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 s13-v6si36512626plq.464.2018.05.31.10.45.19; Thu, 31 May 2018 10:45:34 -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 S1755948AbeEaRoC (ORCPT + 99 others); Thu, 31 May 2018 13:44:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755719AbeEaRoB (ORCPT ); Thu, 31 May 2018 13:44:01 -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 A0A1C40201A0; Thu, 31 May 2018 17:44:00 +0000 (UTC) Received: from redhat.com (ovpn-121-148.rdu2.redhat.com [10.10.121.148]) by smtp.corp.redhat.com (Postfix) with SMTP id 908381134CA6; Thu, 31 May 2018 17:43:58 +0000 (UTC) Date: Thu, 31 May 2018 20:43:58 +0300 From: "Michael S. Tsirkin" To: Anshuman Khandual Cc: Ram Pai , robh@kernel.org, aik@ozlabs.ru, jasowang@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, hch@infradead.org, joe@perches.com, linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net, david@gibson.dropbear.id.au Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180531204320-mutt-send-email-mst@kernel.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180524072104.GD6139@ram.oc3035372033.ibm.com> <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> 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.6]); Thu, 31 May 2018 17:44:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 31 May 2018 17:44:00 +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 Thu, May 31, 2018 at 09:09:24AM +0530, Anshuman Khandual wrote: > On 05/24/2018 12:51 PM, Ram Pai wrote: > > On Wed, May 23, 2018 at 09:50:02PM +0300, Michael S. Tsirkin wrote: > >> subj: s/virito/virtio/ > >> > > ..snip.. > >>> machine_subsys_initcall_sync(pseries, tce_iommu_bus_notifier_init); > >>> + > >>> +bool platform_forces_virtio_dma(struct virtio_device *vdev) > >>> +{ > >>> + /* > >>> + * On protected guest platforms, force virtio core to use DMA > >>> + * MAP API for all virtio devices. But there can also be some > >>> + * exceptions for individual devices like virtio balloon. > >>> + */ > >>> + return (of_find_compatible_node(NULL, NULL, "ibm,ultravisor") != NULL); > >>> +} > >> > >> Isn't this kind of slow? vring_use_dma_api is on > >> data path and supposed to be very fast. > > > > Yes it is slow and not ideal. This won't be the final code. The final > > code will cache the information in some global variable and used > > in this function. > > Right this will be a simple check based on a global variable. > Pls work on a long term solution. Short term needs can be served by enabling the iommu platform in qemu. -- MST