STRUCT GENWQE_SGL(9)
πΈ NAME πΈ
struct genwqe_sgl β the scatter gather list that describes user-space memory, bestie π
Like, it's the little struct that keeps track of a chunk of memory that lives in user space, and says "okay here's where it is, here's how big it is, and here's whether we're writing it back." Very organized. Very demure.
β¨ SYNOPSIS β¨
struct genwqe_sgl {
dma_addr_t sgl_dma_addr;
struct sg_entry *sgl;
size_t sgl_size;
void __user *user_addr;
size_t user_size;
int write;
unsigned long nr_pages;
unsigned long fpage_offs;
size_t fpage_size;
size_t lpage_size;
void *fpage;
dma_addr_t fpage_dma_addr;
void *lpage;
dma_addr_t lpage_dma_addr;
};
That's the whole glow-up right there π β fourteen fields, zero notes in the original about what half of them do, which honestly is giving "the docs ran out of steam at field six" energy π (more on that below).
π Members π
sgl_dma_addrβ the DMA address of the sgl. That's the address the hardware side sees, not the cute little pointer your CPU uses π«Άsglβ the scatter gather list itself. Heads up: it needs to be 128 byte aligned. Not a suggestion, not a vibe, an actual alignment requirement β so don't come at it with a random pointer πsgl_sizeβ the size of the area used for the sgl.user_addrβ the user-space address of the memory area. This is the pointer that lives in the user's world, markedvoid __user *so nobody forgets πuser_sizeβ how big that user-space memory area is.writeβ should we write it back to userspace? It's anint, so it's basically a yes/no situation dressed up as a number.write= yes bestie, put it back. ποΈnr_pagesβ number of pages. Present in the struct, and the original manual doesn't say anything more about it. That's it. That's the whole lore. πfpage_offsβ first-page offset. Same deal: it's in the struct, no further description in the manual. π€·ββοΈfpage_sizeβ first-page size. In the struct, no extra notes in the original.lpage_sizeβ last-page size. Also in the struct, also undescribed. The manual really said "you'll figure it out" for this whole tail end of the struct πfpageβ first page pointer. Yep, in the struct, no description in the original.fpage_dma_addrβ DMA address of that first page. Again, listed, no description given.lpageβ last page pointer. Listed, no description given.lpage_dma_addrβ DMA address of the last page. Listed, no description given.
Ngl the original page only spells outsgl_dma_addr,sgl,sgl_size,user_addr,user_sizeandwriteβ the rest are just... there, doing their thing, unbothered, moisturised, in their lane π I'm not out here inventing behavior for them, so no cap: what you see is what the manpage gives you.
π¦ SEE ALSO π¦
Go read these next, they're all in the kernel file ./drivers/misc/genwqe/card_base.h and they're lowkey essential for the full picture:
struct genwqe_reg(9)struct dma_mapping(9)struct ddcb_queue(9)struct genwqe_dev(9)enum genwqe_requ_state(9)struct ddcb_requ(9)struct genwqe_file(9)genwqe_get_slu_id(9)genwqe_write_vreg(9)genwqe_read_vreg(9)__genwqe_execute_ddcb(9)__genwqe_execute_raw_ddcb(9)genwqe_is_privileged(9)
That's the whole page, bestie β¨ It came from ./drivers/misc/genwqe, dated October 2026, and it's filed under struct genwqe_sgl(9) β go forth and align your scatter gather lists to 128 bytes, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms