All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Marta Rybczynska <mrybczyn@kalray.eu>
Cc: Keith Busch <keith.busch@intel.com>,
	linux-nvme <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 4/4] nvme-cli: ioctl: support 64-bit ioctls
Date: Tue, 5 Nov 2019 06:45:31 -0700	[thread overview]
Message-ID: <20191105134530.GA2462@keith-busch> (raw)
In-Reply-To: <436860210.90381688.1572941457980.JavaMail.zimbra@kalray.eu>

On Tue, Nov 05, 2019 at 09:10:57AM +0100, Marta Rybczynska wrote:
> @@ -600,9 +618,30 @@ static void nvme_to_passthru_cmd(struct nvme_passthru_cmd *pcmd,
>  	pcmd->cdw15 = le32_to_cpu(ncmd->common.cdw10[5]);
>  }

You're working off of some non-public fork, and a broken one at that.
See below.

> +static void nvme_to_passthru_cmd64(struct nvme_passthru_cmd64 *pcmd,
> +				   const struct nvme_command *ncmd)
> +{

User space has no business using a 'struct nvme_command'. That's for
kernel use only.

> +	assert(sizeof(*ncmd) < sizeof(*pcmd));
> +	memset(pcmd, 0, sizeof(*pcmd));
> +	pcmd->opcode = ncmd->common.opcode;
> +	pcmd->flags = ncmd->common.flags;
> +	pcmd->rsvd1 = ncmd->common.command_id;
> +	pcmd->nsid = le32_to_cpu(ncmd->common.nsid);
> +	pcmd->cdw2 = le32_to_cpu(ncmd->common.cdw2[0]);
> +	pcmd->cdw3 = le32_to_cpu(ncmd->common.cdw2[1]);
> +	/* Skip metadata and addr */
> +	pcmd->cdw10 = le32_to_cpu(ncmd->common.cdw10[0]);
> +	pcmd->cdw11 = le32_to_cpu(ncmd->common.cdw10[1]);
> +	pcmd->cdw12 = le32_to_cpu(ncmd->common.cdw10[2]);
> +	pcmd->cdw13 = le32_to_cpu(ncmd->common.cdw10[3]);
> +	pcmd->cdw14 = le32_to_cpu(ncmd->common.cdw10[4]);
> +	pcmd->cdw15 = le32_to_cpu(ncmd->common.cdw10[5]);
> +}

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-11-05 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05  8:10 [PATCH 4/4] nvme-cli: ioctl: support 64-bit ioctls Marta Rybczynska
2019-11-05 13:45 ` Keith Busch [this message]
2019-11-05 14:05   ` Marta Rybczynska
2019-11-05 14:58     ` Keith Busch
2019-11-05 15:13       ` Keith Busch

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=20191105134530.GA2462@keith-busch \
    --to=kbusch@kernel.org \
    --cc=keith.busch@intel.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mrybczyn@kalray.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.