Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp167188imm; Wed, 30 May 2018 20:41:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdjOqmoXjyyximBa+8LKMtL5FwzJTmlc0wzD7JdXQR5z3EyN31MKxMnAXMYIlH44TIsWRy X-Received: by 2002:a17:902:7082:: with SMTP id z2-v6mr5241524plk.373.1527738084514; Wed, 30 May 2018 20:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527738084; cv=none; d=google.com; s=arc-20160816; b=m66nrnUT9ew5qZ3prFV0Muq7PY8x5k5wr9Yz67ICo31b7KSxrnSZu+8bvAiS0VpPjZ wSDXsCtPa5aQIM2j/stCeECeJDq3yl9qXvPk193jtciWQI6+6CIzwDsHMinL7uAp/A/p FHkh+lBZzMPt9tor1ngNZ/yQjFP0y3jAlUBwLexA01ZNLDuT5Jns+O3l/pIezHNDbBkl +UzAY+FXUQdqqQ5FioDMxQA7vk8NcD1eFjmgACfR0IdZdlrXl0v/LX+xhRh4eG/7lavL 8TiOHckZccW0/lEHaAVmuanWDlo0QsutZun1NIQnYPEyxdVKP0oe+JM+otXyNG0N9hzf snJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:cc:references:to :subject:arc-authentication-results; bh=ufX//o8RozlQblX2QrgE8eKIoGX7LMAyWWsH+Q63ZSk=; b=BbKHQg9s/8f9ry9yICIl/PLqx4P7OCLEl3dJAd9filihsEeY/39mZ20cDC7fBRZqN4 soO0YoCN30pIq0OYW5EKjoK6B84cVVYWDU1jXE6zUk2uAevsL0HbtBiniXWl+ckVtZDf zVN3kWmAt+sGnJBwi3V008yvcPTiuG9E/UtNerdJLqxzZGPzN2W15pvRRTSSQDPn2yEi dJImVV8hv64Ye2Q/aNelyBsa+TgXDYa2Ds3BCubMtARBkETbf2mMkmJIewfc87cDDrHH ROrhe0cRxN2rZHJiZAnhInD1hJeGs3IfDcUs8t+uJjVQsdutJQOEmDA2xpkEQHLWYrqS mEMQ== 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 o3-v6si36320811pld.50.2018.05.30.20.41.10; Wed, 30 May 2018 20:41:24 -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 S932748AbeEaDjh (ORCPT + 99 others); Wed, 30 May 2018 23:39:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60600 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932735AbeEaDjf (ORCPT ); Wed, 30 May 2018 23:39:35 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4V3cth5165426 for ; Wed, 30 May 2018 23:39:34 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ja4vb8m44-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 30 May 2018 23:39:34 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 04:39:32 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 04:39:27 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4V3dQS923593040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 03:39:26 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F67B42042; Thu, 31 May 2018 04:29:57 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79A3C42045; Thu, 31 May 2018 04:29:55 +0100 (BST) Received: from [9.202.15.56] (unknown [9.202.15.56]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 04:29:55 +0100 (BST) Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices To: Ram Pai , "Michael S. Tsirkin" References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180524072104.GD6139@ram.oc3035372033.ibm.com> Cc: 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 From: Anshuman Khandual Date: Thu, 31 May 2018 09:09:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20180524072104.GD6139@ram.oc3035372033.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18053103-0008-0000-0000-00000242325B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053103-0009-0000-0000-000021A7DB8F Message-Id: <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-30_10:,, 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=907 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310039 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.