Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp364718ybe; Wed, 4 Sep 2019 00:33:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkRCCzbo2Wzsj09ArKoEeHqtWjspk3Or0P0Sj5+wiEZlVocGzVAMTNRz+S8LhjFEx1k231 X-Received: by 2002:a63:b555:: with SMTP id u21mr34511465pgo.222.1567582430779; Wed, 04 Sep 2019 00:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567582430; cv=none; d=google.com; s=arc-20160816; b=LzbdJ6LzKPJf3C4hf7skddQwhiegbZ3FL6ec1uWZsgWG7b5mSXepntNHVl+2+wXIFc io2kAdYJa7RQr60FetMOQ372h/pojlm6KyH65I04R3QPi6DGRMjsEPaMbaBr0Lg7i/7I GcUXA428FSv2OVYY+dukPdi+K1nO4STGPZLsUw9AYcafXxije5gUskg+LWn9KyedvftI MnrEXAkVfm3CN8cOQh/dznW2+0PjtoP0irdUMCYBBnqETG4AaRr4e3LckClrzhg4GZuF fXZzi0LoMdDZEP6IUfj5NnQpt+anu/g/m6oOcc/ckj856Wf6mRmaWagqXuc/9bNw9RxA B0dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=aujLnasGz9jWyiPkO+WkEBTiW1KW8KAKRYWBlkxlUpA=; b=OMnRDc9e7QNAl4UHLTrUtwxa3eWs/jGd/Z9Y5CD385gQv0+mmNxBzqM0Fe+VUTwQ3O F9Hvnnd58J4yuIGLo10fbHdZ+2clQ9AKmJFesSeHOQ6DrfSvqQYXFk1IW+pquuE2ai8r ae7keEHd5sogLmB/wr3B5OwVnEpjfT1mCz+vT+TG2kOfSund1JK/Yr7Tcxj2xQUudXGm Ny6+ayl2i3CUUt8sL6K1tbOz4gMag+LTrpyWy54XcO133SDLmpeLrkqr5IBr/Ww2qiwx wljzrBs6iKy3UtzidpuE4GQtOjD/eLJAqlnBBouz+HYy91T422Qm6NUeJ4PxhU60pEW7 8LNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=OsihSA8X; 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 s13si8312812pfh.70.2019.09.04.00.33.34; Wed, 04 Sep 2019 00:33:50 -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; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=OsihSA8X; 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 S1729068AbfIDHcm (ORCPT + 99 others); Wed, 4 Sep 2019 03:32:42 -0400 Received: from pio-pvt-msa3.bahnhof.se ([79.136.2.42]:40132 "EHLO pio-pvt-msa3.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbfIDHcl (ORCPT ); Wed, 4 Sep 2019 03:32:41 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id A493C3F364; Wed, 4 Sep 2019 09:32:34 +0200 (CEST) Authentication-Results: pio-pvt-msa3.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=OsihSA8X; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.099 X-Spam-Level: X-Spam-Status: No, score=-2.099 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from pio-pvt-msa3.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9lLkUit6PVre; Wed, 4 Sep 2019 09:32:33 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTPA id 276693F2FD; Wed, 4 Sep 2019 09:32:31 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 99CB036117F; Wed, 4 Sep 2019 09:32:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1567582351; bh=+HPJwYMkUXNNDiZsZ1mMLmsIhLPoZN+GWDYqMvcXGy0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=OsihSA8XiQNtpZi4LHiOjmVKAjfHxhpSkrnaLq3orK8hVpSl/Py8OtmiHGj20Wmwb y9LUQeVfzilM5iuRCPUMl3v1Y/pn92u88ghe02GGFXLUsf0p0rPeQctvZZIm6MHp0a MdKNeE2NyMS/CI5DYx5qu4/Phd1HiNMQMy7dvJFQ= Subject: Re: [PATCH v2 1/4] x86/mm: Export force_dma_unencrypted To: Christoph Hellwig Cc: dri-devel@lists.freedesktop.org, pv-drivers@vmware.com, linux-graphics-maintainer@vmware.com, linux-kernel@vger.kernel.org, Thomas Hellstrom , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Heiko Carstens , Christian Borntraeger , Tom Lendacky , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20190903131504.18935-1-thomas_os@shipmail.org> <20190903131504.18935-2-thomas_os@shipmail.org> <20190903134627.GA2951@infradead.org> <20190903162204.GB23281@infradead.org> <558f1224-d157-5848-1752-1430a5b3947e@shipmail.org> <20190904065823.GA31794@infradead.org> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <8698dc21-8679-b4a7-3179-71589fa33ab7@shipmail.org> Date: Wed, 4 Sep 2019 09:32:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190904065823.GA31794@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/4/19 8:58 AM, Christoph Hellwig wrote: > On Tue, Sep 03, 2019 at 10:46:18PM +0200, Thomas Hellström (VMware) wrote: >> What I mean with "from an engineering perspective" is that drivers would end >> up with a non-trivial amount of code supporting purely academic cases: >> Setups where software rendering would be faster than gpu accelerated, and >> setups on platforms where the driver would never run anyway because the >> device would never be supported on that platform... > And actually work on cases you previously called academic and which now > matter to you because your employer has a suddent interest in SEV. > Academic really is in the eye of the beholder (and of those who pay > the bills). But in this particular case we *do* adhere to the dma api, at least as far as we can. But we're missing functionality. > >> That is not really true. The dma API can't handle faulting of coherent pages >> which is what this series is really all about supporting also with SEV >> active. To handle the case where we move graphics buffers or send them to >> swap space while user-space have them mapped. > And the only thing we need to support the fault handler is to add an > offset to the dma_mmap_* APIs. Which I had planned to do for Christian > (one of the few grapics developers who actually tries to play well > with the rest of the kernel instead of piling hacks over hacks like > many others) anyway, but which hasn't happened yet. That sounds great. Is there anything I can do to help out? I thought this was more or less a dead end since the current dma_mmap_ API requires the mmap_sem to be held in write mode (modifying the vma->vm_flags) whereas fault() only offers read mode. But that would definitely work. > >> Still, I need a way forward and my questions weren't really answered by >> this. > This is pretty demanding. If you "need" a way forward just work with > all the relevant people instead of piling ob local hacks. But I think that was what I was trying to initiate. The question was "If it's the latter, then I would like to reiterate that it would be better that we work to come up with a long term plan to add what's missing to the DMA api to help graphics drivers use coherent memory?" And since you NAK'd the original patches, I was sort of hoping for a point in the right direction. Thanks, Thomas