[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR21MB0773F63A6367C5C1CE26F5ADDC120@CY4PR21MB0773.namprd21.prod.outlook.com>
Date: Fri, 21 Sep 2018 17:02:54 +0000
From: "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>
To: Yi Sun <yi.y.sun@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "x86@...nel.org" <x86@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"chao.p.peng@...el.com" <chao.p.peng@...el.com>,
"chao.gao@...el.com" <chao.gao@...el.com>,
"isaku.yamahata@...el.com" <isaku.yamahata@...el.com>,
Tianyu Lan <Tianyu.Lan@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>
Subject: RE: [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for
Hyper-V
From: Yi Sun <yi.y.sun@...ux.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
Powered by blists - more mailing lists