All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>
To: Yi Sun <yi.y.sun@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"chao.p.peng@intel.com" <chao.p.peng@intel.com>,
	"chao.gao@intel.com" <chao.gao@intel.com>,
	"isaku.yamahata@intel.com" <isaku.yamahata@intel.com>,
	Tianyu Lan <Tianyu.Lan@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: RE: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
Date: Fri, 21 Sep 2018 17:02:54 +0000	[thread overview]
Message-ID: <CY4PR21MB0773F63A6367C5C1CE26F5ADDC120@CY4PR21MB0773.namprd21.prod.outlook.com> (raw)
In-Reply-To: <1537514712-62434-3-git-send-email-yi.y.sun@linux.intel.com>

From: Yi Sun <yi.y.sun@linux.intel.com> Sent: Friday, September 21, 2018 12:25 AM
> +
> +#define pr_fmt(fmt) "hv: " fmt

Other Hyper-V messages use "Hyper-V: " as the prefix, not "hv: ".  Take
a quick look at 'dmesg' output for reference.

> +
> +#include <linux/kernel_stat.h>
> +#include <linux/spinlock.h>
> +#include <linux/debugfs.h>
> +#include <linux/log2.h>
> +#include <linux/gfp.h>

Some of these #includes look like they might be leftovers from
some other code.  Please check and see whether kernel_stat.h,
debugsfs.h, log2.h, and gfp.h are actually needed.

> +static void hv_qlock_wait(u8 *byte, u8 val)
> +{
> +	unsigned long msr_val;
> +
> +	if (READ_ONCE(*byte) != val)
> +		return;
> +
> +	/*
> +	 * Read HV_X64_MSR_GUEST_IDLE MSR can trigger the guest's
> +	 * transition to the idle power state which can be exited
> +	 * by an IPI even if IF flag is disabled.
> +	 */
> +	if (ms_hyperv.features & HV_X64_MSR_GUEST_IDLE_AVAILABLE)

I can't see a case where this test is actually needed.  hv_qlock_wait()
can only get called if the flag is set when hv_init_spinlocks() is run, and
the flag value doesn't change after it is set.

> +		rdmsrl(HV_X64_MSR_GUEST_IDLE, msr_val);
> +}

Michael

  reply	other threads:[~2018-09-21 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21  7:25 [PATCH v2 0/2] Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21  7:25 ` [PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support Yi Sun
2018-09-21 16:52   ` Michael Kelley (EOSG)
2018-09-21  7:25 ` [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21 17:02   ` Michael Kelley (EOSG) [this message]
2018-09-25  7:11     ` Yi Sun
2018-09-21 19:09   ` kbuild test robot
2018-09-26  2:15   ` kbuild test robot
2018-09-26  8:23   ` Thomas Gleixner

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=CY4PR21MB0773F63A6367C5C1CE26F5ADDC120@CY4PR21MB0773.namprd21.prod.outlook.com \
    --to=michael.h.kelley@microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=chao.gao@intel.com \
    --cc=chao.p.peng@intel.com \
    --cc=haiyangz@microsoft.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yi.y.sun@linux.intel.com \
    /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.