Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp731589ima; Fri, 1 Feb 2019 10:06:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7keJno2ppyN/Ys7MhtLfHcXoooD3kt4o5ILImfpC/Yd2KMdgPiUrxCJuKcjbW6rdvwlORo X-Received: by 2002:a17:902:9305:: with SMTP id bc5mr40044982plb.86.1549044366300; Fri, 01 Feb 2019 10:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549044366; cv=none; d=google.com; s=arc-20160816; b=e18qNLYwqCXWnQ7Qy31v9dDlBo+XFw+2E8hHDQPoX74Z9JmBZNWG6qksTxH/bw3qnw uxQDUQeoisg9fhvArap+/DDGHuXkRCzyEumKW/JmDIrYaY+CAi8YiguUQ2xS24q2NbE3 3O3nl+fO1cGAR23ALrQqcCoo9CbWrqlJu4Hytm7qIJXGopV2+RUeiCnW+e9/lPOZJtvf GpbRCT08tzu+v0Yo4O1UF3WZe8fSFJwhc7Gr5meMw9xtk2ae35VreX0f1eWKhLr7XQc6 DwcPITFp9+PA2vlMG+NJC4rNQORj2b1lbc60bDFcq1GROCIweDUXCt2heQZZEQ0INSKS wUZw== 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=eggK3FuKM9E1dxUDM0qROiytkJIW4PgBwYAb7mj7JsY=; b=Hn8HkMhKzYZ3pOQi0noxXX1MsVoyGExaV8BVzcfu2nVLGeSL3NADX05DjAMzx2U3FJ r/j30omNVg2jQGL1qis+nPhbbc7Xr7xiEyIQ2aVfoYVQmTFLqieAhZqT8RAI/qIX7AB+ f4Na0pXMRTrUBbCd6X12RPc0w2fYJmi8Z+ArUpVHRU2Mw1CtPvkE7cNsm0GSYJBtIFg4 5L/vGHU2420rpEsgrITj1VzUzP71Z8VharfBxgx2/IA469KeUOtsq/ScBwI5FYITO+aq K12szrlvT3P//CegudXrYl03EzJqnUU+oIrUIEjz8CIjrEqMUbTQTShPXpDOd7wshUOu AUrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=bexk2lQx; 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 b15si8228562plm.431.2019.02.01.10.05.50; Fri, 01 Feb 2019 10:06:06 -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=bexk2lQx; 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 S1731273AbfBAR3k (ORCPT + 99 others); Fri, 1 Feb 2019 12:29:40 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46333 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729480AbfBAR3j (ORCPT ); Fri, 1 Feb 2019 12:29:39 -0500 Received: by mail-ot1-f66.google.com with SMTP id w25so6623911otm.13 for ; Fri, 01 Feb 2019 09:29:38 -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=eggK3FuKM9E1dxUDM0qROiytkJIW4PgBwYAb7mj7JsY=; b=bexk2lQx1hmgGR7uI0Ke0d7AcoVfc4lRMXRbw511cQ+yxztdXs/es6fRdCf+K5NyGM tVLzLcz9JsO7Bui6gkp+vEVJWJqmrjcRzIPASLC/zCGNUUkv8JIJc+H2pcMIcm1zgI63 9JJZMBpx1HBncr5lfYCXyZQdFTq20/SS8PIWqopr/Xe0GO9mkhxaQjtSjSThq3W3cHbV k3IiAyggV49ErJJtv7I7Uf5XhMCBES7LvwI+YLvGL98ZYaFaNagA5MMYilZtW9o3OaDG 2lidLE6rNTdUsNYYhJt9A44Nc9H1EZfjIUFYA00XPrCtgnik+ZKKSi/coMIqKcyLft57 GH3w== 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=eggK3FuKM9E1dxUDM0qROiytkJIW4PgBwYAb7mj7JsY=; b=HIFAV77zX5mmSmIZWVBCRwZQdVjxndgQ1Ilxsg//GpTOxTJIPfN1PKnAZpKwuV5HOe QXI3eq8OFg/ritx4yYkcNXpR1TphHMnE4mGqWjAqU95Bsl4BOwDSEPcL0EbDq2SfCB0j CnMxyshdZ+95z4U637qTXAGcFZGpM6eqWSyBud5WMpXd3Lpr3LyTfhxZSNXcnxjcB9a/ zo+/eHSvuw7MK+c9wedgTRVovRSUqVExnZgjs5wE4/giEiXADl+e9wkC3cAyUlMLLOdC J/qYBVzyWJ8wIE3fr414S/obrJMqxN9vRvWKNPKNVwlI0CX1TpiHRBfT+it9b3robyX0 Z6yw== X-Gm-Message-State: AJcUukfM6wIxHejJiFxDwC0cJ6KAKsKhlwvurpChKI5gpfERPEtKEr3u /knNY2RPc6oFhvDa38B7dQSDfSJ1JG6HcUt+6ht2bA== X-Received: by 2002:a9d:394:: with SMTP id f20mr28051635otf.98.1549042178139; Fri, 01 Feb 2019 09:29:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dan Williams Date: Fri, 1 Feb 2019 09:29:27 -0800 Message-ID: Subject: Re: [PATCH v2] nfit: add Hyper-V NVDIMM DSM command set to white list To: Dexuan Cui Cc: Ross Zwisler , Vishal Verma , Dave Jiang , "Rafael J. Wysocki" , Len Brown , "linux-nvdimm@lists.01.org" , "linux-acpi@vger.kernel.org" , Josh Poulson , Stephen Hemminger , Haiyang Zhang , "driverdev-devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , Michael Kelley , Sasha Levin , KY Srinivasan 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 9:14 AM Dexuan Cui wrote: > > > From: Dan Williams > > Sent: Tuesday, January 29, 2019 10:24 PM > > On Mon, Jan 28, 2019 at 4:56 PM Dexuan Cui wrote: > > > > > > > > > Add the Hyper-V _DSM command set to the white list of NVDIMM command > > > sets. > > > > > > Thanks Dan Williams for writing the > > > comment change. > > > --- > > > Changes in v2: > > > Updated the comment and changelog (Thanks, Dan!) > > > Rebased to the tag libnvdimm-fixes-5.0-rc4 of the nvdimm tree. > > > > Thanks for the re-spin, applied. > > Hi Dan, > Unluckily it looks this commit causes a regression on > https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git/log/?h=libnvdimm-pending > > With the patch, "ndctl list" shows nothing, and /dev/pmem0 can't appear. > If I revert the patch, it will be back to normal. > > I attached the config/logs. In the bad case, "dmesg" shows a line > [ 5.259017] nd_pmem namespace0.0: 0x0000000000000000, too small must be at least 0x1000 > > Any idea why this happens? I'm digging into the details and I appreciate your insights. Looks like it is working as expected. The regression you are seeing is the fact that the patch enables the kernel to enable nvdimm-namespace-label reads. 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. 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. [1]: http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf