copy_mc_to_kernel(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 copy_mc_to_kernel(9) 🌸

okay bestie, welcome to the Kernel API Manual, grab a strawberry πŸ“ and let's talk about the memory copy that handles source exceptions β€” yes, that's the whole vibe of this page πŸ’…


✨ NAME ✨

copy_mc_to_kernel β€” a memory copy that handles source exceptions 🫢


πŸ’– SYNOPSIS πŸ’–

unsigned long copy_mc_to_kernel (void *dst, const void *src, unsigned len );

like, that's the whole signature, no cap ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • dst β€” the destination address πŸ’Œ
  • src β€” the source address 🌟
  • len β€” number of bytes to copy, literally the whole count πŸ”’

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this thing calls into the 'fragile' version on systems that benefit from avoiding corner case poison consumption scenarios 😭 for example, accessing poison across 2 cachelines with a single instruction β€” yeah, exactly that kind of cursed energy πŸ’€

Almost all other uses case can use copy_mc_enhanced_fast_string for a fast recoverable copy, or fallback to plain memcpy πŸ‘‘ iykyk.

It returns 0 for success, or the number of bytes not copied if there was an exception πŸ™ˆ so like, always check the return value bestie, fr fr.

🌈 SEE ALSO 🌈

  • Kernel file ./arch/x86/lib/copy_mc.c πŸ“

okay that's the whole page, go forth and copy safely 🧚

this one came to you from ./arch/x86/lib, October 2026, and the page itself is copy_mc_to_kernel(9) β€” mwah, slay, periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from