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 27BFEC05027 for ; Wed, 1 Feb 2023 21:23:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 891BA85CD0; Wed, 1 Feb 2023 22:22:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Bhvs5/tN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1851E85D62; Wed, 1 Feb 2023 22:21:39 +0100 (CET) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 75F6385D24 for ; Wed, 1 Feb 2023 21:21:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-yb1-xb33.google.com with SMTP id e15so23855370ybn.10 for ; Wed, 01 Feb 2023 12:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=N4lmk6dBqmHNUTvTM7YFCOull8FK7lr/LHAoJubP6sY=; b=Bhvs5/tNoErw7Ub3n5aNUjtvz2kgqQOlI9ESXn6dnwnB9RojMI7J/g3xh72l38tnVt LuAVGu45u93Jnz2omPHgDSzRwZyCpSy9Mljcunc1pyXmQuHPEayJdpUJRxracqCqEVfP FSTB6VU4yXeOmKlIQ2E+ybU1pl07YvBldtMmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N4lmk6dBqmHNUTvTM7YFCOull8FK7lr/LHAoJubP6sY=; b=2+mDvjukvI3QJw5GODgeCteZP7OFoJrvKdup/86/aUUJAcoYzl41t3hasj/t+plkdu ulFSt5+/tjDU9NUVn7LCs0eyHYx+Tt3Ret3Yeo9cqYrJ35cgXopSgzCY1SRz99khQ5An c1JTwPC6HW0umo4GZesOF/g0NfJ2GAIadsvIHQt4ZI6v5VVAS9gt6MJSz/2kY6TFQ9dN j+plRzbq5n6xUO1GtIytT2kwsjLSHuMANiZzzozz2kkZ8Ksc0nyrc0syWiV9Po31odZR Na2rmCw5VKOKec1JhN16OZ7ZMogxvTqvzKmIYH7K4Jv5cVFaveX3qjB6Iqs/x4s+7Zrt Qh6Q== X-Gm-Message-State: AO0yUKVTt7iVWrDzG6bDVtc39t3bUaLiiZ/pUbACRLwrlsQFIpuKlVo2 HlQ6/kMm/2JV+QBVkR4Ja0ADB63gyRteShco2oG7FQ== X-Google-Smtp-Source: AK7set+RbUoahESiMySn/qkjs5HzPYeKjJ6oE4V3Vwgvy9CnOD/ZO7daF8FV7tkBcql7KfaZu80DpLXu/qfoJgN4Te0= X-Received: by 2002:a25:db14:0:b0:80b:5ea9:870 with SMTP id g20-20020a25db14000000b0080b5ea90870mr437712ybf.50.1675282890553; Wed, 01 Feb 2023 12:21:30 -0800 (PST) MIME-Version: 1.0 References: <20230201181016.4145834-1-tobias@waldekranz.com> In-Reply-To: <20230201181016.4145834-1-tobias@waldekranz.com> From: Simon Glass Date: Wed, 1 Feb 2023 13:21:07 -0700 Message-ID: Subject: Re: [PATCH 0/8] blk: blkmap: Composable virtual block devices To: Tobias Waldekranz Cc: xypron.glpk@gmx.de, ilias.apalodimas@linaro.org, u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" 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 Hi Tobias, On Wed, 1 Feb 2023 at 11:10, Tobias Waldekranz wrote: > > Block maps are a way of looking at various sources of data through the > lens of a regular block device. It lets you treat devices that are not > block devices, like RAM, as if they were. It also lets you export a > slice of an existing block device, which does not have to correspond to > a partition boundary, as a new block device. > > This is primarily useful because U-Boot's filesystem drivers only > operate on block devices, so a block map lets you access filesystems > wherever they might be located. > > The implementation is loosely modeled on Linux's "Device Mapper" > subsystem, see the kernel documentation [1] for more information. > > The primary use-cases are to access filesystem images stored in RAM, and > within FIT images stored on disk. See doc/usage/blkmap.rst for more > details. > > The architecture is pluggable, so adding other types of mappings should > be quite easy. > > [1]: https://docs.kernel.org/admin-guide/device-mapper/index.html > > Tobias Waldekranz (8): > image: Fix script execution from FIT images with external data > cmd: blk: Allow generic read/write operations to work in sandbox > blk: blkmap: Add basic infrastructure > blk: blkmap: Add memory mapping support > blk: blkmap: Add linear device mapping support > cmd: blkmap: Add blkmap command > test: blkmap: Add test suite > doc: blkmap: Add introduction and examples > > MAINTAINERS | 9 + > boot/image-board.c | 3 +- > cmd/Kconfig | 19 ++ > cmd/Makefile | 1 + > cmd/blk_common.c | 15 +- > cmd/blkmap.c | 181 +++++++++++++ > configs/sandbox_defconfig | 1 + > disk/part.c | 1 + > doc/usage/blkmap.rst | 109 ++++++++ > doc/usage/index.rst | 1 + > drivers/block/Kconfig | 18 ++ > drivers/block/Makefile | 1 + > drivers/block/blk-uclass.c | 1 + > drivers/block/blkmap.c | 452 +++++++++++++++++++++++++++++++ > include/blkmap.h | 21 ++ > include/dm/uclass-id.h | 1 + > include/efi_loader.h | 4 + > lib/efi_loader/efi_device_path.c | 30 ++ > test/py/tests/test_blkmap.py | 164 +++++++++++ > 19 files changed, 1027 insertions(+), 5 deletions(-) > create mode 100644 cmd/blkmap.c > create mode 100644 doc/usage/blkmap.rst > create mode 100644 drivers/block/blkmap.c > create mode 100644 include/blkmap.h > create mode 100644 test/py/tests/test_blkmap.py > > -- > 2.34.1 > Overall this looks good to me. I'll make suggestions on the individual patches. The main thing to note is that device numbers are an internal thing that I'd like to move away from, so labels are better. Regards, Simon