general protection fault is a unique tool used to emulate more virtual address bits than there really are
@mothcompute none of the professors were happy in my computer systems class that taught "a segfault is a hardware exception" when i would bring up that most segfaults are PFs, but most PFs aren't segfaults, and some can be GPF
@pounce it is my policy that segfaults are just kind of like. made up. any program that segfaults could be made to just not do it and run wrong
@mothcompute yeah, it's what rubbed me the wrong way about this course.
segfaults are an abstraction. they just want to push that it's a hardware thing because "C is close to the hardware"
but heck, asm isn't "close to the hardware" there are so many levels of microcode, trap/emulate by the OS & virtualization that what is actually happening to your bits and boops is wildly different

@mothcompute but i think that taking this position leaves out all of the cool possibilities that you can use to trap/emulate the faults

like in your posts: making a #PF always read 0, or #GPF for a non-canonical address reads to disk/s3