Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp522497ybe; Wed, 4 Sep 2019 03:39:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVexK1uvgQ4KGplD06ejorek374V8X3B4yLs0DQSiwT+p8HCPK0Lhw81/6gDywUML8rcfq X-Received: by 2002:a63:b742:: with SMTP id w2mr14279916pgt.372.1567593548634; Wed, 04 Sep 2019 03:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567593548; cv=none; d=google.com; s=arc-20160816; b=XhnGVe7KLZg7eL/R3RI0WOh6GiYCB8lifsUGKX+yZWP8BxaLIm9ocaIlWixcE5nQhJ BCXoauQZYh2XoZRK2/lcWxIc8BhC2b7MLlfCgT3eYQplDiP4KeN5oo4wH8YXbCJn1W4f SXREGG2J3ml9TwsGMtQITmbso7jKwD8cfSdNG9qjrQOJiEyfP8ZRPAHeT88k8ycT3A9H vWGx1lE1xw6vjJBeS0eCN2XLergPGPoZaNOyaD/Peb7O8hmH+JGd5a4jDer3TNCLW3dm PWkcVZDI1VMhf4DpjwZMUjWCz0s48G8a21Qz0GntO433TKAzsPSdrNqScYFq3z423JXV 2jkA== 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=akRBTXxMLQXPdPRml7vfcwvBwbf56SVhUOk6CAVkC7g=; b=KuYMH3fR6mNDy4Iz4ZXUduSNk8tKTqqdtCRk8gzur7MtMyqetvUXe89W1YQw0Hk4dK LG121viQ8MCdI2+et3pcW2f09chkQUpguwGN/Bi9UudEVgjTc03ubis/UgOgbp5jrEmq hUwUkTvV/r8cJJhgr/UgLj1WNYAYbmX5I8Q0Kdz+XVm5aiB7csNHnp05dCOch47srOpL 0YqA0goVlbsu7pC7CSC8MSdTPGks8qtfR7k2QoRCpWa4Ev5iLzuZi7ixNu701/Bch+Tu edlyfRn0SixukjtWOUFP5ZFa001Vn1g+mnOG205vmrKcclGS/zMIYWuW/TmGQXJ+iVYP t/eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=jmqI5tgg; 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 f186si16429868pgc.438.2019.09.04.03.38.53; Wed, 04 Sep 2019 03:39:08 -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=jmqI5tgg; 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 S1729292AbfIDKiC (ORCPT + 99 others); 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 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 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