STRUCT GENWQE_MEM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so this is struct genwqe_mem(9) from the Kernel API Manual, and it is literally all about Memory pinning/unpinning information β€” the vibe is β€œlet’s keep memory pinned and not be chaotic about it” ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct genwqe_mem {
    __u64 addr;
    __u64 size;
    __u64 direction;
    __u64 flags;
};

not me presenting the whole struct like a little menu πŸ’… every field is __u64, no cap.


πŸŽ€ Members πŸŽ€

  • addr β€” virtual user space address. yes bestie, the address in user space, virtual-style 🌸
  • size β€” size of the area pin/dma-map/unmap. that’s the size of the area for pin/dma-map/unmap, periodt.
  • direction β€” 0: read/1: read and write. lowkey important: 0 means read, 1 means read and write πŸ”₯
  • flags β€” this member is in the struct, but the original page doesn’t give it a description. it’s just there, main character energy, no explanation attached πŸ’€

🌈 DESCRIPTION 🌈

okay so the whole point: Avoid pinning and unpinning of memory pages dynamically. Instead the idea is to pin the whole buffer space required for DDCB opertionas in advance. (yes, opertionas β€” I’m not fixing the source’s spelling, bestie 😭) The driver will reuse this pinning and the memory associated with it to setup the sglists for the DDCB requests without the need to allocate and free memory or map and unmap to get the DMA addresses.

The inverse operation needs to be called after the pinning is not needed anymore. The pinnings else the pinnings will get removed after the device is closed. Note that pinnings will required memory. (the source’s grammar is doing its own thing, but the point is: pinnings need memory 🫢)


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./include/uapi/linux/genwqe/genwqe_card.h
  • struct genwqe_ddcb_cmd(9)

mwah πŸ’‹ this lil page is from the ./include/uapi/linux/genwqe source/version, dated October 2026, and it’s all about struct genwqe_mem(9) β€” slay and goodbye πŸŽ€

πŸ“¦ where this page comes from