From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Roman Stratiienko <r.stratiienko@gmail.com>,
r.stratiienko@gmail.com, igor.opaniuk@gmail.com,
dsimic@manjaro.org, sjg@chromium.org,
ilias.apalodimas@linaro.org, xypron.glpk@gmx.de,
eajames@linux.ibm.com, marek.vasut+renesas@mailbox.org,
paulerwan.rio@gmail.com, u-boot@lists.denx.de
Subject: Re: [PATCH 2/3] avb: Implement get_preloaded_partition callback
Date: Tue, 28 May 2024 09:32:48 +0200 [thread overview]
Message-ID: <87ttiigzmn.fsf@baylibre.com> (raw)
In-Reply-To: <20240519191856.2582174-3-r.stratiienko@gmail.com>
Hi Roman,
Thank you for the patch.
On dim., mai 19, 2024 at 19:18, Roman Stratiienko <r.stratiienko@gmail.com> wrote:
> AVB can reuse already loaded images instead of loading them
> from the disk.
>
> The get_preloaded_partition now looks for the env. variables
> set by the 'abootimg load' to find the correct partition in RAM.
>
> Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
> ---
> common/avb_verify.c | 53 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/common/avb_verify.c b/common/avb_verify.c
> index cff9117d92..d2626e8844 100644
> --- a/common/avb_verify.c
> +++ b/common/avb_verify.c
> @@ -6,6 +6,7 @@
> #include <avb_verify.h>
> #include <blk.h>
> #include <cpu_func.h>
> +#include <env.h>
> #include <image.h>
> #include <malloc.h>
> #include <part.h>
> @@ -595,6 +596,55 @@ static AvbIOResult read_from_partition(AvbOps *ops,
> num_bytes, buffer, out_num_read, IO_READ);
> }
>
> +#ifdef CONFIG_ANDROID_BOOT_IMAGE
> +/**
> + * get_preloaded_partition() - Gets the starting pointer of a partition that
> + * is pre-loaded in memory, and save it to |out_pointer|.
> + *
> + * If the partition is not pre-loaded in memory, the out_pointer shall not be
> + * modified.
> + *
> + * @ops: contains AVB ops handlers
> + * @partition: partition name, NUL-terminated UTF-8 string
NUL -> NULL
> + * @num_bytes: amount of bytes to read
> + * @out_pointer: pointer to the starting address of the partition
> + * @out_num_bytes_preloaded: amount of bytes pre-loaded in memory
> + *
> + * @return:
> + * AVB_IO_RESULT_OK, if partition was found or was not found
Add:
AVB_IO_RESULT_ERROR_IO, if partition size is smaller than requested
With both small remarks addressed, please add:
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> + *
> + */
> +static AvbIOResult get_preloaded_partition(AvbOps *ops, const char *partition, size_t num_bytes,
> + uint8_t **out_pointer, size_t *out_num_bytes_preloaded)
> +{
[...]
> --
> 2.40.1
next prev parent reply other threads:[~2024-05-28 7:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-19 19:18 [PATCH 0/3] Android partition load optimization Roman Stratiienko
2024-05-19 19:18 ` [PATCH 1/3] abootcmd: Add load subcommand Roman Stratiienko
2024-05-28 7:22 ` Mattijs Korpershoek
2024-05-19 19:18 ` [PATCH 2/3] avb: Implement get_preloaded_partition callback Roman Stratiienko
2024-05-28 7:32 ` Mattijs Korpershoek [this message]
2024-06-10 16:22 ` Igor Opaniuk
2024-05-19 19:18 ` [PATCH 3/3] abootimg: Implement smart image load feature Roman Stratiienko
2024-05-28 7:49 ` Mattijs Korpershoek
2024-06-10 16:08 ` Igor Opaniuk
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=87ttiigzmn.fsf@baylibre.com \
--to=mkorpershoek@baylibre.com \
--cc=dsimic@manjaro.org \
--cc=eajames@linux.ibm.com \
--cc=igor.opaniuk@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=paulerwan.rio@gmail.com \
--cc=r.stratiienko@gmail.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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