Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5819107ybe; Tue, 10 Sep 2019 09:14:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8WEpMGIsZNvFjXTZkGXK7pDkAHzIKmEqYVKC9jDu99sjyrOCQyNY2+eXu9XtCtk3swUP8 X-Received: by 2002:a17:906:361a:: with SMTP id q26mr25571971ejb.43.1568132090396; Tue, 10 Sep 2019 09:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568132090; cv=none; d=google.com; s=arc-20160816; b=Bv5udTtt8ccTItTh9r2EjtSmgCQyq9/LNg96Lvtnn3IQpFPC/84eSV9BoP6IBMXFw6 fCX7+30AxZ+KZcBgQ4XvgBh9PAF+sn7ZggEIakP3uFZdk1IdVZy7VH+t/dtxJRzkdfvL yzOQ+abNOKRTdOOHdZ1A32/RqJwCqCDBMZ2cNBJhc6w7yUFeAMDJCOYhPLCl1flHzAdB 0lXvA1JuUPD7LZdoZlJa1Cw6ld9rBUJWFRvPb8lr/2fMJD5AITrthy8uWBj5E7wtJFgS xrb5+V1n8mUBNn3e/iau/fwcoSqzknmzv7lJbNo2G/oTSNfb8WC4a8ymRubzaM++zneY E3Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=PCOjORMglX/qkee1zhY9yzG86fMrqn79cYKHDfbxgm4=; b=ntn6h5qa2rHnV44d8TeIfN+hvIAgCjQGLaO09ln8vRBIGqxE9n5k8L7Qmrmwwq9fNN z4ebyQqmgoIG/zWRwz2Ao+6SL5U0v7mkaSR2h82gwZK/59z93kWjwAql8Gz7i4nhxYf5 Le42w2jHBlmKdTAzzDrzt6MiCVMx7aELME3PBjxfQU3GgpDeE7Y6VPKPBo5/BZ2ZcAbv UCFyhB5ayWlgS2R1VrK2fZ2vCpJcUsekKqlOSXb98raw4LhoSqHPw/cLAZiSqwUUqi39 E0tbU2ZKikYqrUiqLKJT2SNHYokyLy7dFJerAbUnurB5eTf/7pzQbOXHJ1xSwC9Ql+Wk KMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="Fukoas/a"; 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 e50si11278730edb.177.2019.09.10.09.14.26; Tue, 10 Sep 2019 09:14: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 header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="Fukoas/a"; 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 S2436760AbfIJQL1 (ORCPT + 99 others); Tue, 10 Sep 2019 12:11:27 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38848 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729580AbfIJQL1 (ORCPT ); Tue, 10 Sep 2019 12:11:27 -0400 Received: by mail-pl1-f195.google.com with SMTP id p9so4107785plk.5 for ; Tue, 10 Sep 2019 09:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PCOjORMglX/qkee1zhY9yzG86fMrqn79cYKHDfbxgm4=; b=Fukoas/aiFXsXSqO9jiSNlaFKUU7FW8jY1D3OJSr6RQlfRgvud5eXId+jG5KC9n4HF AEHRodVgj88bP9FIyWIWhQfzTcXwkgUqO31wLB79JJcxopV4S3SLSegeJddKjj8ZynUD GLW0KsZITehr9NhvVRex3A+SBSLMKS9IKNQNvsHjuo4UmTMBiZHOTOgBRem8LPebVEmT KIAG/hk99dE0ajGpL6jGgZ2zfAK8nqnoi1/khkiYaJ/hUfXIdehEf/97L+CkB6lt+qmV PsGFQxVjInYHAd/j26L7J7i1DPLWWGwRGlWYovI409QnbQVA+XNEZOnsETzd7a3s9tId j/ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PCOjORMglX/qkee1zhY9yzG86fMrqn79cYKHDfbxgm4=; b=WCW348PIHrNnuodNhS0V/swYhLFtHkHtu/8qSbPci3PoyxtoqLaqxKCAwSaW0KtER1 6PQlCiTxUKAmBnnq60Vl707W/MMFUlQ39eakpULUwvYvSNzKBrcujVlBTfi/2RECJ3V9 zD/hgaIl8a2SQSK2F+pWgl2j5FS9H5pO9AcvSAjsKfTaK1MCgiGDH34hM8kmN4xpAkFI E6/ukn41vp05EVm55RJr4HonSQxyIT4AIwfD5diocojT40HYh4YtCKYj1gqLr6VFHFah d4OrqeOOvlo9YnzBjeXQjDumUQjGXzedR9tKXr4WVNi+7Sm7Q4q9DESbIJQAfjSzA80l KNfQ== X-Gm-Message-State: APjAAAVUafGfNwafWsnPV5H5ZM56HojAlazns5UUVCkokawncVkIvzY6 /gxTXi86iWU0H3EqZ7C9Fl5UaQ== X-Received: by 2002:a17:902:830a:: with SMTP id bd10mr27429815plb.136.1568131886488; Tue, 10 Sep 2019 09:11:26 -0700 (PDT) Received: from ?IPv6:2600:1010:b019:c7e1:4181:8648:504c:5cf6? ([2600:1010:b019:c7e1:4181:8648:504c:5cf6]) by smtp.gmail.com with ESMTPSA id x13sm19964075pfm.157.2019.09.10.09.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 09:11:25 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH 1/2] x86: Don't let pgprot_modify() change the page encryption bit From: Andy Lutomirski X-Mailer: iPhone Mail (16G102) In-Reply-To: <20190905152438.GA18286@infradead.org> Date: Tue, 10 Sep 2019 09:11:24 -0700 Cc: =?utf-8?Q? "Thomas_Hellstr=C3=B6m_=28VMware=29" ?= , Dave Hansen , linux-kernel@vger.kernel.org, x86@kernel.org, pv-drivers@vmware.com, Thomas Hellstrom , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , =?utf-8?Q?Christian_K=C3=B6nig?= , Marek Szyprowski , Tom Lendacky Content-Transfer-Encoding: quoted-printable Message-Id: <10185AAF-BFB8-4193-A20B-B97794FB7E2F@amacapital.net> References: <20190905103541.4161-1-thomas_os@shipmail.org> <20190905103541.4161-2-thomas_os@shipmail.org> <608bbec6-448e-f9d5-b29a-1984225eb078@intel.com> <20190905152438.GA18286@infradead.org> To: Christoph Hellwig Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 5, 2019, at 8:24 AM, Christoph Hellwig wrote: >=20 >> On Thu, Sep 05, 2019 at 05:21:24PM +0200, Thomas Hellstr=C3=B6m (VMware) w= rote: >>> On 9/5/19 4:15 PM, Dave Hansen wrote: >>> Hi Thomas, >>>=20 >>> Thanks for the second batch of patches! These look much improved on all= >>> fronts. >>=20 >> Yes, although the TTM functionality isn't in yet. Hopefully we won't have= to >> bother you with those though, since this assumes TTM will be using the dm= a >> API. >=20 > Please take a look at dma_mmap_prepare and dma_mmap_fault in this > branch: >=20 > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-mma= p-improvements >=20 > they should allow to fault dma api pages in the page fault handler. But > this is totally hot off the press and not actually tested for the last > few patches. Note that I've also included your two patches from this > series to handle SEV. I read that patch, and it seems like you=E2=80=99ve built in the assumption t= hat all pages in the mapping use identical protection or, if not, that the s= ame fake vma hack that TTM already has is used to fudge around it. Could it= be reworked slightly to avoid this? I wonder if it=E2=80=99s a mistake to put the encryption bits in vm_page_pro= t at all.=