public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
Cc: linux-kernel@vger.kernel.org, pv-drivers@vmware.com,
	linux-graphics-maintainer@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, dri-devel@lists.freedesktop.org,
	Doug Covelli <dcovelli@vmware.com>
Subject: Re: [PATCH v2 2/4] x86/vmware: Add a header file for hypercall definitions
Date: Tue, 27 Aug 2019 21:54:56 +0200	[thread overview]
Message-ID: <20190827195456.GK29752@zn.tnic> (raw)
In-Reply-To: <b82e190e-6887-b95a-a99a-176f22c57b7b@shipmail.org>

On Tue, Aug 27, 2019 at 09:19:03PM +0200, Thomas Hellström (VMware) wrote:
> It should be correct. The flags VMWARE_HYPERVISOR_HB and
> VMWARE_HYPERVISOR_OUT are only valid for the vmcall / vmmcall versions.
> 
> For the legacy version, the direction is toggled by the instruction (in vs
> out) and LB vs HB is toggled by the port number (0x5658 vs 0x5659)
> 
> So in essence the low word definition of %edx is different in the two
> versions. I've chosen to use the new vmcall/vmmcall definition in the driver
> code.

Ah, ok, I see what you mean. The old method would overwrite the low word
of %edx but the new one would have the flags already prepared and *not*
overwrite them so all good.

Can you please document that more explicitly in the comment in
arch/x86/include/asm/vmware.h? Something like:

"... The new vmcall interface instead uses a set of flags to select
bandwidth mode and transfer direction. The set of flags is already
loaded into %edx by the macros which use VMWARE_HYPERCALL* and only when
the guest must use the old VMWARE_HYPERVISOR_PORT* method, the low word
is overwritten by the respective port number."

Anyway, something along those lines. We want to have the alternatives
code as clear and as transparent as possible because, well, of obvious
reasons. :-)

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2019-08-27 19:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  8:13 [PATCH v2 0/4] Add support for updated vmware hypercall instruction Thomas Hellström (VMware)
2019-08-23  8:13 ` [PATCH v2 1/4] x86/vmware: Update platform detection code for VMCALL/VMMCALL hypercalls Thomas Hellström (VMware)
2019-08-27 12:56   ` Borislav Petkov
2019-08-27 19:19     ` Thomas Hellström (VMware)
2019-08-27 19:48       ` Borislav Petkov
2019-08-28  7:45     ` Thomas Hellström (VMware)
2019-08-28  8:45       ` Borislav Petkov
2019-08-23  8:13 ` [PATCH v2 2/4] x86/vmware: Add a header file for hypercall definitions Thomas Hellström (VMware)
2019-08-27 13:10   ` Borislav Petkov
2019-08-27 15:44   ` Borislav Petkov
2019-08-27 19:19     ` Thomas Hellström (VMware)
2019-08-27 19:54       ` Borislav Petkov [this message]
2019-08-23  8:13 ` [PATCH v2 3/4] drm/vmwgfx: Update the backdoor call with support for new instructions Thomas Hellström (VMware)
2019-08-26 20:12   ` Dave Airlie
2019-08-23  8:13 ` [PATCH v2 4/4] input/vmmouse: " Thomas Hellström (VMware)
2019-08-27  8:33 ` [PATCH v2 0/4] Add support for updated vmware hypercall instruction Thomas Hellström (VMware)

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=20190827195456.GK29752@zn.tnic \
    --to=bp@alien8.de \
    --cc=dcovelli@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hpa@zytor.com \
    --cc=linux-graphics-maintainer@vmware.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=thomas_os@shipmail.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox