Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1779252imm; Thu, 24 May 2018 00:22:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo332cz7wiUK9zT//HSEN2XZfHUvcqB3gqPtb0ztY8GozyLVSHQ0uXCB+bSv4UOkA6AW+cA X-Received: by 2002:a65:6645:: with SMTP id z5-v6mr4922058pgv.43.1527146537835; Thu, 24 May 2018 00:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527146537; cv=none; d=google.com; s=arc-20160816; b=zH9by/cfmSn9Ft1MFWNM4BMYQ1VK/byA1tmJiFzHY0zxWIJzH8vxm1fY2+GBdHatbG vKvK2PB/hih5qTZyGq0Mv1oo/cbdJrwW7itSuESrpnsumlgQvcOyPEMMQ2TbfuhOT6x1 XyxD9xiRWSDqVtuqOHFv796HQfq3i0YnbYnk6f55jb0TLtNJiJMG+lZ7vuJOSIf2VpE0 5PTYWL6E3LbLTHjgc0MOD2wQZn9aFATjiG1+Ld9sbVcvk2KCM4Owc0LxtrzuFDJpIVVh LqEbRCSNGXPSBkZ6mGcT0U9DPSgMmc3ziyZXCz+LMtPLzYI7q8Zpv7Ec5x6odrLSgXQc /B/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:message-id:user-agent:in-reply-to :mime-version:references:reply-to:subject:cc:to:from:date :arc-authentication-results; bh=X+AK245w/sTmyxfo8VOItS7je20dOJgeCq2GJVU0rPk=; b=Wz0r018a00dzGVHBLv3XImzyP1KbMKuKUKjkzjtj0G12bPdCriUCAiBLuhG6onjqQK q9RfTJEImcQIgOtAsxcCyYHdBk+lpl8J5v3I1OVLc2j24TmpiUyswBH0iaugu1LNj9UL nlhZg3LLde2ux8y3QGwo26B8zLu3HCv8xRCF2QMmzG3dWoiAGSWNM/eNcQcd2kUWWkgl bZnh3hHRvLa8CNDeTnPCRol1i2LcBYBJWd9IMyzTc7sCgd2QGYwEvGvR8nOmOrCQwFKJ 9t2yn2fsnT6BPBp9fhlElvOMG44MPgM0uW+rTTC5CNsgg77hyp0BtAMCfkV81F/6rpSS RMlA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8-v6si20444104plo.306.2018.05.24.00.22.03; Thu, 24 May 2018 00:22:17 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964969AbeEXHVV (ORCPT + 99 others); Thu, 24 May 2018 03:21:21 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49170 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964885AbeEXHVT (ORCPT ); Thu, 24 May 2018 03:21:19 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4O7JLCd086586 for ; Thu, 24 May 2018 03:21:18 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j5rgms33s-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 May 2018 03:21:18 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2018 08:21:15 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 24 May 2018 08:21:11 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4O7LAE01245598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 May 2018 07:21:10 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D13BA404D; Thu, 24 May 2018 08:12:29 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 360CFA4053; Thu, 24 May 2018 08:12:27 +0100 (BST) Received: from ram.oc3035372033.ibm.com (unknown [9.85.199.155]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 24 May 2018 08:12:27 +0100 (BST) Date: Thu, 24 May 2018 00:21:04 -0700 From: Ram Pai To: "Michael S. Tsirkin" Cc: Anshuman Khandual , 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 Reply-To: Ram Pai References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: <20180523213703-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 18052407-0008-0000-0000-000004FA92B9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052407-0009-0000-0000-00001E8E995A Message-Id: <20180524072104.GD6139@ram.oc3035372033.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-24_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805240090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. However this code was added to the RFC to illustrate the idea that dma operation are needed only in a secure/protected environment. RP