From: Grant Likely <grant.likely@linaro.org>
To: Roy Franz <roy.franz@linaro.org>,
linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, matt.fleming@intel.com,
linux@arm.linux.org.uk
Cc: leif.lindholm@linaro.org, dave.martin@arm.com,
msalter@redhat.com, patches@linaro.org,
Roy Franz <roy.franz@linaro.org>
Subject: Re: [PATCH V5 2/6] Add shared update_fdt() function for ARM/ARM64
Date: Thu, 05 Dec 2013 19:24:56 +0000 [thread overview]
Message-ID: <20131205192456.1B602C40785@trevor.secretlab.ca> (raw)
In-Reply-To: <1385595115-21488-3-git-send-email-roy.franz@linaro.org>
On Wed, 27 Nov 2013 15:31:51 -0800, Roy Franz <roy.franz@linaro.org> wrote:
> Both ARM and ARM64 stubs will update the device tree
> that they pass to the kernel. In both cases they
> primarily need to add the same UEFI related information,
> so the function can be shared.
> Create a new FDT related file for this to avoid use
> of architecture #ifdefs in efi-stub-helper.c
> Change EFI allocation type for memory map to
> EFI_RUNTIME_SERVICES_DATA, since we are passing
> this buffer to the kernel, or immediately freeing it.
>
> Signed-off-by: Roy Franz <roy.franz@linaro.org>
Hi Roy,
Comments below...
> +static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
> + void *fdt, int new_fdt_size, char *cmdline_ptr,
> + u64 initrd_addr, u64 initrd_size,
> + efi_memory_desc_t *memory_map,
> + unsigned long map_size, unsigned long desc_size,
> + u32 desc_ver)
> +{
> + int node;
> + int status;
> + u32 fdt_val32;
> + u64 fdt_val64;
> + /* Copy definition of linux_banner here. Since this code is
> + * built as part of the decompressor for ARM v7, pulling
> + * in version.c where linux_banner is defined for the
> + * kernel brings other kernel dependencies with it.
> + */
> + const char linux_banner[] =
> + "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
> + LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
This is inherently fragile because the string is now defined in two
places. This issue shouldn't hold off merging the patch, but a follow up
patch should be crafted to make it possible to pull in version.c without
the other dependencies....
Then again, the version.c strings have a very big "DON'T TOUCH" warning
on them so I'm probably worrying about nothing. :-)
> +
> + status = fdt_open_into(orig_fdt, fdt, new_fdt_size);
> + if (status != 0)
> + goto fdt_set_fail;
> +
> + node = fdt_subnode_offset(fdt, 0, "chosen");
> + if (node < 0) {
> + node = fdt_add_subnode(fdt, 0, "chosen");
> + if (node < 0) {
> + status = node; /* node is error code when negative */
> + goto fdt_set_fail;
> + }
> + }
> +
> + if ((cmdline_ptr != NULL) && (strlen(cmdline_ptr) > 0)) {
> + status = fdt_setprop(fdt, node, "bootargs", cmdline_ptr,
> + strlen(cmdline_ptr) + 1);
> + if (status)
> + goto fdt_set_fail;
> + }
> +
> + /* Set intird address/end in device tree, if present */
sp. initrd
None of the above comments are blockers though.
Acked-by: Grant Likely <grant.likely@linaro.org>
next prev parent reply other threads:[~2013-12-05 19:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 23:31 [PATCH V5 0/6] Add ARM EFI stub Roy Franz
2013-11-27 23:31 ` [PATCH V5 1/6] efi-stub.txt updates for ARM Roy Franz
2013-11-29 10:36 ` Matt Fleming
2013-12-05 15:19 ` Grant Likely
2013-11-27 23:31 ` [PATCH V5 2/6] Add shared update_fdt() function for ARM/ARM64 Roy Franz
2013-11-29 11:30 ` Matt Fleming
2013-12-02 14:56 ` Mark Salter
2013-12-02 23:09 ` Roy Franz
2013-12-05 19:24 ` Grant Likely [this message]
2013-12-06 0:58 ` Roy Franz
2013-12-05 19:27 ` Grant Likely
2013-11-27 23:31 ` [PATCH V5 3/6] Add strstr to compressed string.c for ARM Roy Franz
2013-11-27 23:31 ` [PATCH V5 4/6] Add EFI stub " Roy Franz
2013-12-05 20:00 ` Grant Likely
2013-12-06 1:25 ` Roy Franz
2013-11-27 23:31 ` [PATCH V5 5/6] Disable stack protection for decompressor/stub Roy Franz
2013-11-27 23:31 ` [PATCH V5 6/6] Add config EFI_STUB for ARM to Kconfig Roy Franz
2013-12-05 20:04 ` Grant Likely
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=20131205192456.1B602C40785@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=dave.martin@arm.com \
--cc=leif.lindholm@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=matt.fleming@intel.com \
--cc=msalter@redhat.com \
--cc=patches@linaro.org \
--cc=roy.franz@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®