Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1926392ybv; Fri, 21 Feb 2020 05:50:23 -0800 (PST) X-Google-Smtp-Source: APXvYqw3OK4BeNzs06KjRGSR9gT9bwHgVG0f22+1+psfin/UUZT/fVb4quvAK4eiZAySYk1+uPMY X-Received: by 2002:a05:6808:346:: with SMTP id j6mr2113270oie.47.1582293023719; Fri, 21 Feb 2020 05:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582293023; cv=none; d=google.com; s=arc-20160816; b=NawYq6GPHZmRFqfxzWD5LHvn4vmbys9KObYoQ7SMD+H0nEy9GpV6EGREggLv2x0OYm +2ZFq/m/3DOAGCk0VwURGNU/Kx4PR051q24pLHgw+9Xu8RvWVhKD8uo7qg9NOZPxArSr FmyrSLmeMCgnvQFYPHaJfpN/tpDhwnUWR/XY+J7LC8+LRCVGtpHY3HxEbZpwxpQcyrPd 2F6T84yxhqhVPug3HOfj6DCN1pk+Num0fB9TygKE/yzHq9uRVroX+awAL2Qvsqg9MWU6 oN1UuofVNyqRxM8nRCdIKx9i1cXzuu9ZfjZ2KftnIsAIb2akACH7UtKrwlDBEKBD3K0M LGaA== 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 :mime-version:organization:references:in-reply-to:subject:cc:to:from :date; bh=3A9u30PGDHr/QwgMNDUaG3d3HDG0Si45pFS8oijAdzw=; b=ku6LeFIOTsNT3kEx6kSIoJapkSE8Q1G8R17EcxjxU93bn7rFzzDIHNtXP8+9tCKLH0 rZ+QdlqNJ57WhGcFlu/+bh9nHsjg3VTBAdhyjWDYGHoXs4LQb3yjFy9WOF2H8gjlSFVI 1XIb+OdTKbhlddKRjXlz107kI0EtaSNzINBtpqocGS4yX8o0aybvjtf9LXelHqEDhv0b GcTRFlut1pSQq5FREJIfrV/dmNqs6epcSSBcGIwf1rnPWKKHInbgH7GPNej0a7y+ALsV 5933Jqzbs5CwxcyxROBlw0SJBj6Sg4Fn95SEXEQ7wiGzoD3610RFwi9ZTN2S9KTy0T/g Li5A== 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 u132si766800oie.250.2020.02.21.05.50.10; Fri, 21 Feb 2020 05:50:23 -0800 (PST) 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 S1728441AbgBUNts (ORCPT + 99 others); Fri, 21 Feb 2020 08:49:48 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44306 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728112AbgBUNtr (ORCPT ); Fri, 21 Feb 2020 08:49:47 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01LDe5Y8009152 for ; Fri, 21 Feb 2020 08:49:46 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yafh8t6e8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Feb 2020 08:49:46 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Feb 2020 13:49:43 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 21 Feb 2020 13:49:39 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01LDncmK46792746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Feb 2020 13:49:38 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 182E942042; Fri, 21 Feb 2020 13:49:38 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 875A14203F; Fri, 21 Feb 2020 13:49:37 +0000 (GMT) Received: from oc2783563651 (unknown [9.152.224.149]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 21 Feb 2020 13:49:37 +0000 (GMT) Date: Fri, 21 Feb 2020 14:49:36 +0100 From: Halil Pasic To: "Michael S. Tsirkin" Cc: Jason Wang , Marek Szyprowski , Robin Murphy , Christoph Hellwig , linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Christian Borntraeger , Janosch Frank , Viktor Mihajlovski , Cornelia Huck , Ram Pai , Thiago Jung Bauermann , David Gibson , "Lendacky, Thomas" , Michael Mueller Subject: Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM In-Reply-To: <20200220163055-mutt-send-email-mst@kernel.org> References: <20200220160606.53156-1-pasic@linux.ibm.com> <20200220163055-mutt-send-email-mst@kernel.org> Organization: IBM X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20022113-4275-0000-0000-000003A42EE8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20022113-4276-0000-0000-000038B83E39 Message-Id: <20200221144936.2102bcce.pasic@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-21_03:2020-02-19,2020-02-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002210106 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Feb 2020 16:33:35 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > > For vhost-net the feature VIRTIO_F_IOMMU_PLATFORM has the following side > > effect The vhost code assumes it the addresses on the virtio descriptor > > ring are not guest physical addresses but iova's, and insists on doing a > > translation of these regardless of what transport is used (e.g. whether > > we emulate a PCI or a CCW device). (For details see commit 6b1e6cc7855b > > "vhost: new device IOTLB API".) On s390 this results in severe > > performance degradation (c.a. factor 10). BTW with ccw I/O there is > > (architecturally) no IOMMU, so the whole address translation makes no > > sense in the context of virtio-ccw. > > So it sounds like a host issue: the emulation of s390 unnecessarily complicated. > Working around it by the guest looks wrong ... While do think that forcing IOMMU_PLATFORM on devices that do not want or need it, just to trigger DMA API usage in guest is conceptually wrong, I do agree, that we might have a host issue. Namely, unlike PCI, CCW does not have an IOMMU, and the spec clearly states that "Whether accesses are actually limited or translated is described by platform-specific means.". With CCW devices we don't have address translation by IOMMU, and in that sense vhost is probably wrong about trying to do the translation. That is why I mentioned the patch, and that it's done regardless of the transport/platform. Regards, Halil > > > Halil Pasic (2): > > mm: move force_dma_unencrypted() to mem_encrypt.h > > virtio: let virtio use DMA API when guest RAM is protected > > > > drivers/virtio/virtio_ring.c | 3 +++ > > include/linux/dma-direct.h | 9 --------- > > include/linux/mem_encrypt.h | 10 ++++++++++ > > 3 files changed, 13 insertions(+), 9 deletions(-) > > > > > > base-commit: ca7e1fd1026c5af6a533b4b5447e1d2f153e28f2 > > -- > > 2.17.1 >