Re: [PATCH v9 00/22] Enable FRED with KVM VMX

From: David Woodhouse

Date: Thu May 07 2026 - 10:08:25 EST


On Thu, 2026-05-07 at 15:53 +0200, Maciej Wieczor-Retman wrote:
>
> My theory is that after 'int3' call the FRED event is handled elsewhere and %rdi
> is not preserved. So the original version of the assembly looks okay but I was
> thinking that int3 has side effects.
>
> Below is the test output of the RIPs not matching when running the original,
> does that help in any way?

Ah right, of course!

+"fred_entrypoint_kernel:\n"
+ "movq %rsp, %rdi\n"
+ "call fred_handler\n"
+ ".byte 0xf2, 0x0f, 0x01, 0xca\n" /* ERETS */
+ ".popsection\n"

That needs to save the %rdi it's scribbling on, plus all the callee-
clobbered registers that fred_handler() might use.

Attachment: smime.p7s
Description: S/MIME cryptographic signature