From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E74C3A5A7 for ; Wed, 4 Sep 2019 10:38:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B88892339D for ; Wed, 4 Sep 2019 10:38:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="jmqI5tgg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbfIDKiC (ORCPT ); Wed, 4 Sep 2019 06:38:02 -0400 Received: from pio-pvt-msa3.bahnhof.se ([79.136.2.42]:53786 "EHLO pio-pvt-msa3.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfIDKiC (ORCPT ); Wed, 4 Sep 2019 06:38:02 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id 8A1353F6E5; Wed, 4 Sep 2019 12:37:49 +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=jmqI5tgg; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se 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 5OXVNpQKvjjO; Wed, 4 Sep 2019 12:37:48 +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 194913F538; Wed, 4 Sep 2019 12:37:46 +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 4A1BB36117F; Wed, 4 Sep 2019 12:37:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1567593466; bh=akRBTXxMLQXPdPRml7vfcwvBwbf56SVhUOk6CAVkC7g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jmqI5tggrRqyalYT5qgVmkGv5E8PK0uoJAGge7hKl4hbNkmvoLq77PsUgXGd2drhA I/iSZLiecT2/xY1eWKLfVOepEryYzy3tLTAVvISoPgU2jKW+HJTBb3A32vn9GWQ6yV pCPMJEf5h0JyBbBhEIyiOqKdJBtPPg2R2PR6gDBc= Subject: Re: [PATCH v2 3/4] drm/ttm, drm/vmwgfx: Correctly support support AMD memory encryption To: Daniel Vetter Cc: Andy Lutomirski , Andy Lutomirski , Dave Hansen , dri-devel , pv-drivers@vmware.com, VMware Graphics , Linux Kernel Mailing List , Tom Lendacky , Thomas Hellstrom , Peter Zijlstra , Dave Hansen , Heiko Carstens , Christian Borntraeger , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20190903131504.18935-1-thomas_os@shipmail.org> <20190903131504.18935-4-thomas_os@shipmail.org> <6d0fafcc-b596-481b-7b22-1f26f0c02c5c@intel.com> <7fa3b178-b9b4-2df9-1eee-54e24d48342e@intel.com> <44b094c8-63fe-d9e5-1bf4-7da0788caccf@shipmail.org> <6d122d62-9c96-4c29-8d06-02f7134e5e2a@shipmail.org> <3393108b-c7e3-c9be-b65b-5860c15ca228@shipmail.org> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <0fd10438-5da4-fb69-f40c-c9b4beea1977@shipmail.org> Date: Wed, 4 Sep 2019 12:37:45 +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: 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 9:53 AM, Daniel Vetter wrote: > On Wed, Sep 4, 2019 at 8:49 AM Thomas Hellström (VMware) > wrote: >> On 9/4/19 1:15 AM, Andy Lutomirski wrote: >>> But, reading this, I have more questions: >>> >>> Can’t you get rid of cvma by using vmf_insert_pfn_prot()? >> It looks like that, although there are comments in the code about >> serious performance problems using VM_PFNMAP / vmf_insert_pfn() with >> write-combining and PAT, so that would require some serious testing with >> hardware I don't have. But I guess there is definitely room for >> improvement here. Ideally we'd like to be able to change the >> vma->vm_page_prot within fault(). But we can > Just a quick comment on this: It's the repeated (per-pfn/pte) lookup > of the PAT tables, which are dead slow. If you have a struct > io_mapping then that can be done once, and then just blindly inserted. > See remap_io_mapping in i915. > -Daniel Thanks, Daniel. Indeed looks a lot like remap_pfn_range(), but usable at fault time? /Thomas From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Subject: Re: [PATCH v2 3/4] drm/ttm, drm/vmwgfx: Correctly support support AMD memory encryption Date: Wed, 4 Sep 2019 12:37:45 +0200 Message-ID: <0fd10438-5da4-fb69-f40c-c9b4beea1977@shipmail.org> References: <20190903131504.18935-1-thomas_os@shipmail.org> <20190903131504.18935-4-thomas_os@shipmail.org> <6d0fafcc-b596-481b-7b22-1f26f0c02c5c@intel.com> <7fa3b178-b9b4-2df9-1eee-54e24d48342e@intel.com> <44b094c8-63fe-d9e5-1bf4-7da0788caccf@shipmail.org> <6d122d62-9c96-4c29-8d06-02f7134e5e2a@shipmail.org> <3393108b-c7e3-c9be-b65b-5860c15ca228@shipmail.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: Received: from pio-pvt-msa3.bahnhof.se (pio-pvt-msa3.bahnhof.se [79.136.2.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41A3C89A62 for ; Wed, 4 Sep 2019 10:38:01 +0000 (UTC) In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: Tom Lendacky , Thomas Hellstrom , Christian Borntraeger , pv-drivers@vmware.com, Dave Hansen , Heiko Carstens , Linux Kernel Mailing List , dri-devel , Andy Lutomirski , Dave Hansen , Peter Zijlstra , Ingo Molnar , VMware Graphics , Andy Lutomirski , "H. Peter Anvin" , Borislav Petkov , Thomas Gleixner , =?UTF-8?Q?Christian_K=c3=b6nig?= List-Id: dri-devel@lists.freedesktop.org T24gOS80LzE5IDk6NTMgQU0sIERhbmllbCBWZXR0ZXIgd3JvdGU6Cj4gT24gV2VkLCBTZXAgNCwg MjAxOSBhdCA4OjQ5IEFNIFRob21hcyBIZWxsc3Ryw7ZtIChWTXdhcmUpCj4gPHRob21hc19vc0Bz aGlwbWFpbC5vcmc+IHdyb3RlOgo+PiBPbiA5LzQvMTkgMToxNSBBTSwgQW5keSBMdXRvbWlyc2tp IHdyb3RlOgo+Pj4gQnV0LCByZWFkaW5nIHRoaXMsIEkgaGF2ZSBtb3JlIHF1ZXN0aW9uczoKPj4+ Cj4+PiBDYW7igJl0IHlvdSBnZXQgcmlkIG9mIGN2bWEgYnkgdXNpbmcgdm1mX2luc2VydF9wZm5f cHJvdCgpPwo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