lkml.org 
[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions
From
Date
On 8/20/19 1:32 PM, Peter Zijlstra wrote:
> On Sun, Aug 18, 2019 at 04:33:14PM +0200, Thomas Hellström (VMware) wrote:
>
>> +#define VMWARE_HYPERCALL \
>> + ALTERNATIVE_2(".byte 0xed", \
>> + ".byte 0x0f, 0x01, 0xc1", X86_FEATURE_VMW_VMCALL, \
>> + ".byte 0x0f, 0x01, 0xd9", X86_FEATURE_VMW_VMMCALL)
> For sanity, could we either add comments, or macros for those
> instrucions?

Hmm. Here I followed and slightly extended what was done in asm/kvm_para.h.

What confuses me a bit is, if it's clarity we're after, why don't people use

#define VMWARE_HYPERCALL \
ALTERNATIVE_2("inl (%%dx)", \
"vmcall", X86_FEATURE_VMW_VMCALL, \
"vmmcall", X86_FEATURE_VMW_VMMCALL)

Seems to build fine here. Is it fear of old assemblers not supporting, for example vmmcall

Thanks,
/Thomas


> Something like:
>
> #define INSN_INL 0xed
> #define INSN_VMCALL 0x0f,0x01,0xc1
> #define INSN_VMMCALL 0x0f,0x01,0xd9
>
> #define VMWARE_HYPERCALL \
> ALTERNATIVE_2(_ASM_MK_NOP(INSN_INL),
> _ASM_MK_NOP(INSN_VMCALL), X86_FEATURE_VMCALL,
> _ASM_MK_NOP(INSN_VMMCALL), X86_FEATURE_VMMCALL)
>
> With possibly a patch that does 's/_ASM_MK_NOP/_ASM_MK_INSN/' on
> arch/x86/ for further sanity :-)


\
 
 \ /
  Last update: 2019-08-20 15:35    [W:0.183 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site