From nobody Thu Nov 03 12:57:14 2022 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N33gZ5F7lz4gxQB for ; Thu, 3 Nov 2022 12:57:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N33gZ3FG2z3WjM for ; Thu, 3 Nov 2022 12:57:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N33gZ1mFmzcZQ for ; Thu, 3 Nov 2022 12:57:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2A3CvEre087855 for ; Thu, 3 Nov 2022 12:57:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2A3CvEJA087854 for virtualization@FreeBSD.org; Thu, 3 Nov 2022 12:57:14 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 267539] Bhyve virtio-scsi warnings about illegal SCSI tag reuse Date: Thu, 03 Nov 2022 12:57:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: crest@rlwinm.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667480234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EBbQ4zBvXQ+LNjXHUXSCJDCEvMSc0X+SmplxZmcrgE8=; b=uQ4ieo//Lks5pkzITKmGkM+ewvhvpB+g8jKrGK9l4DayNj1DwGqfkd2a/EdpNdKmfAU+t4 +R14RUJ9NcT4yf8FGx809nCxSOVsKDfhmJqYBD4xBb0uT0YquPuNiFIe5P/OFDEVm96FCJ gjHASv19dSanTfF83R31qd0QpxMOIonEELlAB6pNvts4qAacl0K97SlBS6o0bd6IC7B78F RTOQSZgUoa8bQBJppRMVLQqAIAbDKyfZr5qh2Gtc8L4W0DNGq+PQ9cgCaykcXSuGIURYWv wzhF7J/gjwoq2JTfAB1weD1qCXA3BiYp9h4Pzq6u2B8NX12/1yjVr5GcTPZk4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667480234; a=rsa-sha256; cv=none; b=oyz68XCOl2ywW3KUOn2MUUo3o60ti0zREEq50iMaopTjUW8MYRQTk03FCz8KvrTnZK/81s 46eXJQTBJWdhbKgi9GxjRGXQqD1m7D8sWJRpymoeRwFam0sDnLxRdvWxouwjnWWsMUV/78 e5496rEkO043yM6VZ4FZieNbvrjtb/+s8v0HPlWjdd/yX3wU6cflc2jE/ckBWoY2oXkE5l 8YXq9bj97usJ7w9txyB+pIWp/GxuSlfuzq+8rAJGrkZVtp+njrv+kO7A58zjmMScpS1nbX aHEUYFZF46M/AwCxcG/uQRokFbtpcW4ZPVhUGabaW1lYH0hOg16hRdcAAH65rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267539 Bug ID: 267539 Summary: Bhyve virtio-scsi warnings about illegal SCSI tag reuse Product: Base System Version: 13.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bhyve Assignee: virtualization@FreeBSD.org Reporter: crest@rlwinm.de Created attachment 237838 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D237838&action= =3Dedit Replace the virtio_scsi tags with an atomic 32 bit counter. I'm running FreeBSD 13.1/amd64 both as bhyve host and guest. The guests acc= ess to block storage is provided via virtio-scsi backed by local ZVOLs. Under h= eavy disk I/O (e.g. fio benchmarks on a UFS file system of ~30GB) I get these warnings every few seconds inside the guest: (da1:vtscsi0:0:0:1): WRITE(10). CDB: 2a 00 00 cc 17 88 00 00 08 00 (da1:vtscsi0:0:0:1): CAM status: SCSI Status Error (da1:vtscsi0:0:0:1): SCSI status: Check Condition (da1:vtscsi0:0:0:1): SCSI sense: ILLEGAL REQUEST asc:4d,af ((null)) (da1:vtscsi0:0:0:1): Retrying command (per sense data) (da1:vtscsi0:0:0:1): WRITE(10). CDB: 2a 00 00 cc f6 30 00 00 08 00 (da1:vtscsi0:0:0:1): CAM status: SCSI Status Error (da1:vtscsi0:0:0:1): SCSI status: Check Condition (da1:vtscsi0:0:0:1): SCSI sense: ILLEGAL REQUEST asc:4d,20 ((null)) (da1:vtscsi0:0:0:1): Retrying command (per sense data) (da1:vtscsi0:0:0:1): WRITE(10). CDB: 2a 00 00 30 ad 20 00 00 08 00 (da1:vtscsi0:0:0:1): CAM status: SCSI Status Error (da1:vtscsi0:0:0:1): SCSI status: Check Condition (da1:vtscsi0:0:0:1): SCSI sense: ILLEGAL REQUEST asc:4d,f6 ((null)) (da1:vtscsi0:0:0:1): Retrying command (per sense data) The SCSI sense code reported (ILLEGAL REQUEST asc:4d,XX) decodes to the ill= egal reuse of a tag value that's already pending. I looked into the virtio_scsi guest driver and it uses the pointer a struct csio (casted to a 64bit uintptr_t) as SCSI tag, but on the host side inside CTL SCSI tags are trunc= ated to 32 bit. I suspect this causes pointers with identical lower 32 bits to m= ap to the same tag as seen by CTL, but an attempt to patch the virtio_scsi gue= st driver to use an atomic 32 bit counter (cargo culting the iSCSI tag handlin= g) instead didn't solve the problem. I still attached the experimental patch. --=20 You are receiving this mail because: You are the assignee for the bug.=