mirror of https://lore.kernel.org/lkml/
 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,
	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.freedekstop.org,
	Doug Covelli <dcovelli@vmware.com>
Subject: Re: [PATCH v2 1/4] x86/vmware: Update platform detection code for VMCALL/VMMCALL hypercalls
Date: Wed, 28 Aug 2019 09:45:19 +0200	[thread overview]
Message-ID: <471e1f6b-56eb-281e-155d-3149f6915f81@shipmail.org> (raw)
In-Reply-To: <20190827125636.GE29752@zn.tnic>

On 8/27/19 2:56 PM, Borislav Petkov wrote:
>
> Also, you could restructure that function something like this to save yourself
> an indentation level or two and make it more easily readable:
>
> static uint32_t __init vmware_platform(void)
> {
>          unsigned int hyper_vendor_id[3];
>          unsigned int eax;
>
>          if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
>                  if (dmi_available && dmi_name_in_serial("VMware") && __vmware_platform())
>                          return 1;


Hmm, we're missing a return 0; here. The number of return points and the 
moved up variable declarations worries me a little. I'll see if I can 
clean this up a bit, but would prefer to make a follow-up patch in that 
case.

/Thomas


>          }
>
>          cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &hyper_vendor_id[0],
>                &hyper_vendor_id[1], &hyper_vendor_id[2]);
>
>          if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) {
>                  if (eax >= CPUID_VMWARE_FEATURES_LEAF)
>                          vmware_hypercall_mode = vmware_select_hypercall();
>
>                  pr_info("hypercall mode: 0x%02x\n", (unsigned int) vmware_hypercall_mode);
>
>                  return CPUID_VMWARE_INFO_LEAF;
>          }
>          return 0;
> }
>


  parent reply	other threads:[~2019-08-28  7:45 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) [this message]
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
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=471e1f6b-56eb-281e-155d-3149f6915f81@shipmail.org \
    --to=thomas_os@shipmail.org \
    --cc=bp@alien8.de \
    --cc=dcovelli@vmware.com \
    --cc=dri-devel@lists.freedekstop.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=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

all inboxes | Powered by JetHome®