From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id EE74C740038 for ; Wed, 15 Jan 2025 18:53:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cY17J9TvpZcB8Fe2nerMfwfD4Ct3MMkX24bo/qKD/KE=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20240830; t=1736967190; v=1; x=1737226389; b=LtRIvqQP9pQzB4g2ICri4CD8EqXdEm3mXvqjoXvn7xjGm+1TruP6rYhiOkEe6/crZxsW3CEq G+a0YWR7WUlWBsNVoUUvwJxZJRBJK3IH0Oa8H6C7mfKqXQqsXOjTTFqhA2B1lmIt2pJNhU8NVP0 RU2jFaCsxHHAfIvdwRzg7ArqcHCzZzCZORzkYAZ7ecZ+HpJ/rpNZwmX0FzK3NWF/zv2vggYjZXh NrL/a9vlZ7no2i9tp9dREknUMZ5EsvRMloV2IsXJZlNosPhXTZhuUz7HdRP91VE+4Kb0ETRhAne 74dL/wbxDi1neL5Juk9kRYKUPiKYieq3xuQ5MMZs3GUnw== X-Received: by 127.0.0.2 with SMTP id jEx9YY7687511xnFzPdAFIuY; Wed, 15 Jan 2025 10:53:09 -0800 X-Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web10.16244.1736509002713468360 for ; Fri, 10 Jan 2025 03:36:43 -0800 X-Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-aa69107179cso389713966b.0 for ; Fri, 10 Jan 2025 03:36:42 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUH/38A2X545sGPApQ6vdcnLtdIT3GHWzmTD9UBvjU3NSu/U6nt0OrfIyRUtEJ4kt9e2Ku73w==@edk2.groups.io X-Gm-Message-State: d87FJtEpEb10ua58fwBzL8KIx7686176AA= X-Gm-Gg: ASbGncso0xqyc+F+ioJ143FwhGinMXZH8Woxrkg0KarRpi+ZnSq1IqXuv7G3gRxtg79 FimuFA6vjTh/HRsqKK8zQ37pgA9TE0symg2sC1UDbTeauevAVm4Xs9p+ggM3oSyEMO1YCYNo2SW PGkRUoTWly+qOajs9WyvJJVacg1kJHLTU3Z2lQcXYqjYHCNJzRU5KPpSAh4nPW+QfGrAKfDJesW XAFT/NoJkwYO/oEke+6/dCXgz+l58P4UNNuXXyZQLr11CU= X-Google-Smtp-Source: AGHT+IGIZlaaiO27kV1c6pYvSmK5yivViBw4/s4Cw1C7tk9hpsncmsora6RSQ36sS5AvV4d5XB7zDw== X-Received: by 2002:a17:906:7311:b0:aab:7467:3f6a with SMTP id a640c23a62f3a-ab2ab6a45f5mr887149666b.21.1736509000764; Fri, 10 Jan 2025 03:36:40 -0800 (PST) X-Received: from gmail.com ([2a03:2880:30ff:4::]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c905ec09sm157964566b.32.2025.01.10.03.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 03:36:40 -0800 (PST) Date: Fri, 10 Jan 2025 03:36:38 -0800 From: Breno Leitao To: Ard Biesheuvel Cc: Usama Arif , linux-efi@vger.kernel.org, devel@edk2.groups.io, kexec@lists.infradead.org, hannes@cmpxchg.org, dyoung@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, gourry@gourry.net, kernel-team@meta.com Subject: Re: [edk2-devel] [RFC 2/2] efi/memattr: add efi_mem_attr_table as a reserved region in 820_table_firmware Message-ID: <20250110-tricky-grasshopper-of-maturity-21771f@leitao> References: <20250108215957.3437660-1-usamaarif642@gmail.com> <20250108215957.3437660-3-usamaarif642@gmail.com> MIME-Version: 1.0 In-Reply-To: Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 15 Jan 2025 10:52:52 -0800 Resent-From: leitao@debian.org Reply-To: devel@edk2.groups.io,leitao@debian.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=LtRIvqQP; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hello Ard, On Fri, Jan 10, 2025 at 08:32:08AM +0100, Ard Biesheuvel wrote: > On Thu, 9 Jan 2025 at 17:32, Usama Arif wrote: > > I think in the end whoevers' responsibility it is, the easiest path forward > > seems to be in kernel? (and not firmware or libstub) > > > > Agreed. But as I pointed out in the other thread, the memory > attributes table only augments the memory map with permission > information, and can be disregarded, and given how badly we mangle the > memory map on x86, maybe this is the right choice here. If this augmented memory is not preserved accross kexec, then the next kexec'ed kernel will be able to find the original table? I understand that the memattr region(s) need to be always (in each kexec instances) `memblocked_reserved` to protect it from being used as a System RAM, right? Thus, if it is not passed throught e820, kexec'ed kernel needs to fetch it again from original EFI table at kexec/boot time. This brings me another question. If the kexec'ed kernel sees the original memory, why can't it augment/update the RX permissions *again*, instead of passing the previous augmented version from previous kernel in this crazy dance. > This is a kexec problem (on x86 only) so let's fix it there. Would you mind explaining what kexec needs to be done differently? Should it preserve the augmented memattr table independently if it is mapped in e820? Thank you! --breno -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121011): https://edk2.groups.io/g/devel/message/121011 Mute This Topic: https://groups.io/mt/110518541/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-