Re: [PATCH v2 7/8] KVM: SVM: move MSR_IA32_SPEC_CTRL save/restore to assembly
From: Paolo Bonzini
Date: Wed Nov 09 2022 - 04:31:14 EST
On 11/9/22 02:14, Sean Christopherson wrote:
+.macro RESTORE_SPEC_CTRL_BODY
Can we split these into separate macros? It's a bit more typing, but it's not
immediately obvious that these are two independent chunks (I was expecting a JMP
from the 800 section into the 900 section).
E.g. RESTORE_GUEST_SPEC_CTRL_BODY and RESTORE_HOST_SPEC_CTRL_BODY
Sure, I had it like that in an earlier version. I didn't see much
benefit but it is indeed a bit more readable if you order the macros like
.macro RESTORE_GUEST_SPEC_CTRL
.macro RESTORE_GUEST_SPEC_CTRL_BODY
.macro RESTORE_HOST_SPEC_CTRL
.macro RESTORE_HOST_SPEC_CTRL_BODY
+800:
Ugh, the multiple users makes it somewhat ugly, but rather than arbitrary numbers,
what about using named labels to make it easier to understand the branches?
I think it's okay if we separate the macros.
Paolo