Skip to contentSkip to conversation

drivers/block/ramshared: add hardware-accelerated VRAM block driver

RFC PATCH Superseded emersonbusson 1 participant 2 messages Aug 29 1 message not in the archive Block layer

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20260828223000.ramshared-v1-cover

#1 lore raw

RFC PATCH 1/2 drivers/block/ramshared: add hardware-accelerated VRAM block driver

Add the RamShared driver core in drivers/block/ramshared/ supporting direct PCIe DMA aperture mapping, blk-mq request dispatch, and synchronous .rw_page swap fast-path.

---
 drivers/block/ramshared/Kconfig    |  15 +++
 drivers/block/ramshared/Makefile   |  18 +++
 drivers/block/ramshared/compat.h   | 105 ++++++++++++++++
 drivers/block/ramshared/dma.c      |  56 +++++++++
 drivers/block/ramshared/main.c     | 166 +++++++++++++++++++++++++
 drivers/block/ramshared/queue.c    | 253 +++++++++++++++++++++++++++++++++++++
 drivers/block/ramshared/ramshared.h|  62 +++++++++
 7 files changed, 675 insertions(+)
drivers/block/ramshared/Kconfig new file +15 -0
new file mode 100644
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# RamShared block driver configuration
+#
+
+config BLK_DEV_RAMSHARED
+	tristate "RamShared Hardware-Accelerated VRAM Block Device"
+	depends on BLOCK && PCI && MMU
+	select BLK_MQ_PCI
+	help
+	  This driver provides a high-performance block device backed by
+	  discrete GPU video memory (VRAM) via direct PCIe DMA transfers.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called ramshared.
drivers/block/ramshared/Makefile new file +18 -0
new file mode 100644
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Makefile for the RamShared in-tree kernel driver.
+#
+
+obj-$(CONFIG_BLK_DEV_RAMSHARED) += ramshared.o
+
+ramshared-y := main.o dma.o queue.o
+
+# Standalone build support
+KDIR ?= /lib/modules/$(shell uname -r)/build
+PWD := $(shell pwd)
+
+default:
+	$(MAKE) -C $(KDIR) M=$(PWD) CONFIG_BLK_DEV_RAMSHARED=m modules
+
+clean:
+	$(MAKE) -C $(KDIR) M=$(PWD) clean
drivers/block/ramshared/compat.h new file +105 -0

105 lines not on this page · raw message

drivers/block/ramshared/dma.c new file +56 -0

56 lines not on this page · raw message

drivers/block/ramshared/main.c new file +166 -0

166 lines not on this page · raw message

drivers/block/ramshared/queue.c new file +253 -0

253 lines not on this page · raw message

drivers/block/ramshared/ramshared.h new file +62 -0

62 lines not on this page · raw message

#2 lore raw

RFC PATCH 2/2 drivers/block: integrate ramshared driver into build system

In reply to a message not in the archive

Connect drivers/block/ramshared to drivers/block/Kconfig and drivers/block/Makefile under the CONFIG_BLK_DEV_RAMSHARED symbol.

---
 drivers/block/Kconfig  | 2 ++
 drivers/block/Makefile | 1 +
 2 files changed, 3 insertions(+)
drivers/block/Kconfig +2 -0
index 8e49b12..d3a5e81 100644
@@ -375,3 +375,5 @@ config BLK_DEV_ZONED_LOOP
 	  If unsure, say N.
 
+source "drivers/block/ramshared/Kconfig"
+
 endif # BLK_DEV
drivers/block/Makefile +1 -0
index 28cb489..f895c11 100644
@@ -41,3 +41,4 @@ obj- += zloop.o
 
+obj-	+= ramshared/
 
 swim_mod-y	:= swim.o swim_asm.o