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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9425CC433FE for ; Wed, 30 Nov 2022 06:52:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F39A08533F; Wed, 30 Nov 2022 07:51:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vQSAU8WY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 018A185348; Wed, 30 Nov 2022 07:51:56 +0100 (CET) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6807785339 for ; Wed, 30 Nov 2022 07:51:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x62b.google.com with SMTP id ml11so14151831ejb.6 for ; Tue, 29 Nov 2022 22:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6ZDpiC8w95viMm9P+hb51GX/X+2zw+OGzbG81A1q+Eo=; b=vQSAU8WYBOtDQ6ihzKOfk2x+FzhlRjJzvJwSvAGRgiXVkvLAQbOyeyqCFtk7coBt3A ry+61PasTW9+EQtpVD/M4lfOQ351KndGR4FxPy9HgcpXLFR3kiX6JECg7gQ6FGl2yOFI pd8ip+uAMuW7KMTBM5ajrZXeH2WLR4zaLHlwKlScvU57xZPf9FBDf2oK85OXbX+Bu97+ 01KtPbx/AfkVNwgx4InkPeuebvuCe6AZVsCV/lSxdVhYFnSCkgvJXoCzH3fNmXm/bzvF QEYHZUaUxa6SGNMjjxMWGn8I0j8pyo3xdujBycrpBmocp99r6uwbgviv37vP3UvD85RT Nn5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ZDpiC8w95viMm9P+hb51GX/X+2zw+OGzbG81A1q+Eo=; b=0Uxn7nF7aibNe3uZDKwkv/KowsN4trikWjNZr/ksP0moaYEM0hSG4cMloN7rb97WAm 4T/cWnkzTVWc7LN/odBNbkmXPvHbOPIM+sooJKZQqwds/pjseoaN9f8sKFdUVM7pwxCk UKSpSDnGpNNTzbyZCKQIWqgZylIClYEwkh5yvkIJ4ntpgr8Wu7Ud5mEUjmoDuZ5jYQms /R4PHEPHPVYyyZsmE+KZANBCPDTZn+mDF7diHLz5/dg/kYglYPAtkdSX+0E3jRh1oW++ 7HmefvWXrUQo2+BsGqSv70zu+t2gAM/dK10wTa36BYF71TaqJGyArC4yvkpG06ee+fC7 rZSQ== X-Gm-Message-State: ANoB5pmwLs/xzebCqOQKj2l54iET90rLHd3LxHMnBOVSQMwxNbG95saP QMp2zo+ixtgfhbwEGy1JDAaZWA== X-Google-Smtp-Source: AA0mqf5vLBzCaFg9Sx2Md+n813zq3bSyWZeRI0GtpQb/HIjtg4GlfsTPp9qMDTSofFjMqkDIzYfYDg== X-Received: by 2002:a17:907:3fa9:b0:7bf:5446:389d with SMTP id hr41-20020a1709073fa900b007bf5446389dmr12807713ejc.449.1669791112970; Tue, 29 Nov 2022 22:51:52 -0800 (PST) Received: from hera (ppp078087234022.access.hol.gr. [78.87.234.22]) by smtp.gmail.com with ESMTPSA id b18-20020a1709063cb200b00734bfab4d59sm285332ejh.170.2022.11.29.22.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 22:51:50 -0800 (PST) Date: Wed, 30 Nov 2022 08:51:47 +0200 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: =?iso-8859-1?Q?Fran=E7ois-Fr=E9d=E9ric?= Ozog , u-boot@lists.denx.de Subject: Re: [PATCH 1/1] efi_loader: don't use EFI_LOADER_DATA internally Message-ID: References: <20221129150413.43856-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Tue, Nov 29, 2022 at 06:35:40PM +0100, Heinrich Schuchardt wrote: > On 11/29/22 16:38, Ilias Apalodimas wrote: > > Hi Heinrich, > > > > On Tue, 29 Nov 2022 at 17:04, Heinrich Schuchardt > > wrote: > > > > > > Memory allocated by U-Boot for internal usage should be > > > EFI_BOOT_SERVICES_DATA or _CODE or EFI_RUNTIME_SERVICES_DATA or _CODE. > > > > Agreed, EFI_LOADER_DATA should be for EFI apps. > > > > > > > > Reported-by: François-Frédéric Ozog > > > Signed-off-by: Heinrich Schuchardt > > > > [...] > > > > > diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c > > > index a17b426d11..0c336f98d2 100644 > > > --- a/lib/efi_loader/efi_memory.c > > > +++ b/lib/efi_loader/efi_memory.c > > > @@ -823,7 +823,7 @@ static void add_u_boot_and_runtime(void) > > > uboot_stack_size) & ~EFI_PAGE_MASK; > > > uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) - > > > uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; > > > - efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_LOADER_DATA, > > > + efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_DATA, > > > false); > > > > I am not sure if we should have this as _DATA or _CODE. None of these > > is an exact match of what we allocate here and both of these are > > backed by EFI_MEMORY_WB. So your reasoning here is prefer _DATA since > > it's not memory that holds boottime service drivers? > > We are lacking a clear separation of data and code here. We would have to > add another pointer global data and enforce that data is in separate pages > if we wanted to do so. > > The same problem exists when loading applications as some sections are data > and others are code but we put all into EFI_LOADER_CODE. > > Please, tell if you would prefer EFI_BOOT_SERVICES_CODE here. I think I prefer _CODE, but I don't really mind tbh With or without the changes. In case you update the patch can you add a sentence along the lines of "EFI_LOADER_DATA/CODE is reserved for EFI applications" Reviewed-by: Ilias Apalodimas > > Best regards > > Heinrich