All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>, <x86@kernel.org>
Subject: Re: [PATCH 1/3] KVM: VMX: Macrofy GPR swapping in __vmx_vcpu_run()
Date: Thu, 14 May 2026 19:04:20 -0700	[thread overview]
Message-ID: <cef865a9-9a15-4ab4-b137-085ab3bfb7d3@intel.com> (raw)
In-Reply-To: <agYi2Lc7UbGiw_zL@google.com>

On 5/14/2026 12:30 PM, Sean Christopherson wrote:
> 
> This is not simpler.  Maybe it ends up being less verbose, but I don't see how
> anyone can claim this is simpler.  E.g. for people like me that aren't already
> familiar with the .ifc directive, the R32_NUM macro is inscrutable.  I can at
> least suss out what e.g. LOAD_REGS and friends are doing, but claiming the code
> is "simpler" is rather ridiculous.


Intended to abstract away the repetitive sequences. But I can read your 
reaction. The compressing macro hurts readability, especially with the 
nested macros and directives.

> For me, this needs to be the focal point of the changelog, and it needs to be
> written with --verbose, because the impact of APX on the VM-Entry/VM-Exit code
> isn't so obvious that a one-line "this makes future life easier" sufficiently
> justifies the macro magic.  And that's coming from someone that generally loves
> macro magic :-)

How about this?

   Convert the repeated register save/restore sequences into macros in
   preparation for  extended GPR support.

   While the resulting macros are more compact, they do not necessarily
   improve readability in fact. They rely nested macros and assembly
   directives, which may not immediately obvious at first glance.

   But upcoming support for additional GPRs (R16-R31) needs to extend the
   VM entry/exit paths. Continuing to grow the existing open-coded
   sequences line-by-line would be increasingly inefficient and tedious.
   Those macros provide a more scalable approach, despite readability
   tradeoff.

Thanks,
Chang

  reply	other threads:[~2026-05-15  2:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 17:49 [PATCH 0/3] KVM: Macrofy GPR swapping in assembly code Paolo Bonzini
2026-05-13 17:49 ` [PATCH 1/3] KVM: VMX: Macrofy GPR swapping in __vmx_vcpu_run() Paolo Bonzini
2026-05-14 19:30   ` Sean Christopherson
2026-05-15  2:04     ` Chang S. Bae [this message]
2026-05-15 17:06     ` Paolo Bonzini
2026-05-13 17:49 ` [PATCH 2/3] KVM: SVM: Macrofy GPR swapping in __svm_vcpu_run() Paolo Bonzini
2026-05-13 17:49 ` [PATCH 3/3] KVM: SEV: Macrofy GPR swapping in __svm_sev_es_vcpu_run() Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cef865a9-9a15-4ab4-b137-085ab3bfb7d3@intel.com \
    --to=chang.seok.bae@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.