Re: [PATCH v4] KVM: VMX: Improve handle_external_interrupt_irqoff inline assembly

Uros Bizjak
2020-05-04T15:32:33Z

On Mon, May 4, 2020 at 5:25 PM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> On Mon, May 04, 2020 at 01:05:45AM +0200, Uros Bizjak wrote:
> > Improve handle_external_interrupt_irqoff inline assembly in several ways:
> > - use "re" operand constraint instead of "i" and remove
> > unneeded %c operand modifiers and "$" prefixes
> > - use %rsp instead of _ASM_SP, since we are in CONFIG_X86_64 part
> > - use $-16 immediate to align %rsp
> > - remove unneeded use of __ASM_SIZE macro
> > - define "ss" named operand only for X86_64
> >
> > The patch introduces no functional changes.
>
> Hmm, for handcoded assembly I would argue that the switch from "i" to "re"
> is a functional change of sorts. The switch also needs explicit
> justification to explain why it's correct/desirable. Maybe make it a
> separate patch?

I think this would be a good idea. So, in this patch the first point should read

"- remove unneeded %c operand modifiers and "$" prefixes"

The add-on patch will then explain that PUSH can only handle signed
32bit immediates and change "i" to "re".

Is this what you had in mind?

Thanks,
Uros.