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 9DCC2CEDD97 for ; Wed, 9 Oct 2024 14:03:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31A936B00C5; Wed, 9 Oct 2024 10:03:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A0726B00C8; Wed, 9 Oct 2024 10:03:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F3996B00C9; Wed, 9 Oct 2024 10:03:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E2A7A6B00C5 for ; Wed, 9 Oct 2024 10:03:14 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 17CDFA10F4 for ; Wed, 9 Oct 2024 14:03:10 +0000 (UTC) X-FDA: 82654230708.24.3669C83 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by imf02.hostedemail.com (Postfix) with ESMTP id 3023980004 for ; Wed, 9 Oct 2024 14:03:11 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=iki.fi header.s=lahtoruutu header.b=CEvAyKG7; arc=reject ("seal check failed: fail, {[1] = sig:iki.fi:reject}"); spf=pass (imf02.hostedemail.com: domain of jarkko.sakkinen@iki.fi designates 185.185.170.37 as permitted sender) smtp.mailfrom=jarkko.sakkinen@iki.fi; dmarc=none ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728482455; 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=1WhxVXkOe67dMgsIbtILe5TqIMke8WpifQF/naTxgbs=; b=cGbT/aib3tb8LizfIRzu7JnH4+F1OkeRJ3Yditk4yXmv18+KlZTQxKotcEgXCGBdCV3/R+ CIWgUhcjgQDSwSgiJEis7Ee1Ttk1bOMNYdtir3GdcQ6fdUPlmAi/48R0ypvwke56vNG6qW 0Qx1HtCLlF8NVCd5ejR8Bi1YVQDcw+8= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1728482455; a=rsa-sha256; cv=fail; b=7Dda3rq/zA+6ltWTqqlqQ08qYfwVIVfGOtVc5qGj892kcYqDAMlLkR2r+DjiQZMVBuytGS M+xyfwecZ0ECzJeqlm7RWq6qDMvd38UUc10zj/OX2cuB3affwjbfQ4F+gE00IO+E5OjhCp 256bQ0vxGkIG4MjMPapWT/R0clNNmTw= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=iki.fi header.s=lahtoruutu header.b=CEvAyKG7; arc=reject ("seal check failed: fail, {[1] = sig:iki.fi:reject}"); spf=pass (imf02.hostedemail.com: domain of jarkko.sakkinen@iki.fi designates 185.185.170.37 as permitted sender) smtp.mailfrom=jarkko.sakkinen@iki.fi; dmarc=none Received: from localhost (83-245-197-106.elisa-laajakaista.fi [83.245.197.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sakkinen) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4XNvjm1syxz49PyG; Wed, 9 Oct 2024 17:03:08 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1728482589; h=from:from: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; bh=1WhxVXkOe67dMgsIbtILe5TqIMke8WpifQF/naTxgbs=; b=CEvAyKG7jB4GHtT0fl8JyI7vwTyf+S+iCGPyFsZb0+K+O5WBW9UpwM68wNSK/IA5ivn7vR x/JtC3qLfoR0bVGFWi36k94wK6yryggOa/yLQXSxOdzjrDI/uhZMFCFproGif134OTzMtO N4KppaoRSSNFtNTH4ee5+/zQAO9T2LiRZ/3clz6fvCZzIScp1ZZXr1usC4/TiWMiz/Rsll 0M4dU+LdvwYJbhwcNyQIjWEIPQQ2c6Iov+aacnOGuYeNtrUfjTjW+ruvx4nUh5SQYs40nj CbFVQ7iGpDs5NpcLD0C+XKum5HimY4sSk3b7IsZFH7i0Vr9a4MSXVq2S90Vx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1728482589; h=from:from: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; bh=1WhxVXkOe67dMgsIbtILe5TqIMke8WpifQF/naTxgbs=; b=U4t91hFRBZb6RaGySkQhm33ubrPYItqIioBOA9XpnHSDaIJXt+hRTte401ab37H4K7jJ2q J0MsRNW6wWYcJDLdovlE9EZOTMRmo5nMLCIz0m81pgMGhlF4Ka9dTa84+xpA2FGbQiAoK6 frYaUXjmFWgn71z/HhHtZ7Q79aQLo3qqcpw27PFjUaxI3/1xB3jRC/IFShDgENPp/Ffqcp xRPXK3r1EYRCzstVzAPjOM0CiTLV5htPsnR6/D1ZpW/YVGu6nKMXXvqs64MrfnDDbXh7Jw w/CpW0pzZCBVy3d/Ir1yp/uZSQXGaozuI1BMMttYoksyt/vrVD+06CrSmYSd6w== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sakkinen smtp.mailfrom=jarkko.sakkinen@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1728482589; a=rsa-sha256; cv=none; b=qoocbuawjCnwvoHoTlOjBGRn5O1iCST8F38ExWGE6qvl3v/HgS+UUK83sxdFcq2188GePA WbN3V0RRjAEqj8vd4lYTzITequFL8Rka0DqsMhdS6Bo6J86Atj9f0A0C3uNPmXkqauTwe1 0W1Jj0LKr2jMDh/U1gJKbGkaqUFnxZI0yHwV3PxfhkVdUgLVBZXl+Cvbr+2yb7oXrNA09l 6CR10uXS3CBscLWeR3coCivO7WsaC5SIF0Rfs+DW/Sl0Ysbno3D55JBL6nXEk0fqXrYfKy DqP1H+rbxwy/HFjvzSxDuwqz26mp8wIPKGMKkhlEHz0cuvkaRcvg8fcRJouFLA== Message-ID: <8a696002d50823c9fefdc07db5e5d56ecf3e1c7d.camel@iki.fi> Subject: Re: VMA merging updateds? From: Jarkko Sakkinen To: Lorenzo Stoakes Cc: "Huang, Kai" , linux-sgx@vger.kernel.org, linux-mm@kvack.org Date: Wed, 09 Oct 2024 17:03:07 +0300 In-Reply-To: <4ed9e4bb-5daa-4241-863d-4bbe923a7ffc@lucifer.local> References: <51631b6d-5138-4195-8722-651d9ea79dc1@intel.com> <2ba91a26-71b6-4150-9d8d-d5517d316808@lucifer.local> <4ed9e4bb-5daa-4241-863d-4bbe923a7ffc@lucifer.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) MIME-Version: 1.0 X-Stat-Signature: dy6hexs4ryy9b95ghf5u9rzxdnykjbwg X-Rspamd-Queue-Id: 3023980004 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1728482591-270297 X-HE-Meta: U2FsdGVkX1+LMC8RfL6E7cNUSVODRu4+DyLYZspM3/+A6mwls2Zp/TvlWP6//czpK1kPONHQsg0KKHFpSjeooDZhDfsDfnrJnZx9H6KCYF9O3VPs/G6u+OmnZM/78chT7ZVN0TT8Vvtto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H3zGjRqTgQSg8PKqy0la7IPTbsf72FDHKckAfSW5qExu+YX7ybe8gsHrYvSa1+S9sQAGlvAw74xbJoAIYt/BdcFt+dPpGnqM X-Bogosity: Ham, tests=bogofilter, spamicity=0.000030, 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 Mon, 2024-09-30 at 09:05 +0100, Lorenzo Stoakes wrote: > > So I get on this first and come back to this lore thread later when > > I have some more experience on the topic. >=20 > OK cool let's revisit this when you've done that. >=20 > I think if you did want assistance from VMA merging what I delineated > above > is the only sensible way forward, afaict. So I did run some tests and since a TEE (trusted execution environment) needs in all cases idea what it expects kernel to do all TEE's need a memory manager. Enarx is multi-arch, and in the case of SGX there is permissions bits per page owned by the enclave, on VM based confidential computing (such as AMD SEN-SNP) there's some other weird shenanigans but across all arhitectures there exists a constraint, which causes the need. I.e. whatever happens in mm in kernel side cannot simplify the implementation. The current implementation of Enarx does not merge but I did some experimental change doing "munmap and mmap" dance and I don't see any mentionable change in the benchmarks. So I came from the wrong early assumptions and made wrong conclusions in the first place, i.e. somehow this mmledger crate could rendered out. Had not looked at the code base either for 1.5 years but should have started what I've now done first in order to recall all the consraints. BR, Jarkko