lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190818201942.GC29353@zn.tnic>
Date:   Sun, 18 Aug 2019 22:19:42 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Thomas Hellström (VMware) 
        <thomas_os@...pmail.org>
Cc:     linux-kernel@...r.kernel.org, pv-drivers@...are.com,
        Thomas Hellstrom <thellstrom@...are.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Doug Covelli <dcovelli@...are.com>
Subject: Re: [PATCH 2/4] x86/vmware: Add a header file for hypercall
 definitions

On Sun, Aug 18, 2019 at 04:33:14PM +0200, Thomas Hellström (VMware) wrote:
> From: Thomas Hellstrom <thellstrom@...are.com>
> 
> 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.

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

Also, s/cpu/CPU/g in the text.

> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: <x86@...nel.org>
> Signed-off-by: Thomas Hellstrom <thellstrom@...are.com>
> Reviewed-by: Doug Covelli <dcovelli@...are.com>
> ---
>  MAINTAINERS                        |  1 +
>  arch/x86/include/asm/cpufeatures.h |  2 ++
>  arch/x86/include/asm/vmware.h      | 13 +++++++++++++
>  3 files changed, 16 insertions(+)
>  create mode 100644 arch/x86/include/asm/vmware.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1bd7b9c2d146..412206747270 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -17203,6 +17203,7 @@ M:	"VMware, Inc." <pv-drivers@...are.com>
>  L:	virtualization@...ts.linux-foundation.org
>  S:	Supported
>  F:	arch/x86/kernel/cpu/vmware.c
> +F:	arch/x86/include/asm/vmware.h
>  
>  VMWARE PVRDMA DRIVER
>  M:	Adit Ranadive <aditr@...are.com>
> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
> index 998c2cc08363..69cecc3bc9cb 100644
> --- a/arch/x86/include/asm/cpufeatures.h
> +++ b/arch/x86/include/asm/cpufeatures.h
> @@ -232,6 +232,8 @@
>  #define X86_FEATURE_VMMCALL		( 8*32+15) /* Prefer VMMCALL to VMCALL */
>  #define X86_FEATURE_XENPV		( 8*32+16) /* "" Xen paravirtual guest */
>  #define X86_FEATURE_EPT_AD		( 8*32+17) /* Intel Extended Page Table access-dirty bit */
> +#define X86_FEATURE_VMW_VMCALL		( 8*32+18) /* VMware prefers VMCALL hypercall instruction */
> +#define X86_FEATURE_VMW_VMMCALL		( 8*32+19) /* VMware prefers VMMCALL hypercall instruction */

Those are not set anywhere in the patchset. Please send them with their
user.

Then, there already is X86_FEATURE_VMMCALL which you can use too, I'd
guess.

Which would turn the macro into

	ALTERNATIVE_2(".byte 0xed", \
		      ".byte 0x0f, 0x01, 0xc1", X86_FEATURE_VMW_VMCALL,	\
		      ".byte 0x0f, 0x01, 0xd9", X86_FEATURE_VMMCALL)

and then you end up adding a single new feature bit X86_FEATURE_VMW_VMCALL.

Also, I don't see a reason to show the synthetic bit in /proc/cpuinfo
so when you define it, add "":

#define X86_FEATURE_VMW_VMCALL		( 8*32+18) /* "" VMware prefers VMCALL hypercall instruction */
						      ^
						      |
						      |
						      this here.

Thx.

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ