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 09428D8062F for ; Wed, 15 Jan 2025 18:53:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vCB8Fs0wrTGsSjry3r3Dc/o96yVr5m6B9PTwQ5HxTOE=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: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-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1736967188; v=1; x=1737226387; b=fnZtQQlCNDe3iH7yOIkOID3ElWl4bGgWQOEuJRiNtOjPOhjTHb+Oz//GYm8P0ELUDhltKta6 uIlBZkS4PNuix2Q+d42marGBoo9h9FxrNIpy3Bw50mb0GyDm1nmlndFPE2rZNk3zqJrN/vlRzVA o7akm2z0MsTVYSqLWjnIPAXYSY7vc98gQFBvZiapV1QLpR8w8MQ1muLAZ9lzhJqepAXN7UutLz0 MbxnigOOGvJb+JJhCdlnc7MiXslNbKJuZmSNCf779ebeCSCMuWlXJyE2QXvS9iqIoZErUG1p25X calrAkNbQzDTnH/RNmXPqqKyUfNF5d6efdQbwS6VwtTvQ== X-Received: by 127.0.0.2 with SMTP id ejBxYY7687511xw3o1f0bNZx; Wed, 15 Jan 2025 10:53:07 -0800 X-Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.web10.16301.1736509331261760389 for ; Fri, 10 Jan 2025 03:42:11 -0800 X-Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d4e2aa7ea9so3744350a12.2 for ; Fri, 10 Jan 2025 03:42:11 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVKN9cZi87jBeQ1Ocv9jqwEEEy4A7+0u0qv7UfGf4Ym7ifqkRHVehk3dE8h1oTfbROypAXj5A==@edk2.groups.io X-Gm-Message-State: Croi8B1PdS3mECk8rus75ZlHx7686176AA= X-Gm-Gg: ASbGncvG2G/ava6eGv9Rp3ZILwglpubdcjrXb1h8bdL/tEp9E8tgqT4y10KC+vbDtgH WzQe51I48VhBA8puVro+F1j0W6emp2UUI7/HEDBuIYrMNa4F66GYwAjScRiQFZkrGQbGarjkIoQ KmKOs0X+NgoDl5tJc/DRSjEzqTtVxTsVOtC3LgshNZ7+QAzl6xJyJb0YAfdO/GiBDUpra8Fnf1B /nKJRhdbxg7Kmrld3FiNz+yr4czgtu6ZlzjfQw8iA8B6hmBPex5jE0tbdrWGgjaLhRZsGGFUbT/ +jmGPcXOxvYyJn7722f2541O69sA X-Google-Smtp-Source: AGHT+IFqYTiXpAtyFHsSTe2ln++HKgU0ODNtcI+FY2vTwxc+2zrHSgT1LKHx/WkhY/e2BplHhyn4nA== X-Received: by 2002:a17:906:f582:b0:aa6:7165:5044 with SMTP id a640c23a62f3a-ab2abc789c7mr828412766b.44.1736509329336; Fri, 10 Jan 2025 03:42:09 -0800 (PST) X-Received: from ?IPV6:2a03:83e0:1126:4:829:739b:3caa:6500? ([2620:10d:c092:500::5:e213]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c964992esm156460966b.185.2025.01.10.03.42.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 03:42:09 -0800 (PST) Message-ID: <31ea58e9-147e-4c6d-861e-97f0cc7792bb@gmail.com> Date: Fri, 10 Jan 2025 11:42:08 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [RFC 2/2] efi/memattr: add efi_mem_attr_table as a reserved region in 820_table_firmware To: Dave Young Cc: linux-efi@vger.kernel.org, devel@edk2.groups.io, kexec@lists.infradead.org, ardb@kernel.org, hannes@cmpxchg.org, x86@kernel.org, linux-kernel@vger.kernel.org, leitao@debian.org, gourry@gourry.net, kernel-team@meta.com References: <20250108215957.3437660-1-usamaarif642@gmail.com> <20250108215957.3437660-3-usamaarif642@gmail.com> <4ed67e5b-c2ea-4dc3-b4c5-f8f112b0cd40@gmail.com> From: "Usama Arif via groups.io" 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: usamaarif642@gmail.com Reply-To: devel@edk2.groups.io,usamaarif642@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=fnZtQQlC; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io On 10/01/2025 11:20, Dave Young wrote: > On Fri, 10 Jan 2025 at 19:18, Dave Young wrote: >> >> On Fri, 10 Jan 2025 at 19:12, Usama Arif wrote: >>> >>> >>> >>> On 10/01/2025 02:50, Dave Young wrote: >>>> Hi Usama, >>>> >>>> On Thu, 9 Jan 2025 at 06:00, Usama Arif wrote= : >>>>> >>>>> When this area is not reserved, it comes up as usable in >>>>> /sys/firmware/memmap. This means that kexec, which uses that memmap >>>>> to find usable memory regions, can select the region where >>>>> efi_mem_attr_table is and overwrite it and relocate_kernel. >>>> >>>> Is the attr table BOOT SERVICE DATA? If so, does efi_mem_reserve() >>>> work for you? >>>> Just refer to esrt.c. >>>> >>> >>> Hi Dave, >>> >>> Its a bit difficult to reproduce the problem and therefore test the fix= , but >>> we are seeing it a lot in production. Ard proposed the same thing in >>> https://lore.kernel.org/all/6b4780a5-ada0-405e-9f0a-4d2186177f29@gmail.= com/ >>> but as I mentioned there, I dont think that efi_mem_reserve would help, >>> as efi_mem_reserve changes e820_table, while kexec looks at >>> /sys/firmware/memmap which uses e820_table_firmware. >> >> I sent a question to pm people, if the sysfs memmap comes from >> e820_table then it will be fine. Let's see: > s/e820_table/e820_table_kexec >=20 Do you mean change /sys/firmware/memmap to point to e820_table_kexec instea= d of e820_table_firmware [1]?=20 I thought of doing this when the first bug was encountered last year, but didn't do it as I thought it would be frowned upon to change what sysfs fil= e exposes to userspace. [1] https://elixir.bootlin.com/linux/v6.12.6/source/arch/x86/kernel/e820.c#= L31 >> https://lore.kernel.org/all/CALu+AoS-nk4u=3D9UYP7BLS=3DdiOxjJRf+vfv7KHXG= =3DuXozoYazsw@mail.gmail.com/ >> >>> >>> Thanks, >>> Usama >>> >>>> Thanks >>>> Dave >>>> >>> >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121012): https://edk2.groups.io/g/devel/message/121012 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-