mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <zwisler@kernel.org>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Josh Poulson <jopoulso@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michael Kelley <mikelley@microsoft.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>
Subject: RE: [PATCH v2] nfit: add Hyper-V NVDIMM DSM command set to white list
Date: Sat, 2 Feb 2019 00:34:14 +0000	[thread overview]
Message-ID: <PU1P153MB0169D8F7C6E29C22FE122F3FBF930@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAPcyv4gdWJ8qtiASU9ggz56Mkrm9OXfsO74RM9OOrXFmBw_A9Q@mail.gmail.com>

> From: Dan Williams <dan.j.williams@intel.com>
> Sent: Friday, February 1, 2019 3:47 PM
> To: Dexuan Cui <decui@microsoft.com>
> 
> I believe it's the same reason. Without 11189c1089da the _LSR method
> will fail, and otherwise it works and finds the label that it doesn't
> like.
Exactly.
 
> I'm not seeing "invalid" data in your failure log. Could you double
> check that it's just not the success of _LSR that causes the issue?

acpi_label_read() never fails for me.

By "invalid", I only mean the messages in the dmesg.bad.txt I previously
attached (I'm just reading the specs to learn the details about NVDIMM
namespace's labels, so my description might be inaccurate) :

[    4.832367] nvdimm nmem1: nsindex0 labelsize 1 invalid
[    4.832369] nvdimm nmem1: nsindex1 labelsize 1 invalid
...
[    5.259017] nd_pmem namespace0.0: 0x0000000000000000, too small must be at least 0x1000

> > > The regression you are seeing is the fact that the patch enables the kernel
> to
> > > enable nvdimm-namespace-label reads.
> > Yes.
> >
> > > Those reads find a namespace index block
> > > and a label. Unfortunately the label has the LOCAL flag set and Linux
> > > explicitly ignores pmem namespace labels with that bit set. The reason
> > Can you please point out the function that ignores the flag?
> >
> > I checked where NSLABEL_FLAG_LOCAL is used, but it looks I can't find a
> > related function.
> 
> scan_labels() is where the namespace label is validated relative to
> the region type:
> 
>                 if (is_nd_blk(&nd_region->dev)
>                                 == !!(flags & NSLABEL_FLAG_LOCAL))
>                         /* pass, region matches label type */;
>                 else
>                         continue;
> 
> It also has meaning for the namespace capacity allocation
> implementation that needed that flag to distinguish aliased capacity
> between Block Aperture Mode and PMEM Mode access.
Thanks for the pointer! I'm looking at this function.

> > > for that is due to the fact that the original definition of the LOCAL
> > > bit from v1.1 of the namespace label implementation [1] explicitly
> > > limited the LOCAL flag to "block aperture" regions. If you clear that
> > > LOCAL flag I expect it will work. To my knowledge Windows pretends
> > > that the v1.1 definition never existed.
> > I'm trying to find out where the flag is used and how to clear it.
> 
> Assuming Hyper-V implements _LSW, you can recreate / reinitialize the
> label area:

I think Hyper-V only implements _LSR:
[    4.720623] nfit ACPI0012:00: device:00: has _LSR
[    4.723683] nfit ACPI0012:00: device:01: has _LSR
 
> > > The UEFI 2.7 specification for v1.2 labels states that setting the
> > > LOCAL flag is optional when "nlabel", number of labels in the set, is
> > > 1. Linux makes that mandatory as LOCAL is redundant when nlabel is 1.
> > >
> > > That said, the Robustness Principle makes a case that Linux should
> > > tolerate the bit being set. However, it's just a non-trivial amount of
> > > work to unwind the ingrained block-aperture assumptions of that bit.
> > Can you please explain this a bit more? Sorry, I'm new to this area...
> 
> The short story is that Linux enforces that LOCAL == Block Mode
> Namespaces. See section 2.2 Namespace Label Layout in the original
> spec [1]. The EFI 2.7 definition tried to allow for LOCAL to be set
> when an interleave-set was comprised of a single NVDIMM, but then also
> states its optional when Nlabel is 1. It has zero functional use for
> interleave-set based namespaces even when the interleave-set-width is
> 1. So Linux takes the option to never set it, and goes further to
> reject it if it's set and the region-type does not match, because that
> follows the v1.1 meaning of the flag.
> 
> [1]:
Thanks for the link! I'll read it.
BTW, it looks Hyper-V only supports PMEM namespace, at least so far.

Thanks,
-- Dexuan

  reply	other threads:[~2019-02-02  0:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  0:56 Dexuan Cui
2019-01-30  6:23 ` Dan Williams
2019-02-01 17:14   ` Dexuan Cui
2019-02-01 17:29     ` Dan Williams
2019-02-01 23:17       ` Dexuan Cui
2019-02-01 23:47         ` Dan Williams
2019-02-02  0:34           ` Dexuan Cui [this message]
2019-02-02  0:47             ` Dan Williams
2019-02-02  1:06             ` Dexuan Cui
2019-02-02  1:28               ` Dan Williams
2019-02-02  2:17                 ` Dexuan Cui
2019-02-02  5:27                   ` Dan Williams
2019-02-02  3:32                 ` Dexuan Cui
2019-02-02  5:26                   ` Dan Williams
2019-02-03  1:13     ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dan Williams
2019-02-03 14:31       ` kbuild test robot
2019-02-03 17:39         ` Dexuan Cui
2019-02-03 14:38       ` kbuild test robot
2019-02-03 17:40         ` Dexuan Cui
2019-02-03 17:21       ` Dexuan Cui
2019-02-03 17:49         ` Dan Williams
2019-02-03 18:13           ` Dexuan Cui
2019-02-03 19:13             ` Dan Williams
2019-02-03 19:28               ` [PATCH] acpi/nfit: Require opt-in for read-only label configurations Dan Williams
2019-02-04  5:45                 ` Dexuan Cui
2019-02-05 16:53               ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dexuan Cui
2019-02-05 17:11                 ` Dan Williams
2019-02-06  0:57                   ` Dexuan Cui
2019-02-13  4:14       ` [PATCH v2] " Dan Williams
2019-02-13  9:41         ` Johannes Thumshirn

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=PU1P153MB0169D8F7C6E29C22FE122F3FBF930@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM \
    --to=decui@microsoft.com \
    --cc=Alexander.Levin@microsoft.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=jopoulso@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mikelley@microsoft.com \
    --cc=rjw@rjwysocki.net \
    --cc=sthemmin@microsoft.com \
    --cc=vishal.l.verma@intel.com \
    --cc=zwisler@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®