Re: [RFC PATCH 0/1] KVM: VMX: restore host CR2 after VM exit
From: Konstantin Khorenko
Date: Thu Apr 23 2026 - 04:53:33 EST
On 4/22/26 20:56, Sean Christopherson wrote:
...
Patch properties:
- Hot path impact: one extra register compare in the common case,
one extra MOV to CR2 under unlikely() when the guest modified CR2.
That's not unlikely. The odds of guest CR2 matching host CR2 are basically zero.
In practice, this likely adds two extra CR2 writes on the majority of entry/exit
transitions.
Thank you very much for the review, Sean.
Agreed on the window: the patch only narrows the exposure, it doesn't close it.
I also mis-sold the cost. "One extra MOV to CR2 under unlikely()" is just wrong, how could i think of it, and thus it becomes expensive on a hot path, you are right.
With both points in hand, the patch doesn't carry its weight.
Dropping it.
--
Konstantin