Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2490712ybe; Tue, 3 Sep 2019 13:47:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+JGvI52Pb//y2mxYAjLojijlgn6ijMxgnXeigCq0kP3lBbnIrFV4QyiG4T2bW2ZS/QIxQ X-Received: by 2002:a62:db84:: with SMTP id f126mr16774084pfg.25.1567543656885; Tue, 03 Sep 2019 13:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567543656; cv=none; d=google.com; s=arc-20160816; b=mcYEhMzM3tM1kobKpC292BONjmmxvVsKRRiIj03dHJVGIpRd2yaqG8wtWA/ALoT6TB zmBlOMYgLHgYB8UmhHQvIiah9NuP2t4du9R2ic/mH66GTXhEBvQE68HDfQLkBmPzPhrf /YywXyc8ZmoHKd+H5420ebWMh3WfRf20N9lTtP8sm8Watg9nQ1P+ZVHOehwkgCy3bIRP lfJGjm9oUEJs7gEjg/ezIzyb8yxqLp1pD2/MVPDi9kGO8qsCjS6+2hZxSXA9K0Lu1G6I xFTWnz8KwjDfvx6FFGdaany8oEuwvWGVd6gWIB23I2lpaqVUOedkzSyBVV+NSUfqdrVG P67g== 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=DCZXSIEeA19j9CecvgPpNRuy1bVTHkjZu5NysYzbMHo=; b=u7Y6WrEB6jjyC44yDXOUSMr0Us4QHsnyp2UoBmTB35SU7jXuSGE+N2T5TqZAef1wTn 4meeZHfEyqC6SDAXgmJxW3//oG77P0UYXGvBnYQrJndeTf5WaUq5rgsHMJUV2X1bhJOo 20Qb8QYJKcRpjiiijgDTiTzZGdY4LtQIteLCdb2BxMuORdTDJq1X3CErbat0pLXarjVn 2s1crBOCLZ93HXl+bioxJqoe9PEZlowUxaK4s0+iUAp8KhuWFnlzqbyYvMy4fihYWjox QX3thZO6H8aGMSd5TO7yl2tIPH9t8wFFSCHFShD/BVvBazbG2Nd3nJL9mB2vQu8WjD+u HOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=d5pyVlMA; 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 t3si496096pjw.105.2019.09.03.13.47.20; Tue, 03 Sep 2019 13:47:36 -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=d5pyVlMA; 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 S1726770AbfICUq3 (ORCPT + 99 others); Tue, 3 Sep 2019 16:46:29 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:55741 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfICUq3 (ORCPT ); Tue, 3 Sep 2019 16:46:29 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 5AF213F7AA; Tue, 3 Sep 2019 22:46:22 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=d5pyVlMA; 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 Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cm5YpwMMBdsT; Tue, 3 Sep 2019 22:46:21 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 8EA0F3F346; Tue, 3 Sep 2019 22:46:19 +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 2309F360160; Tue, 3 Sep 2019 22:46:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1567543579; bh=ReJ050/HhfY0Ips2NyF/JTyfejqDhdHoI69hGH+hQng=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=d5pyVlMAIlG8kSjxdJ6L4TE+ZbVRlWIQ0rnwBa/UmsyM4NifbUmke10ZyTcfAn3Zv vUi7fIUcBPjcDYXRdoH5OFN7o7UnEzFdVJpQg2EO1+5b7rwG/jYnHaN2xKjTSqk3Wn 8CDZYzOZUAiaMay+Q4PbIPxy6QBIXcZs2oPHLRpc= 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> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <558f1224-d157-5848-1752-1430a5b3947e@shipmail.org> Date: Tue, 3 Sep 2019 22:46:18 +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: <20190903162204.GB23281@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/3/19 6:22 PM, Christoph Hellwig wrote: > On Tue, Sep 03, 2019 at 04:32:45PM +0200, Thomas Hellström (VMware) wrote: >> Is this a layer violation concern, that is, would you be ok with a similar >> helper for TTM, or is it that you want to force the graphics drivers into >> adhering strictly to the DMA api, even when it from an engineering >> perspective makes no sense? > >From looking at DRM I strongly believe that making DRM use the DMA > mapping properly makes a lot of sense from the engineering perspective, > and this series is a good argument for that positions. 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... > If DRM was using > the DMA properl we would not need this series to start with, all the > SEV handling is hidden behind the DMA API. While we had occasional > bugs in that support fixing it meant that it covered all drivers > properly using that API. 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. To do that and still be fully dma-api compliant we would ideally need, for example, an exported dma_pgprot(). (dma_pgprot() by the way is still suffering from one of the bugs that you mention above). Still, I need a way forward and my questions weren't really answered by this. /Thomas