From patchwork Sun May 19 19:18:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Stratiienko X-Patchwork-Id: 1936830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=RF4L7eeM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vj9VR2ynvz20d9 for ; Mon, 20 May 2024 05:19:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 023BC8817C; Sun, 19 May 2024 21:19:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="RF4L7eeM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B1268817C; Sun, 19 May 2024 21:19:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 24CB288193 for ; Sun, 19 May 2024 21:19:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=r.stratiienko@gmail.com Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-34eb52bfca3so1704995f8f.0 for ; Sun, 19 May 2024 12:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716146342; x=1716751142; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=5NlsrRGReUVabQ3nzOPMqaF2HNneAUD6Al0bjGEGQsM=; b=RF4L7eeMEeOs3CrfrkE4UoYdIYOcPU5KQVVzCToTZFNxzAx9zRrI9JlISTQaXNTfks GmWXKB55d+x+zrVhrFURX9QM/S0eBITXNjJK9SVUUkoTtlTsXFLNhbsuiQBvmbia0vpI U5XZmnWEkzqVzmKjIWSUc7vg+tJZ7/Nv9rGfMcKMFSRCuBmph7CsOymfNAqt2BaWx4UP sI3QQsp/WOQ35/l/cupVaXSu4jNiELntNHIXT1/hs35FV2ethXnAdWex/HRcloPMITyg WVcjGZr/bPCfXEAMv6lQrCz7csxbzWoMjlM6N4vsZ9W+0SwtAcuvS3FVZP6rJmiQrZeJ Khyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716146342; x=1716751142; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5NlsrRGReUVabQ3nzOPMqaF2HNneAUD6Al0bjGEGQsM=; b=cw4CvnYLRJUnGQ97XFqVlgPq+MZmVX85jzmJsw6JQvK6kuR/t1CqyaYXogv16XLGxR 2ZcQaVRqjptl7rI+D/277247gPdhJ1UtTgCMXitIqxhH/YVqbGY0uzOqfWuCe6DnGUZw 95u37VmvFOUThdJa7y4Z+biO9e/w+3CO0EFTGERqwKBIUfqTd4kDhAPdyjpeLdnaxO7k OlMgddegTvGFrUhkDrk1au8wsttwj5ImPvIQcqvd2BzGQSOuhTywqUkGyDXq4WzO5hHE 3RZe1USHDm1us0B9yPt0MggoIPgXC+ow9K2Vbetd8A6o+kmNTYYnLjeZ6F7uTXR4Hilg uSCw== X-Forwarded-Encrypted: i=1; AJvYcCV5HoYM7u2++yfVpChOA79eW2mwOZEbB4swt5UH/P0sdHTgLEdAAnKafyjgDIM0FXiAr36WGLmKJfN1qNGQoomWOhqGjQ== X-Gm-Message-State: AOJu0YyS5EelmPpJdpo0++pUtVqpYGmK+6QeQXL4kw1i7YE6nmx2MXnW /HiGXvWuQRhyLv97wmckFAAAMV4jiyWGNwp+ROv5WkvBg4lTtMBJ X-Google-Smtp-Source: AGHT+IHGczgShwJF2rId1HNQuMy6IxtnAQH+GCRVkaIcDdVnXM7wN/ll5C+fcCxnkFjbqGCuVN0S2A== X-Received: by 2002:adf:f342:0:b0:34d:9ec4:7b78 with SMTP id ffacd0b85a97d-3504a969229mr21549617f8f.56.1716146342222; Sun, 19 May 2024 12:19:02 -0700 (PDT) Received: from roman-envy-fast.. ([46.172.77.250]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b89583dsm27411682f8f.33.2024.05.19.12.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 12:19:01 -0700 (PDT) From: Roman Stratiienko To: r.stratiienko@gmail.com, mkorpershoek@baylibre.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: [PATCH 0/3] Android partition load optimization Date: Sun, 19 May 2024 19:18:53 +0000 Message-Id: <20240519191856.2582174-1-r.stratiienko@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This series offers an optimization of the Android image loading procedure. The first patch introduces a new 'abootimg load' command, which loads partitions from storage into memory. It uses malloc() to find a free memory region, whereas previously, the developer had to find a free memory region by himself. The remaining patches reduce boot time by avoiding extra disk activity. The second patch implements get_preloaded_partition(), which picks a partition from memory previously loaded by the 'abootimg load' command. The third patch optimizes the 'abootimg load' command by skipping zeros loading at the partition's end. Roman Stratiienko (3): abootcmd: Add load subcommand avb: Implement get_preloaded_partition callback abootimg: Implement smart image load feature boot/image-android.c | 70 ++++++++++++++++++++++++++ cmd/abootimg.c | 116 ++++++++++++++++++++++++++++++++++++++++++- common/avb_verify.c | 53 ++++++++++++++++++++ include/image.h | 12 +++++ 4 files changed, 250 insertions(+), 1 deletion(-)