lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <EC9FE5B1-5E13-4B4F-A925-07572859FBE9@cnexlabs.com>
Date:   Thu, 8 Feb 2018 13:35:09 +0000
From:   Javier Gonzalez <javier@...xlabs.com>
To:     Matias Bjørling <mb@...htnvm.io>
CC:     "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/4] lightnvm: add 2.0 geometry identification

> On 5 Feb 2018, at 13.15, Matias Bjørling <mb@...htnvm.io> wrote:
> 
> Implement the geometry data structures for 2.0 and enable a drive
> to be identified as one, including exposing the appropriate 2.0
> sysfs entries.
> 
> Signed-off-by: Matias Bjørling <mb@...htnvm.io>
> ---
> drivers/lightnvm/core.c      |   2 +-
> drivers/nvme/host/lightnvm.c | 334 +++++++++++++++++++++++++++++++++++++------
> include/linux/lightnvm.h     |  11 +-
> 3 files changed, 295 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index c72863b36439..250e74dfa120 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -934,7 +934,7 @@ static int nvm_init(struct nvm_dev *dev)
> 	pr_debug("nvm: ver:%x nvm_vendor:%x\n",
> 			dev->identity.ver_id, dev->identity.vmnt);
> 
> -	if (dev->identity.ver_id != 1) {
> +	if (dev->identity.ver_id != 1 && dev->identity.ver_id != 2) {
> 		pr_err("nvm: device not supported by kernel.");
> 		goto err;
> 	}
> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
> index 6412551ecc65..a9c010655ccc 100644
> --- a/drivers/nvme/host/lightnvm.c
> +++ b/drivers/nvme/host/lightnvm.c
> @@ -184,6 +184,58 @@ struct nvme_nvm_bb_tbl {
> 	__u8	blk[0];
> };
> 
> +struct nvme_nvm_id20_addrf {
> +	__u8			grp_len;
> +	__u8			pu_len;
> +	__u8			chk_len;
> +	__u8			lba_len;
> +	__u8			resv[4];
> +};
> +
> +struct nvme_nvm_id20 {
> +	__u8			mjr;
> +	__u8			mnr;
> +	__u8			resv[6];
> +
> +	struct nvme_nvm_id20_addrf lbaf;
> +
> +	__u32			mccap;
> +	__u8			resv2[12];
> +
> +	__u8			wit;
> +	__u8			resv3[31];
> +
> +	/* Geometry */
> +	__u16			num_grp;
> +	__u16			num_pu;
> +	__u32			num_chk;
> +	__u32			clba;
> +	__u8			resv4[52];
> +
> +	/* Write data requirements */
> +	__u32			ws_min;
> +	__u32			ws_opt;
> +	__u32			mw_cunits;
> +	__u32			maxoc;
> +	__u32			maxocpu;
> +	__u8			resv5[44];
> +
> +	/* Performance related metrics */
> +	__u32			trdt;
> +	__u32			trdm;
> +	__u32			twrt;
> +	__u32			twrm;
> +	__u32			tcrst;
> +	__u32			tcrsm;
> +	__u8			resv6[40];
> +
> +	/* Reserved area */
> +	__u8			resv7[2816];
> +
> +	/* Vendor specific */
> +	__u8			vs[1024];
> +};
> 

All __u16, __u32 should be __le16, __le32

Javier

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ