From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>,
"Trammell Hudson" <hudson@trmm.net>
Cc: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com, wl@xen.org
Subject: Re: [PATCH v4 1/4] efi/boot.c: add file.need_to_free
Date: Thu, 17 Sep 2020 13:06:16 +0200 [thread overview]
Message-ID: <ccff37e4-652c-c7bc-4642-928d28b7ca89@suse.com> (raw)
In-Reply-To: <20200916064358.GP753@Air-de-Roger>
On 16.09.2020 08:43, Roger Pau Monné wrote:
> On Mon, Sep 14, 2020 at 07:50:10AM -0400, Trammell Hudson wrote:
>> @@ -279,13 +280,13 @@ void __init noreturn blexit(const CHAR16 *str)
>> if ( !efi_bs )
>> efi_arch_halt();
>>
>> - if ( cfg.addr )
>> + if ( cfg.addr && cfg.need_to_free )
>> efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
>> - if ( kernel.addr )
>> + if ( kernel.addr && kernel.need_to_free )
>> efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
>> - if ( ramdisk.addr )
>> + if ( ramdisk.addr && ramdisk.need_to_free )
>> efi_bs->FreePages(ramdisk.addr, PFN_UP(ramdisk.size));
>> - if ( xsm.addr )
>> + if ( xsm.addr && xsm.need_to_free )
>> efi_bs->FreePages(xsm.addr, PFN_UP(xsm.size));
All these look to be able to become just "if ( xyz.need_to_free )"
if ...
>> @@ -572,6 +573,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
>> HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
>> ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
>> PFN_UP(size), &file->addr);
>> + file->need_to_free = true;
>
> Strictly speaking, don't you need to set need_to_free only if
> AllocatePages has succeed?
... this was followed, so I think the adjustment wants making.
> I guess it doesn't matter much because addr
> would be zapped to 0 if allocation fails.
Perhaps this zapping then also becomes unnecessary, albeit I
didn't look very closely yet.
Jan
next prev parent reply other threads:[~2020-09-17 11:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 11:50 [PATCH v4 0/4] efi: Unified Xen hypervisor/kernel/initrd images Trammell Hudson
2020-09-14 11:50 ` [PATCH v4 1/4] efi/boot.c: add file.need_to_free Trammell Hudson
2020-09-16 6:43 ` Roger Pau Monné
2020-09-17 11:06 ` Jan Beulich [this message]
2020-09-14 11:50 ` [PATCH v4 2/4] efi/boot.c: add handle_file_info() Trammell Hudson
2020-09-16 6:46 ` Roger Pau Monné
2020-09-17 11:29 ` Jan Beulich
2020-09-14 11:50 ` [PATCH v4 3/4] efi: Enable booting unified hypervisor/kernel/initrd images Trammell Hudson
2020-09-16 7:32 ` Roger Pau Monné
2020-09-16 8:37 ` Trammell Hudson
2020-09-16 9:47 ` Jan Beulich
2020-09-16 10:15 ` Roger Pau Monné
2020-09-17 12:33 ` Jan Beulich
2020-09-17 13:04 ` Trammell Hudson
2020-09-17 13:33 ` Trammell Hudson
2020-09-17 15:10 ` Jan Beulich
2020-09-17 15:21 ` Jan Beulich
2020-09-14 11:50 ` [PATCH v4 4/4] efi: Do not use command line if secure boot is enabled Trammell Hudson
2020-09-16 7:45 ` Roger Pau Monné
2020-09-16 8:50 ` Trammell Hudson
2020-09-16 9:57 ` Jan Beulich
2020-09-17 12:51 ` Jan Beulich
2020-09-17 14:05 ` Trammell Hudson
2020-09-17 15:26 ` Jan Beulich
2020-09-17 15:45 ` Trammell Hudson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ccff37e4-652c-c7bc-4642-928d28b7ca89@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=hudson@trmm.net \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.