Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1152497ima; Fri, 1 Feb 2019 17:39:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN6UOxLgcqnkWP65ck6rDp9tDJvSQrCoajrfyQtbSvfITSdWMBy5ICVdrU1Cm6WFkBAOfzdk X-Received: by 2002:a17:902:24a2:: with SMTP id w31mr41260741pla.216.1549071543813; Fri, 01 Feb 2019 17:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549071543; cv=none; d=google.com; s=arc-20160816; b=uzSxX50kOx7zkrO/hPT1OutKeDdcmRtjIfcGfn6U1h6N3XW78ugQWtq2qBrOAApRZX 5rvT3vL/Qq30jgOigwaG5pnmNStiBl4VXYA8OeBTsex546j4bovdzkZcNOuh8dOhQC8G Ji+bCuKPD9QP6KDK38ZDHJJrhMPPGr6kDCh/3KkESE9vvwCwZABMhl45Un2gvwlZ7NJd U7MywwDq/vVe5EfpxJv10H/Dtxx9xYyGWMCsz+/97NOBlGWWbm8t9Id54TTJLsDLvyDr OOpexUemVfEXydHrMjo1ga98j/koGRw0cS5yBy6BpKJRVEbZ+UQiBp2UZZLuQqbEcyaQ Xm0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=50BM2EtV/rLAKUMfxaHipv1V7XdaEIH2BD6ExorzKUM=; b=Kv0rWkMefcvh+EGrzsKarctDSQm/v+gwDKrvyMbvYwfewbLse8Ee/9BRAqMiGj0TES KoLW2WfdtRO2JLW+gvKrM4SxFsMyxPjnU1wnL7zND0OMaJ5PLjXxbTp578ctCyqDk42m ++IDCS225CCVWPPAkTNCP2bp2YG7l0h0oaYtFqtUWoWu4YNUmdBUw2GVNlezUrKE19dB mSZCzrmHLT0ws4j5g08S+la1Eg/9ZjhC6HccON7BY494Xfa3eKbpvs9oVrJ4Ra0/S4Ev MlyWJIxnKsa/5jHvQr69mpgQDbfhVaFpKURzyuuMVklvPDNUynqA9PXVcMFvNzn5OC90 +ghg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=n9JWPvAB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si9063654plx.159.2019.02.01.17.38.48; Fri, 01 Feb 2019 17:39:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=n9JWPvAB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbfBBB2x (ORCPT + 99 others); Fri, 1 Feb 2019 20:28:53 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38723 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbfBBB2x (ORCPT ); Fri, 1 Feb 2019 20:28:53 -0500 Received: by mail-ot1-f67.google.com with SMTP id e12so7700414otl.5 for ; Fri, 01 Feb 2019 17:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=50BM2EtV/rLAKUMfxaHipv1V7XdaEIH2BD6ExorzKUM=; b=n9JWPvABcvegUOYCs+pHC0v1uZV/3Fbb8NqkAlBC7f+G7RM94HnTPiFT7zOA7BVwZC Q6CPYJJB6I5DB88N/fhjbuesv1a7Avc9cZQ3Essca2Idg6Qk4uT8+ZElHPXc6IllRn6Q jhjXQM6THXfNDpLz+AqwWebVMnWrydTHFEt4xGHG0a1A27Tx32vACZsONA3flpFPHO8k ZFTErLVDDQFZllFi9YTGnOM6gNkmitg+LaqTjJW1jCIqgasPu4BjUkZwryMMDnFwD2aA J6KHS0tJu1iGYAECULPCpOV5DMEePhnhxrfN5+RynQpruJebSFhxVolUvcgMxpUfIcgo kmlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=50BM2EtV/rLAKUMfxaHipv1V7XdaEIH2BD6ExorzKUM=; b=D4pnmAfBPSVLgyLT4pR4UgvIOI7EVLSnhzFxwDpQpPaDWHNYROur+tEcg+SwrybKjF 2fjMHazETtWP51e4c5SIALh4JsPOVhzOJ0YxQv8JWHT+3Tj7+PW0NxKGocfnU1Homnhf JzZpqA16S7O6DZt95qb6DuTT4k3RbBeBWkiHPXbfzGPFQTYUWZy9DxA+1d9GEqh+G9fc mvV9M/3Pin6LgnxgVcqaDxq3xIV2r8+V/8zbE4JiPX3lAK+xJ8x4td28X8qdRgQqFsWi udabka1zYqAkjTp1YM8CrKVnRvrTZdcczxYGC0QsZN6K1tc2CXDvRjClzraxuQ0YGB3q wYng== X-Gm-Message-State: AJcUukeTP3JVBEcpgqTjur367dEKPX0YQLgGShUtbtwFuzdlFAfTfcuk VeYpvs43xjPVxql+P2097ejp1yYrjot6+AKwqr515w== X-Received: by 2002:a9d:3a0a:: with SMTP id j10mr30127850otc.229.1549070932011; Fri, 01 Feb 2019 17:28:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dan Williams Date: Fri, 1 Feb 2019 17:28:39 -0800 Message-ID: Subject: Re: [PATCH v2] nfit: add Hyper-V NVDIMM DSM command set to white list To: Dexuan Cui Cc: Josh Poulson , "linux-nvdimm@lists.01.org" , Haiyang Zhang , "driverdev-devel@linuxdriverproject.org" , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Michael Kelley , Sasha Levin , "linux-acpi@vger.kernel.org" , Ross Zwisler , Stephen Hemminger , KY Srinivasan , Len Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 1, 2019 at 5:06 PM Dexuan Cui wrote: > > > From: Linux-nvdimm On Behalf Of > > Dexuan Cui > > Sent: Friday, February 1, 2019 4:34 PM > > > > > ... > > > > > 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 > > > > > 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. > > On the libnvdimm-pending branch, I get this: > > root@decui-gen2-u1904:~/nvdimm# ndctl list > root@decui-gen2-u1904:~/nvdimm# ndctl list --idle > [ > { > "dev":"namespace1.0", > "mode":"raw", > "size":0, > "uuid":"00000000-0000-0000-0000-000000000000", > "state":"disabled" > }, > { > "dev":"namespace0.0", > "mode":"raw", > "size":0, > "uuid":"00000000-0000-0000-0000-000000000000", > "state":"disabled" > } > ] > > With the patch that clears the LOCAL label (BTW, the initial value of flags is 0x3, > meaning a read-only local label) : > @@ -2496,6 +2500,7 @@ static int init_active_labels(struct nd_region *nd_region) > if (!label_ent) > break; > label = nd_label_active(ndd, j); > + label->flags &= ~NSLABEL_FLAG_LOCAL; > label_ent->label = label; > > I get this: > > root@decui-gen2-u1904:~/nvdimm# ndctl list > root@decui-gen2-u1904:~/nvdimm# ndctl list --idle > [ > { > "dev":"namespace1.0", > "mode":"raw", > "size":0, > "uuid":"c258aaab-f72b-e546-bfa5-be5e07761dbc", > "state":"disabled", > "name":"Microsoft Hyper-V NVDIMM 1 Label" > }, > { > "dev":"namespace0.0", > "mode":"raw", > "size":0, > "uuid":"9f0497a7-4453-7c40-ad35-21a791e00345", > "state":"disabled", > "name":"Microsoft Hyper-V NVDIMM 0 Label" > } > ] > > The "size" and "mode" still don't look right, but the improvement is that > now I can see a good descriptive "name", which I suppose is retrieved > from Hyper-V. Mode is right, there is no way for Hyper-V to create Linux fsdax mode namespaces it requires some setup using variables only Linux knows. Can you send the output of: ndctl read-labels -j all > > With Ubuntu 19.04 (4.18.0-11-generic), I get this: > (Note: the "mode" and "size" are correct. The "uuid" is different from > the above "9f0497a7-4453-7c40-ad35-21a791e00345" -- this is weird.) > > root@decui-gen2-u1904:~# ndctl list > [ > { > "dev":"namespace1.0", > "mode":"raw", > "size":137438953472, > "blockdev":"pmem1" > }, > { > "dev":"namespace0.0", > "mode":"fsdax", > "map":"dev", > "size":33820770304, > "uuid":"35018886-397e-4fe7-a348-0a4d16eec44d", > "blockdev":"pmem0" > } > ] This is because the Ubuntu kernel has the bug that causes _LSR to fail so Linux falls back to a namespace defined by the region boundary. On that namespace there is an "fsdax" info block located at the region base +4K. That info block is tagged with the uuid of "35018886-397e-4fe7-a348-0a4d16eec44d". > I'm trying to find out the correct solution. I apprecite your insights! It's a mess. First we need to figure out whether the label is actually specifying a size of zero, or there is some other bug. However, the next problem is going to be adding "fsdax" mode support on top of the read-only defined namespaces. The ndctl reconfiguration flow: ndctl create-namespace -e namespace0.0 -m fsdax -f ...will likely fail because deleting the previous namespace in the labels is part of that flow. It's always that labels are writable. Honestly, the quickest path to something functional for Linux is to simply delete the _LSR support and use raw mode defined namespaces. Why have labels if they are read-only and the region is sufficient for defining boundaries?