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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C81ABE6748F for ; Fri, 1 Nov 2024 00:10:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51C936B00A1; Thu, 31 Oct 2024 20:10:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A5846B00A7; Thu, 31 Oct 2024 20:10:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F71B6B00A8; Thu, 31 Oct 2024 20:10:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 101366B00A1 for ; Thu, 31 Oct 2024 20:10:21 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 861F9ADF85 for ; Fri, 1 Nov 2024 00:10:20 +0000 (UTC) X-FDA: 82735593402.22.BA8B140 Received: from smtp-fw-33001.amazon.com (smtp-fw-33001.amazon.com [207.171.190.10]) by imf23.hostedemail.com (Postfix) with ESMTP id 6553F140022 for ; Fri, 1 Nov 2024 00:10:00 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazon201209 header.b=PBjMG6r+; dmarc=pass (policy=quarantine) header.from=amazon.com; spf=pass (imf23.hostedemail.com: domain of "prvs=028377251=derekmn@amazon.com" designates 207.171.190.10 as permitted sender) smtp.mailfrom="prvs=028377251=derekmn@amazon.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730419656; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jNxyG945mWZFitSBBl3P/Pi37LkMXgLexJ4MyYO00SI=; b=jnGGLWHnKo7opM03/1JTTPR8dgwvQC9A0Hz7BxZrreR3gykIHjzmPmgAwCB9Svt2LBGG0Z Wved0uicZsPvLxMOPhbox+O8Cb0F0jOuzydhAisTyvi+Ji4dh2R7Ci2Uz5Fjh7rCfeFGoy Cmi3RzsXsgnl6WiBixGPXLvOpEr17xk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazon201209 header.b=PBjMG6r+; dmarc=pass (policy=quarantine) header.from=amazon.com; spf=pass (imf23.hostedemail.com: domain of "prvs=028377251=derekmn@amazon.com" designates 207.171.190.10 as permitted sender) smtp.mailfrom="prvs=028377251=derekmn@amazon.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730419656; a=rsa-sha256; cv=none; b=lck+VkGOcnVfzYxDEeaQxru4Y2b9+1rs3cmpp3vbrMWnLIhI1wEtx0K1sPmX6p3QLlbVQv cBg8C2MtF4ogmjRaUJ+ZoWceuCPzLibiyX4d83HcyGAzNY8eHS8ewt8Uk2ejVzKpaGHEbe 3Ei0O394d7//ecJirdxbIiw9qdIrP5w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1730419818; x=1761955818; h=message-id:date:mime-version:to:cc:references:subject: from:in-reply-to:content-transfer-encoding; bh=jNxyG945mWZFitSBBl3P/Pi37LkMXgLexJ4MyYO00SI=; b=PBjMG6r+2XgemzvXNiRS/nOv26MvOljajnGdveYrMBpmA1MwWUkwdHpn 0LAz0d39k1fVkEsQ+H8ilkocCRFpfEwi+SBZJtFtHrCuccr/i2HbIrzNC Vzn1knGOIQtMoIqaIKI4RHXVOWTcnEdhNS/r/bhbu2U1Xe/JRt25G52Hl o=; X-IronPort-AV: E=Sophos;i="6.11,248,1725321600"; d="scan'208";a="381598034" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 00:10:17 +0000 Received: from EX19MTAUWA001.ant.amazon.com [10.0.7.35:3117] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.50.158:2525] with esmtp (Farcaster) id 9403627f-3ea8-485f-95a8-ff158371f477; Fri, 1 Nov 2024 00:10:16 +0000 (UTC) X-Farcaster-Flow-ID: 9403627f-3ea8-485f-95a8-ff158371f477 Received: from EX19D003UWC002.ant.amazon.com (10.13.138.169) by EX19MTAUWA001.ant.amazon.com (10.250.64.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Fri, 1 Nov 2024 00:10:15 +0000 Received: from [192.168.20.174] (10.106.101.30) by EX19D003UWC002.ant.amazon.com (10.13.138.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.35; Fri, 1 Nov 2024 00:10:12 +0000 Message-ID: <2233397c-f423-40e3-8546-728b50ce0489@amazon.com> Date: Thu, 31 Oct 2024 17:10:11 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <27646c08-f724-49f7-9f45-d03bad500219@amazon.co.uk> Subject: Re: [RFC PATCH v3 0/6] Direct Map Removal for guest_memfd Content-Language: en-US From: "Manwaring, Derek" In-Reply-To: <27646c08-f724-49f7-9f45-d03bad500219@amazon.co.uk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.106.101.30] X-ClientProxiedBy: EX19D031UWA004.ant.amazon.com (10.13.139.19) To EX19D003UWC002.ant.amazon.com (10.13.138.169) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6553F140022 X-Stat-Signature: ydsa5a87kgco3x9hjffxptrzrfi7wawj X-Rspam-User: X-HE-Tag: 1730419800-163331 X-HE-Meta: U2FsdGVkX1/0bPFtW+rrTRANdOH3vcUDWuLVdImYDDIOgm1myiM+EJ5rqrhKuM7bD+vdmqsw4/uK+QP7hkVhf3bhgrLkLk3v57znbP5K4Ndc3Z873mP5+fyF6cRfr+BJYZCSuBtZogHNHbGnlrA1HQs0X3X9qpZ+nxAcwX7I3cgYfHI7OSEVjJSTkFFebs4OgMge8XA+RFkyN6nBOEKWRRurqmWLSjnmnx7CsAhObtq8t8xPj0op7fQc1HPfx6D6aQsOoxoNGxRVEj1W4hoQNnPzdriROF1RSMor1ZcboFyZBX3q1MwdCWT8kGNoMgR/LmGDwfzUMBVAN21mLguoe6omEg93XMRENZ+IdFHzZFufyyrSHI8Ki69akjwJX34Pv44MnU5zfn5TFxEGBlE/9dUnohYDitxtBPBCZkP05KmFtTF+BnpK7XHlpYxK/kFhNg0B/tDDOMBky3x3qzC+P1OUFb+X3fSAfqsiiHz8IWmTS2CuKSdKL1m6MOV5QgpGKc/x3VbVutBGRNoW96orWdBHNTd2+2Fe/U0d/OAgLakckXA0MWEZuojwc25YXTnRABlNuF+p1PeoMR0rg6URTCeHFS9PqM4WMNuWGRysc9k9dVbdYkNoGLhAJaRlqk7eSd5x5RvFArqR6sHzBsw1MWujr6NMLxAwpHyNgkrr38IUbKF9ZbigTyN64jM+xFa6OAe4KXQvkv6JJPrDVuZ84OX+k/TcdOfRXgvnEyzFbs1G+rpUjqe3vUu+1aN89ScpCQuPgg4E2lzf/GUgJP09bswTF32fUFXWfRjK0PKX7SyhyrteLHcAejgyif+9eFxp+yk51xd/9fXYbK+8ZtljCAwpIng3ULDqS03kg7YIa2TzYxSkqfY+KIlpI+q2AtO1ETX/qfywqHWKhEf5cg50wnfvtqvBAueJZB0HZsFQ9GnkhftUa8WyIToUitQyPZadiH01AKiFhM3Ek0tZpx1 PRxCGhFn rUyxWXpstQQ20qCMABIp6x4fi879rJEcCyaNmriCtKX3O8+E285I+Hyc4Bi/S74R7P/h8wL0ekxB6zknYPWtxFfRgUlxllV85Qli8+fxlalrCg6kxgVwfI97oUc2TOkH76OtOpoArfPD5DFJowP4t8nvPnpHONySVyHUoyzhyFPKRBHaxWScDrxe5aZe6Os7YvxKe9Fc6X9fljUt1/o7v9K61gcXT4yLY+hiijMa55FI3UyHHcGHJ3NEvfMITjR4pnOXoOQsy6NEQWo0LAGbexAVYXgKzTnNKVDYql5O/900cpbW4g9lBuUYSGiBLEpn3ZY82WSa4iAZMPsKN/c5hjAS8LMMpkVDmT5B41C2p2bYPMDpkoUTW07ooizZOmxyxK2PHGiaSfv1W41qJCk2NfIlZ6EvZeP+2FspKX1X1NE9jzu6jKu344vcIPBj0CxK5hVlynDSKRrNOhr1FDnHcNcqIjf9xzHvycsKSRstaAas4Lo6DxmnvpQ47v3R8sK6i3ZIvgARWbNXdmWCrbZ14//V9epRR1i12p7ce51yECN5Yu36zXwShg1caP6mzjBoWcs7XCaGIN4+gbrbXiq3jDzInR/vCpOdLOo0b4Y6r5spiLVfYfnzk54e18WV006Glq2omoArdRae9nVZU93vQHN5NgCzr1nKuTfOWs/Yu3JNiS14= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000038, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2024-10-31 at 10:42+0000 Patrick Roy wrote: > On Thu, 2024-10-31 at 09:50 +0000, David Hildenbrand wrote: > > On 30.10.24 14:49, Patrick Roy wrote: > >> Most significantly, I've reduced the patch series to focus only on > >> direct map removal for guest_memfd for now, leaving the whole "how to do > >> non-CoCo VMs in guest_memfd" for later. If this separation is > >> acceptable, then I think I can drop the RFC tag in the next revision > >> (I've mainly kept it here because I'm not entirely sure what to do with > >> patches 3 and 4). > > > > Hi, > > > > keeping upcoming "shared and private memory in guest_memfd" in mind, I > > assume the focus would be to only remove the direct map for private memory? > > > > So in the current upstream state, you would only be removing the direct > > map for private memory, currently translating to "encrypted"/"protected" > > memory that is inaccessible either way already. > > > > Correct? > > Yea, with the upcomming "shared and private" stuff, I would expect the > the shared<->private conversions would call the routines from patch 3 to > restore direct map entries on private->shared, and zap them on > shared->private. > > But as you said, the current upstream state has no notion of "shared" > memory in guest_memfd, so everything is private and thus everything is > direct map removed (although it is indeed already inaccessible anyway > for TDX and friends. That's what makes this patch series a bit awkward > :( ) TDX and SEV encryption happens between the core and main memory, so cached guest data we're most concerned about for transient execution attacks isn't necessarily inaccessible. I'd be interested what Intel, AMD, and other folks think on this, but I think direct map removal is worthwhile for CoCo cases as well. Derek