Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2025 21:13:00 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 952ce991ec6c - main - nvme: Linux compat: don't filter & 0x3.
Message-ID:  <202509082113.588LD0cq035614@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=952ce991ec6c699ef59528731a9af75152767ef0

commit 952ce991ec6c699ef59528731a9af75152767ef0
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-09-08 21:09:49 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-09-08 21:09:49 +0000

    nvme: Linux compat: don't filter & 0x3.
    
    Strictly speaking, opc & 0x3 == 3 is input and output at the same
    time. This is undefined, in general. But for vendor commands, it's
    vendor specific. Linux allows it generally and treats it as a read,
    which is what we do too, so remove this check to be more compatible with
    Linux's behavior (which we're trying to emulate).
    
    Sponsored by:           Netflix
---
 sys/dev/nvme/nvme_ctrlr.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index fc912c1342f4..3a1894bf754d 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -1417,14 +1417,6 @@ nvme_ctrlr_linux_passthru_cmd(struct nvme_controller *ctrlr,
 			    npc->data_len, ctrlr->max_xfer_size);
 			return (EIO);
 		}
-		/*
-		 * We only support data out or data in commands, but not both at
-		 * once. However, there's some comands with lower bit cleared
-		 * that are really read commands, so we should filter & 3 == 0,
-		 * but don't.
-		 */
-		if ((npc->opcode & 0x3) == 3)
-			return (EINVAL);
 		if (is_user) {
 			ret = nvme_user_ioctl_req(npc->addr, npc->data_len,
 			    npc->opcode & 0x1, upages, nitems(upages), &npages,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509082113.588LD0cq035614>