Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp380834ybe; Wed, 4 Sep 2019 00:55:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMDX1Nc1WgMdcb2XypoYaoBC/wfspjrbysCXBIRAzTvfBGSi0iQ4VYWNx8wuDYeU9QnRnY X-Received: by 2002:a17:902:4283:: with SMTP id h3mr40897337pld.56.1567583729982; Wed, 04 Sep 2019 00:55:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567583729; cv=none; d=google.com; s=arc-20160816; b=rwgF4F2RNzxnrJrQ2haGnS+YRSRB1xUNiQo1l26Q1lthACjAQJD7oNOl3ACcCRoGaa 7bUbdbMWx2/MKoZZ4L+itZ+/y+hzIkC2eb+SHYJFu8muaFLimE49SCSxj0ujmHEQRTnZ x3YYcuJWuSWWhLHpnFf5S1SrQKRAJ3BRfuc/FuvFrUZV/aJlaFYJGwgV7G1gHn3AeLVW KCtbtOFGGr8N7JqnMVaRYDa5GY7w9lUJ2WpH79db7tfzkXZgEAx1U9RLPPItkh0dpn81 rxSDCN/I9hPKCS4r6TFaSBVdm1ZKgwerUS7xonQPEZoCzK2i5AQD5pCtNg1e1lWV7P1m imTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nsL2dG0Jkv/yBtdq643XdQgXacAtlmVt/WZU7C9r86Q=; b=bFwacNXqxO/JrYD2jl5ilkJMDxpbO3pZTwLdzYLmJB3dxYwldxJuIFRa6hrSAKAOzc vIA8DZDdQLouFNYo1DRIOpt48QaNQ9pfeHltyA1LqulQXdydCBuZUImwUYcr8jUqBtWB RkkAcV6jrNPhzhBovbJWJM2WHo4zH6caxjfxml+VMHDZdBrHpyEhdrkWZJJS/2FJL3T1 qasUvdk8jD89TGIAFhiJnlzcRpdOHy+4h3wmfelu7sEtlU6NMve/j/wEVDfhmnGdda6I 3Nf51/5+sdjx9aGqSWlcawhf/tFTyBaCTqp1dIqk1M+/iFDZ/dFAN4aKoSE2zhPEwnCl 6MuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Fpfim0KL; 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 61si1800092pjo.46.2019.09.04.00.55.14; Wed, 04 Sep 2019 00:55:29 -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=pass header.i=@ffwll.ch header.s=google header.b=Fpfim0KL; 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 S1729060AbfIDHyG (ORCPT + 99 others); Wed, 4 Sep 2019 03:54:06 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33766 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbfIDHyG (ORCPT ); Wed, 4 Sep 2019 03:54:06 -0400 Received: by mail-ot1-f66.google.com with SMTP id p23so19703391oto.0 for ; Wed, 04 Sep 2019 00:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nsL2dG0Jkv/yBtdq643XdQgXacAtlmVt/WZU7C9r86Q=; b=Fpfim0KLgJ+FNUELGd/cGbfkJVwz26hJlETB2SD4TW1Yi+H4dORrDsb+7WOsgUCfCa wvIESBCC6aMyklaV4lbBJAoUZOpTVEfCpEgrnDEPYSaTF5HzRKGBzIWCpRMC+wTI2Kse X2iSsZIejDC/X+uhwFkMzF8Ia0FiRe8aLWGxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nsL2dG0Jkv/yBtdq643XdQgXacAtlmVt/WZU7C9r86Q=; b=jjsMjU0cyxJ9iSAigU93A9Nm7M4SGgqKwbUOWY+Fk9Bsl5sa0zcpgKvKMTOOmhpi1X PT4TNId/QGoFYq6C2XExF2wg8+63g37kIqMTF4jO4cghJ/NpGg6QThQW2nx2+zhDiHrw nCgIwGd9gKezJqFZlj//NLkQQ4rIDqertLdlR239AbLM/4TfOTT8kXUSiN1Wjqkz1nTF nkqLZFKtEBYlXOkItiNTgDw83d61uZBeFeNGfZGgJnbfEsjOWQGqrbe0UzAjBG5g/BGg IWT39nt+bSdhuI7L9tYsTrEnVhkl12TjbdvWUBo4I+zD6gIe8lAw/fLCpiSorAEl0Fzz FzNw== X-Gm-Message-State: APjAAAWHPocRC91s8Zf5Os7a5FHCaqRIVew1dI/SDegKrSabqhqJJE5d mcrO53mtYP4HhMrRgM4TFJ2pHs4yLd3c8dEYAqzodg== X-Received: by 2002:a05:6830:10d8:: with SMTP id z24mr11461873oto.281.1567583645124; Wed, 04 Sep 2019 00:54:05 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <3393108b-c7e3-c9be-b65b-5860c15ca228@shipmail.org> From: Daniel Vetter Date: Wed, 4 Sep 2019 09:53:53 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] drm/ttm, drm/vmwgfx: Correctly support support AMD memory encryption To: =?UTF-8?Q?Thomas_Hellstr=C3=B6m_=28VMware=29?= 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?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 4, 2019 at 8:49 AM Thomas Hellstr=C3=B6m (VMware) wrote: > On 9/4/19 1:15 AM, Andy Lutomirski wrote: > > But, reading this, I have more questions: > > > > Can=E2=80=99t 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 --=20 Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch