All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, pv-drivers@vmware.com,
	Thomas Hellstrom <thellstrom@vmware.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Doug Covelli <dcovelli@vmware.com>
Subject: Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions
Date: Mon, 19 Aug 2019 09:49:11 +0200	[thread overview]
Message-ID: <970d2bb6-ab29-315f-f5d8-5d11095859af@shipmail.org> (raw)
In-Reply-To: <20190819062552.GC4841@zn.tnic>

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 they don't support VMCALL. Nothing stops us from
> making that conditional depending on what the hypervisor can/supports.
> I'm thinking it would be even cleaner if we use those two flags:
>
> X86_FEATURE_VMMCALL
> X86_FEATURE_VMCALL
>
> to denote hw support for either one or the other instruction and switch
> accordingly. Just like KVM does.
>
> In your case, the HV would set the preferred flag in
> arch/x86/kernel/cpu/vmware.c - just like the others do in their
> respective CPU init files - and the alternatives code would switch to it
> when it runs.
>
> Or is there more? :)

Yes, unfortunately. I agree this is is the cleanest solution and my 
first choice. It would work for VMware, but AFAICT it might break setups 
of other hypervisors running at least the vmmouse driver. Quick googling 
tells me there are likely QEMU/KVM setups that do this. My thinking is 
they would have to set X86_FEATURE_VMMCALL on AMD to get the 
kvm_hypercall right, but that would mean the vmmouse hypercall also uses 
vmmcall, which they probably haven't implemented (yet). So the safe way 
would be to use at least XF86_FEATURE_VMW_VMMCALL + XF86_FEATURE_VMCALL 
until that has happened.

/Thomas


>
> Thx.
>


  reply	other threads:[~2019-08-19  7:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18 14:33 [PATCH 0/4] Add support for updated vmware hypercall instruction Thomas Hellström (VMware)
2019-08-18 14:33 ` [PATCH 1/4] x86/vmware: Update platform detection code for VMCALL/VMMCALL hypercalls Thomas Hellström (VMware)
2019-08-18 19:20   ` Thomas Gleixner
2019-08-18 19:46     ` Thomas Hellström (VMware)
2019-08-20 17:18     ` [Pv-drivers] " Darren Hart
2019-08-18 14:33 ` [PATCH 2/4] x86/vmware: Add a header file for hypercall definitions Thomas Hellström (VMware)
2019-08-18 20:19   ` Borislav Petkov
2019-08-18 20:39     ` Borislav Petkov
2019-08-18 22:28     ` Thomas Hellström (VMware)
2019-08-19  6:25       ` Borislav Petkov
2019-08-19  7:49         ` Thomas Hellström (VMware) [this message]
2019-08-20 11:32   ` Peter Zijlstra
2019-08-20 13:34     ` Thomas Hellström (VMware)
2019-08-20 13:42       ` Thomas Gleixner
2019-08-20 19:19         ` Thomas Hellström (VMware)
2019-08-20 19:23           ` Thomas Gleixner
2019-08-18 14:33 ` [PATCH 3/4] drm/vmwgfx: Update the backdoor call with support for new instructions Thomas Hellström (VMware)
2019-08-18 14:33 ` [PATCH 4/4] input/vmmouse: " Thomas Hellström (VMware)
2019-08-21  5:09   ` Dmitry Torokhov
2019-08-21 15:48     ` Thomas Hellström (VMware)
2019-08-21 16:03       ` Dmitry Torokhov
2019-08-18 18:09 ` [PATCH 0/4] Add support for updated vmware hypercall instruction Borislav Petkov
2019-08-18 19:02   ` Thomas Hellström (VMware)
2019-08-18 19:37     ` Borislav Petkov

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=970d2bb6-ab29-315f-f5d8-5d11095859af@shipmail.org \
    --to=thomas_os@shipmail.org \
    --cc=bp@alien8.de \
    --cc=dcovelli@vmware.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pv-drivers@vmware.com \
    --cc=tglx@linutronix.de \
    --cc=thellstrom@vmware.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.