Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6449204ybc; Wed, 27 Nov 2019 23:08:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyNVS5CAxKQBOQjEdWLqkAYV2B9/UKpVXGGmwpgP8nYMTX7z6YCI4+haZwblrRKxmbsrUk3 X-Received: by 2002:aa7:cb58:: with SMTP id w24mr171764edt.11.1574924902334; Wed, 27 Nov 2019 23:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574924902; cv=none; d=google.com; s=arc-20160816; b=eI5pUIJAGzw/xUWVzATyMZoFYfYOrfe8v6zH079O054XP575yjng5D5dxOP9klQU3n PcXz/WvZvOk4TBZ6F1BUEn0W9G1UfxmceSN6gkash4Nw2jLlin93BCCx4fO+GgzPNTLM nUHRfU9x05tzScNq3FbiBLg1BiHJbAgf4sL9sUeNieA/sduwhZDf+o3X+v1BTLWgRW0r h8s4VpJvfxIVIGirKI6RLrjp3VZd87mdSlAADCR7ZgYyiYAUY6/khbrT6O5YCTFTN1bx 7u4fzx48D/YHvQEK9plzSffZ3rdiMq4FSVUIsVj+tjFbgUgfv9N6WWb7rla3WvEjLVRI mLWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kZ0S7WAZZw4npT9/1fnjI3JqEyeS/idCVk/AOC84qQE=; b=XTK5hH+/3bGgoE3avHTcFzNA4jY5jNU5vjOj2U7XCPVGd5NGuIrH0qDmdcyxZHefit cvnGXtzXsf9TxnPS5FjQLB9vQ10xIlRh1KGrjWYjHNLBNuVRJuCeqFyoTq8DEIeGAkGT nE4USuOrEFCtq3i5bmAiWNfjrH38tyLgA0QzMw8Mat04oNxX2X1rcN9UlYZKe7AoLLuO XyuMUCnh/1eoWyWvU9OmBqqdmSlGaTkiXInrl20MhzEzzf9YS2f1dai6ZTmdnXxJYVPm 2q0tO+t57eTndd+/x5CGT1dnQfJL1mjYkP4vG4WQnh7wuri9ToyIin/tWToZDm5ufvkt RYAQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25si5228976ejq.362.2019.11.27.23.07.57; Wed, 27 Nov 2019 23:08:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726963AbfK1HFn (ORCPT + 99 others); Thu, 28 Nov 2019 02:05:43 -0500 Received: from verein.lst.de ([213.95.11.211]:50681 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbfK1HFn (ORCPT ); Thu, 28 Nov 2019 02:05:43 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id CFD2968C7B; Thu, 28 Nov 2019 08:05:38 +0100 (CET) Date: Thu, 28 Nov 2019 08:05:38 +0100 From: Christoph Hellwig To: Ashish Kalra Cc: Christoph Hellwig , Tom Lendacky , Halil Pasic , "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Cornelia Huck , linux-s390@vger.kernel.org, Michael Mueller , Christian Borntraeger , Janosch Frank , Ram Pai , Thiago Jung Bauermann , Andy Lutomirski , Brijesh Singh Subject: Re: [PATCH 1/1] virtio_ring: fix return code on DMA mapping fails Message-ID: <20191128070538.GB20274@lst.de> References: <20191114124646.74790-1-pasic@linux.ibm.com> <20191119121022.03aed69a.pasic@linux.ibm.com> <20191119080420-mutt-send-email-mst@kernel.org> <20191122140827.0ead345c.pasic@linux.ibm.com> <1ec7c229-6c4f-9351-efda-ed2df20f95f6@amd.com> <20191126184527.GA10481@lst.de> <20191128004225.GA11539@ashkalra_ubuntu_server> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191128004225.GA11539@ashkalra_ubuntu_server> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 28, 2019 at 12:42:25AM +0000, Ashish Kalra wrote: > Why can't we leverage CMA instead of SWIOTLB for DMA when SEV is > enabled, CMA is well integerated with the DMA subsystem and handles > encrypted pages when force_dma_unencrypted() returns TRUE. > > Though, CMA might face the same issues as SWIOTLB bounce buffers, it's > size is similarly setup statically as SWIOTLB does or can be set as a > percentage of the available system memory. How is CMA integrated with SEV? CMA just gives a contiguous chunk of memory, which still needs to be remapped as unencrypted before returning it to the user.