🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24477

[PATCH 0/10] MUSE: Userspace backed MTD v4

#24477
From: "Richard Weinberger (sigma star ...
Date: Mon, 30 Nov 2026 08:26
108 lines
11903 bytes
From: Richard Weinberger <richard@nod.at>

After a long hiatus I finally found some time to work on MUSE again.

Rationale:
----------

A common task when working with flash devices is emulating them, to run
tests or to inspect dumps from real hardware. The MTD subsystem has plenty
of emulators for that: mtdram, block2mtd, nandsim.

Each of them implements an ad-hoc MTD and has various drawbacks.
Over the last years some developers tried to extend them, but these attempts
were often rejected because they just added more ad-hoc features instead of
addressing the overall problems.

MUSE is a novel approach to address the need for advanced MTD emulators.
Advanced means in this context: supporting different (vendor specific) image
formats, different ways of fault injection (fuzzing), and recording and
replaying IO to emulate power cuts.

The core goal of MUSE is to have the complexity on the userspace side and
only a small MTD driver in kernelspace.
While playing with different approaches I realized that FUSE offers everything
we need. So MUSE is a little like CUSE, except that it does not implement a
bare character device but an MTD.

Users of MUSE:
--------------

mtdsim[0] is a MUSE based MTD simulator written in Rust I'm currently working
on. So far it can simulate NOR, RAM and NAND style flashes. It can operate in
memory and read/write nanddump style images. It also supports injecting
bit-flips, and recording and replaying IO for deterministic power-cut testing
of the users on top of the MTD.

[0]: https://git.infradead.org/users/rw/mtdsim.git

Changelog:
----------

Changes since v3:
- Moved MUSE driver to drivers/mtd/
- Moved transport related FUSE header defines to include/net/fuse.h,
  including CUSE specific adoptions.
- Many minor bug fixes
- Support for in- and out-band within the same MTD operation
- Code rebased to 7.4-rc4

Changes since v2 (RFC):
- OOB support
- MUSE_READ/WRITE opcodes are no longer a min IO MTD unit
- MTD partitions support via mtdparts string
- More code cleanup
- Code rebased to 5.11-rc4

Changes since v1 (RFC):
- Rewrote IO path, fuse_direct_io() is no longer used.
  Instead of cheating fuse_direct_io() use custom ops to implement
  reading and writing. That way MUSE no longer needs a dummy file object
  nor a fuse file object.
  In MTD all IO is synchronous and operations on kernel buffers, this
  makes IO processing simple for MUSE.
- Support for bad blocks.
- No more (ab)use of FUSE ops such as FUSE_FSYNC.
- Major code cleanup.

This series can also be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git muse_v4

Richard Weinberger (10):
  fuse: Share cuse_parse_one() as fuse_kv_parse_one()
  fuse: Add a public header for users outside of fs/fuse/
  fuse: Add an interface for userspace backed devices
  fuse: Convert CUSE to the interface for userspace backed devices
  fuse: Allow three output arguments per request
  fuse: Add MUSE specific defines to FUSE interface
  mtd: Add MTD_MUSE flag
  mtd: Allow passing a custom mtdparts string to the cmdline parser
  mtd: Implement MUSE - MTD in userspace
  MAINTAINERS: Add entry for MUSE

 Documentation/ABI/testing/sysfs-class-mtd |   8 +
 MAINTAINERS                               |   8 +
 drivers/mtd/Kconfig                       |  15 +
 drivers/mtd/Makefile                      |   1 +
 drivers/mtd/muse.c                        | 995 ++++++++++++++++++++++
 drivers/mtd/parsers/cmdlinepart.c         |  99 ++-
 fs/fuse/Kconfig                           |   4 +
 fs/fuse/Makefile                          |   1 +
 fs/fuse/args.h                            |  44 +-
 fs/fuse/cuse.c                            | 114 +--
 fs/fuse/dev.h                             |  12 +-
 fs/fuse/fuse_dev_i.h                      |   3 +-
 fs/fuse/fuse_i.h                          |   8 +-
 fs/fuse/helper.c                          | 242 ++++++
 include/linux/mtd/partitions.h            |   2 +
 include/net/fuse.h                        |  98 +++
 include/uapi/linux/fuse.h                 | 249 +++++-
 include/uapi/mtd/mtd-abi.h                |   1 +
 18 files changed, 1736 insertions(+), 168 deletions(-)
 create mode 100644 drivers/mtd/muse.c
 create mode 100644 fs/fuse/helper.c
 create mode 100644 include/net/fuse.h

-- 
2.55.0
Technical Details
Message-ID: <20261130082634.2750846-1-rw@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374007-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374007-linux-kernel-netdev=dewy.ru
From: rw@kernel.org ("Richard Weinberger (sigma star gmbh)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH 0/10] MUSE: Userspace backed MTD v4
Date: Mon, 30 Nov 2026 09:26:23 +0100
Organization: Usenet Network
Message-ID: <20261130082634.2750846-1-rw@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1375748"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:YEAGcv5QNCCcBrAmxx0s0dzzGLI= sha256:eJ2Z11/Kod3hEwBDg5FTZFZIJq9Ows/EytzbTwzXzig=
	sha1:O4vlbCxRfioSIsnKtNwrXelU+8w= sha256:P3oobdxerXh600RlizHqII9N6ClBwkWekhy/yj+O+Io=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id A9CCE125FCF; Mon, 30 Nov 2026 11:27:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id fLvZOVEtc4hs;
	Mon, 30 Nov 2026 11:26:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374007-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 43D98125FCB; Mon, 30 Nov 2026 11:26:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id BF6EF244C0; Mon, 30 Nov 2026 08:26:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796027205;
	b=4eQ0CsOeOGxpIdj5upahPWXgztpE5tutMyR7ty9kKqk12X7qCWSLPcTghVpy0eMvI1+o
	 PTz+qYYntgtyzufXergphIJFot5HZyCRxGhOexU4P3731if+W3JNArDBue4EacrLN2H6z
	 Xqmr2023wMU9gVeY4v+aC0p7/i13CoYonQwcg2JxpGMEBirJtTttGZdsdnoo3HAcNcNcu
	 lvttqGa4JYDH6+X85WTTPILhmOGy1g0GCnfb+Dno14XkJiJH+TVyr0svxJlAdM1RWe3TM
	 uQTFeR2/HxNOuGeoBjTT9KCDGzE7C8tWXdGFjwqMY+1uT4lp2wgiWv5qaCrhSDapxxA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796027205;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=MDh1Q5cyXLE1/410czpFSb71Y1aaHCuvP33YxBs59lU=;
	b=b3u4d/8yDiXZLMsuDL/F8/mZKHrtZ7dQ1tzN8VPoMI5Hl5opFGSGNIHYMcJNLcySsPkq
	 +a3TF2GGmr4at8hDYnfKwCqvu1LLm4I4ClvOZYU0zSPrQa2hrZ/t0A+etBkov0/syo3aF
	 4QCqlRj1Y012UFeYBeFKuoMUaEatwfLqt0eHJmELg7dHgxUS1fq3kmORTZ2VdumQWwzEO
	 n8euibao0rL1/Flg5aEbcI72DZxuDAXpx6bKQeZNR+ll6/yKD6S/kqsy9QmXe2ER42jV4
	 2LEJKrdF89wDVJKt3z0kUZKBfRtdPcmHoaIbVTrq4Qolt2kISUCqB1O4ZaEgIvUEVfA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZLHTXZdW;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 905F5606A32D;
	Mon, 30 Nov 2026 08:26:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZLHTXZdW
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796027204;
	b=a2sau6PeXHDOjbeuP6AYe1yhDDHDZTteB7kZSyTqk4Y44YSlDDdOjSwzNg9iyykvhGva
	 2y9fEsUG72t26SkMSsPvstWPH8Z06qtHJe+OAQaoMiANzn4jnY20wCuq6/NAcpCRqcirq
	 RIw4Xp4Nd7tXb+NIDVcRakIW3k0k2xftI4k6FOGmlnPk7L+Vv8bZrZE5fGKBj6klpM02m
	 zjl8i4GPT8292FqTmmoyN4AU9tHYBp0gpzeL0jV2uObd+1gt/obMCRopW7NgjDZVsWIaZ
	 4YExeXiiStEXPzfMj4Fev9If4jCLWEe8juNRM6Eyr3hjdazsLsNI+UafIk13Y9EN2PA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796027204;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Transfer-Encoding;
	bh=MDh1Q5cyXLE1/410czpFSb71Y1aaHCuvP33YxBs59lU=;
	b=FZ2B1FOg0pi9EVz6POkJqVwFgjMP2mqVVWzmIReH7+SE4pbIO9RxHRCScaQsyySDoejC
	 itnRGOR4j9Tb5FefkU0OrFigQbrHc9x0GY2WU3TYXZsdQ/rwxQpLBdRN4Lkd1uLo/0e2c
	 epm0jGJWSs9Z9YEwt+pJP50R4IqqLa+N1ZcJ5OZq6SWJXnBD3Vb1K99+u4V0+nF3OPBDR
	 z4/WfBZEtzP6FSsZnH+6aimbrDMtGtOqhboDrCYRBxIB7UT/epvblmm8MM8n1I5OaNKoI
	 6xFhMebJ1bfXm3br79lBpo6T/DjOkCFTWkdGVzx6aM5emZ2XkeIffFnRKPOI+uF+1bw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZLHTXZdW;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF925606A31C;
	Mon, 30 Nov 2026 08:26:44 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83EFD1F00896;
	Mon, 30 Nov 2026 08:26:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796027203;
	bh=MDh1Q5cyXLE1/410czpFSb71Y1aaHCuvP33YxBs59lU=;
	h=From:To:Cc:Subject:Date;
	b=ZLHTXZdWuhnqThnGm7ghpCrHx8MIuRCH6r3OwaCJXlqnUQxl0LmpUVhQOnR+it8XY
	 j7/e/xuHOFARZmvmjL1cz3o3JVRPy2jzY7ASvo3dpUXKDtBaLFLzWEEmDLLcdUCFjn
	 gT5Tw08l9/NUVAGQwDHBnutYL6oq2XAIiDsOVtIDAxAtdS2EAEk8j7SpvAI/mdmLBi
	 bez6Cxb5/NygGP2BUhYqNxlu0jMUh4yt50Lu+u0o6zoFPxAXAhO7el3MGRe56PvDI7
	 wLaFFNrowGStnPCIFRAZPQz8GYuGwQnkvZ64Kg3NHqFNI6OB0avGkOvME+xhN8OExl
	 LoWPn0GJZepuw==
X-Cc: fuse-devel@lists.linux.dev,
	netdev@vger.kernel.org,
	horms@kernel.org,
	pabeni@redhat.com,
	kuba@kernel.org,
	edumazet@google.com,
	davem@davemloft.net,
	miklos@szeredi.hu,
	vigneshr@ti.com,
	miquel.raynal@bootlin.com,
	david.oberhollenzer@sigma-star.at,
	upstream+linux@sigma-star.at,
	Richard Weinberger <richard@nod.at>
X-Mailer: git-send-email 2.55.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list