Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-20 Thread Thomas Gleixner
On Tue, 20 Aug 2019, Thomas Hellström (VMware) wrote: > On 8/20/19 3:42 PM, Thomas Gleixner wrote: > > > 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)",

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-20 Thread VMware
On 8/20/19 3:42 PM, Thomas Gleixner wrote: On Tue, 20 Aug 2019, Thomas Hellström (VMware) wrote: 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", \ +

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-20 Thread Thomas Gleixner
On Tue, 20 Aug 2019, Thomas Hellström (VMware) wrote: > 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,

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-20 Thread VMware
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

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-20 Thread Peter Zijlstra
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

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-19 Thread VMware
On 8/19/19 8:25 AM, Borislav Petkov wrote: On Mon, Aug 19, 2019 at 12:28:05AM +0200, Thomas Hellström (VMware) wrote: Unfortunately we can't use it, because it's unconditionally set on AMD even if the VMware hypervisor doesn't support it (by version or by configuration). AMD sets it because

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-19 Thread Borislav Petkov
On Mon, Aug 19, 2019 at 12:28:05AM +0200, Thomas Hellström (VMware) wrote: > Unfortunately we can't use it, because it's unconditionally set on AMD even > if the VMware hypervisor > doesn't support it (by version or by configuration). AMD sets it because they don't support VMCALL. Nothing stops

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-18 Thread VMware
On 8/18/19 10:19 PM, Borislav Petkov wrote: On Sun, Aug 18, 2019 at 04:33:14PM +0200, Thomas Hellström (VMware) wrote: From: Thomas Hellstrom This is intended to be used by drivers using the backdoor, and we follow the kvm example using alternatives self-patching to choose between vmcall,

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-18 Thread Borislav Petkov
On Sun, Aug 18, 2019 at 10:19:42PM +0200, Borislav Petkov wrote: > #define X86_FEATURE_VMW_VMCALL( 8*32+18) /* "" VMware prefers > VMCALL hypercall instruction */ And you can call that one something generic too: X86_FEATURE_VMCALL. -- Regards/Gruss, Boris. Good mailing

Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-18 Thread Borislav Petkov
On Sun, Aug 18, 2019 at 04:33:14PM +0200, Thomas Hellström (VMware) wrote: > From: Thomas Hellstrom > > This is intended to be used by drivers using the backdoor, and > we follow the kvm example using alternatives self-patching to > choose between vmcall, vmmcall and inl instructions. > > This

[PATCH 2/4] x86/vmware: Add a header file for hypercall definitions

2019-08-18 Thread VMware
From: Thomas Hellstrom This is intended to be used by drivers using the backdoor, and we follow the kvm example using alternatives self-patching to choose between vmcall, vmmcall and inl instructions. This patch defines two new x86 cpu feature flags. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: