Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1295620ybv; Thu, 20 Feb 2020 17:19:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyyDNLLNU4TIt1/PYyyf4hnsIiY6yjmRUAFbahSPsNudBgZwlHoby0Ukm5bb7wfFMb7cY6j X-Received: by 2002:a9d:664a:: with SMTP id q10mr24739793otm.298.1582247963739; Thu, 20 Feb 2020 17:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582247963; cv=none; d=google.com; s=arc-20160816; b=jXl9R1qqVpTB/eJ9fOyQ/f8Vg9UQ9LQV2+p201/dmyt3IQZT+BuTSwJetu0LJaEDQ0 cQMH9zmQk9VBQQSNyVqIk8IyDO0w/yXakZiKRjBhzJ/Ez3wkCQAzUX+WJnrZwPalVOHY 0BRUyun/FR8WmTTA1hc7ApYNe01VEV0WtlRcPjZewY3mKvzpImqt2wW17W/jQry4Gyvo IPfi60NxMNHLNJXuGA71tnrJufSJZ+krX74ePk+P4altKNrLCY544jrc8AWLs1ZOKTDC biHTjhWCXrSd+5Y//eKuX7+tl0HiyN8Mnj5JdZoqmaAxLOBACUc292ME04sYxKeM/A2t 6c1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:cc:to:from :date; bh=LIiHQcfwb9+8AoAoeO6Vil5mamPe6Ey4/YwtdSp+tek=; b=E2gTNIOrtxO32UINfgiNkCdmtTksO/XQ6t2Wbw3p1jUE1UrQqDnCxDzjb2D2OIiKgR bvYBJzjmZ314hBuSzWnwXaI6qT2PCl8ZYBKim5C9Zg42brEXEmV/lBh7Bw1nqR/K61Zg 3nGqetHwAVeAU2YJdDZ9O36zBWofkp19MDR6gUYmLoBky3QgC4Jt8PHDTs0VmTCqzhHh 1U+SssVs62eUbtG8C8yijCq/lvIAkw2TaWSrAF4hcnnkOXQIfpJyY9vpPzH4a88WsRWn 6ddTXbo6/BAUzmlD1a7Rgl17WNYCerc06yCvTAy3ZbZC2WMQXyJ1bFlRs+zzWR2JkFlw wUeQ== 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 f62si16029oib.131.2020.02.20.17.19.11; Thu, 20 Feb 2020 17:19: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 S1729543AbgBUBSE (ORCPT + 99 others); Thu, 20 Feb 2020 20:18:04 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:15260 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729476AbgBUBSE (ORCPT ); Thu, 20 Feb 2020 20:18:04 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01L1AES3058501 for ; Thu, 20 Feb 2020 20:18:03 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y9ytr1e7k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Feb 2020 20:18:03 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Feb 2020 01:18:01 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) 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 01:17:57 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01L1HtsE41419040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Feb 2020 01:17:55 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C748D4203F; Fri, 21 Feb 2020 01:17:55 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C2A642045; Fri, 21 Feb 2020 01:17:51 +0000 (GMT) Received: from oc0525413822.ibm.com (unknown [9.85.188.83]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 21 Feb 2020 01:17:51 +0000 (GMT) Date: Thu, 20 Feb 2020 17:17:48 -0800 From: Ram Pai To: "Michael S. Tsirkin" Cc: Halil Pasic , 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 , Thiago Jung Bauermann , David Gibson , "Lendacky, Thomas" , Michael Mueller Reply-To: Ram Pai References: <20200220160606.53156-1-pasic@linux.ibm.com> <20200220160606.53156-3-pasic@linux.ibm.com> <20200220154904-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200220154904-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 20022101-0016-0000-0000-000002E8C975 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20022101-0017-0000-0000-0000334BE816 Message-Id: <20200221011748.GE5713@oc0525413822.ibm.com> Subject: RE: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-20_19:2020-02-19,2020-02-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 clxscore=1011 mlxlogscore=989 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002210006 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 03:55:14PM -0500, Michael S. Tsirkin wrote: > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > Currently the advanced guest memory protection technologies (AMD SEV, > > powerpc secure guest technology and s390 Protected VMs) abuse the > > VIRTIO_F_IOMMU_PLATFORM flag to make virtio core use the DMA API, which > > is in turn necessary, to make IO work with guest memory protection. > > > > But VIRTIO_F_IOMMU_PLATFORM a.k.a. VIRTIO_F_ACCESS_PLATFORM is really a > > different beast: with virtio devices whose implementation runs on an SMP > > CPU we are still fine with doing all the usual optimizations, it is just > > that we need to make sure that the memory protection mechanism does not > > get in the way. The VIRTIO_F_ACCESS_PLATFORM mandates more work on the > > side of the guest (and possibly he host side as well) than we actually > > need. > > > > An additional benefit of teaching the guest to make the right decision > > (and use DMA API) on it's own is: removing the need, to mandate special > > VM configuration for guests that may run with protection. This is > > especially interesting for s390 as VIRTIO_F_IOMMU_PLATFORM pushes all > > the virtio control structures into the first 2G of guest memory: > > something we don't necessarily want to do per-default. > > > > Signed-off-by: Halil Pasic > > Tested-by: Ram Pai > > Tested-by: Michael Mueller > > This might work for you but it's fragile, since without > VIRTIO_F_ACCESS_PLATFORM hypervisor assumes it gets > GPA's, not DMA addresses. > > > > IOW this looks like another iteration of: > > virtio: Support encrypted memory on powerpc secure guests > > which I was under the impression was abandoned as unnecessary. It has been abondoned on powerpc. We enabled VIRTIO_F_ACCESS_PLATFORM; by default, flag on powerpc. We would like to enable secure guests on powerpc without this flag aswell enabled, but past experience has educated us that its not a easy path. However if Halil makes some inroads in this path for s390, we will like to support him. RP