From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-o94.zoho.com (sender4-pp-o94.zoho.com [136.143.188.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9ABE45FFA0; Thu, 30 Jul 2026 18:53:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.94 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785437638; cv=pass; b=KngpW2ee0IMx1ZpMhXdcpnPfLLVUcgpqgagpju+c1QyZ28dObFcsCaASxu/oACDV02NtDV+BQOpwSrxnkQFLjNWWZUJ/NvuorByIxiC9cPeC+rCWcDjMFE5u5rLZK92Ael5HvSMOgaOJEBwiLUgk5yxzn5yWN2rBoUhdO7nYjyw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785437638; c=relaxed/simple; bh=aaAF3Z5SpdenQumU2g2LMGzy7IlVOprEy6ZYOX1B/4w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FQ62P6sTMfWBwJbAlnVAtBxMhXu1HeUEdBmofnq2nCDZcP5sV8cpydfAiZjMBhd7b2jUtykvUcBzg5wam+SosVRbsST1OF+iENZcqUQ4x5AD/jUZOzdDDIPVTq76JgfJQw2ijLA4hQZx9sk5JbfEW+RQzyISKZZ3+miigubBIwI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com; spf=pass smtp.mailfrom=zohomail.com; dkim=pass (1024-bit key) header.d=zohomail.com header.i=mhklkml@zohomail.com header.b=BDdWcHuc; arc=pass smtp.client-ip=136.143.188.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.com header.i=mhklkml@zohomail.com header.b="BDdWcHuc" ARC-Seal: i=1; a=rsa-sha256; t=1785437368; cv=none; d=zohomail.com; s=zohoarc; b=PauwZrfp4Fil0RcXBDX92fKJ9ST2X9YJCUdF8KqaTpxHHeQXQakW0b6pIagZPgLAmpAeHTngmf/c6oZaXO4yjq6Onah4wDrWlXHRMNTLmmNqJ3nMti9v+kUGyRCqiRaac2kGOp71uWfHk0n5d8QficeLgTrbZ0Ul3oXkJZKzgNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785437368; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id; bh=h94cUXFP+VE1XnJ0NZVxD6Bn7TTvsQmMmuJRaJW8KQo=; b=eAWEiX4zy0ZDftxXa7NW9k7a6AIUyMMM8BIW/M2CCt0+wPmgnI3/Wi6mAZ89nhNTq6GHGKMLTzUTdGYLf0JsUEGAV8hd9n+Yg7YjElqMKox7RhQs8xokgW63dQ2Ho55QMTZfcufPuHbzf1slI5WOWSSCSYTeor+DP03ZOuGtD5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zohomail.com; spf=pass smtp.mailfrom=mhklkml@zohomail.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1785437367; s=zm2022; d=zohomail.com; i=mhklkml@zohomail.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:Reply-To:Reply-To:MIME-Version:Content-Transfer-Encoding:Feedback-ID; bh=h94cUXFP+VE1XnJ0NZVxD6Bn7TTvsQmMmuJRaJW8KQo=; b=BDdWcHuc0dXWFM5FFx4rcjoT3vMMLCs7Qr6CGw1gTpAfVaKjOCTxBCHULUFxlORn 0PfmN5SDVmUWkgja5VCruStZ+Kl72Fiw4T0oRXfQ3GNMGJ+iwZNvJuhSAUSNEeEmUtU j1nVVMPgFyXKYCrvE24e14iciNJXO7trdQuDQt+U= Received: by mx.zohomail.com with SMTPS id 1785437365413837.8134952111768; Thu, 30 Jul 2026 11:49:25 -0700 (PDT) From: Michael Kelley To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, daniel.lezcano@kernel.org, ssengar@linux.microsoft.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, sgarzare@redhat.com, horms@kernel.org Cc: x86@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, virtualization@lists.linux.dev Subject: [PATCH 5/6] scsi: storvsc: Remove support for storvsc protocol of old Hyper-V hosts Date: Thu, 30 Jul 2026 11:48:45 -0700 Message-Id: <20260730184846.3165-6-mhklkml@zohomail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260730184846.3165-1-mhklkml@zohomail.com> References: <20260730184846.3165-1-mhklkml@zohomail.com> Reply-To: mhklinux@outlook.com Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Feedback-ID: zu080112274dd1eb380f35ccb59f6b55ae000069ec151d39bcc2f2a9829b10a2df78c9c3cb6e62fb6b9ddc59:ZohoMail X-Zoho-CM-AccountID: 0c88436b239415d28725328898ceccb9ce2ba3b61598c1c37bcb2109e0248174 X-ZohoMailClient: External From: Michael Kelley With the overall removal of Linux support for running on Hyper-V hosts earlier than WS2016 and Windows 10, it's no longer necessary to support older storvsc protocols. Remove the support and associated special case code. However, support for the protocol for Windows Server 2012R2 and Win8.1 (protocol version 6.0) is *not* removed because it is activiely used by HvLite in the paravisor for Azure VMs. Signed-off-by: Michael Kelley --- drivers/scsi/storvsc_drv.c | 53 +++++++------------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 571ea549152b..095fce47c5f1 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -47,9 +47,15 @@ * V1 RC < 2008/1/31: 1.0 * V1 RC > 2008/1/31: 2.0 * Win7: 4.2 - * Win8: 5.1 - * Win8.1: 6.0 - * Win10: 6.2 + * Win8/WS2012: 5.1 + * Win8.1/WS2012R2: 6.0 (also for HvLite paravisor in Azure) + * Win10/WS2016: 6.2 + * + * Protocol versions earlier than Win8.1 are no longer supported since + * Win8.1/WS2012R2 and earlier hosts are no longer supported by Linux. + * But protocol version 6.0 is retained since it is used by the HvLite + * paravisor in Azure. The #define's for the earlier versions remain + * for the historical record. */ #define VMSTOR_PROTO_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \ @@ -218,7 +224,6 @@ struct vmscsi_request { static const int protocol_version[] = { VMSTOR_PROTO_VERSION_WIN10, VMSTOR_PROTO_VERSION_WIN8_1, - VMSTOR_PROTO_VERSION_WIN8, }; @@ -1601,13 +1606,12 @@ static int storvsc_sdev_configure(struct scsi_device *sdevice, sdevice->no_write_same = 1; /* - * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3 + * If the host is WIN8 R2, claim conformance to SPC-3 * if the device is a MSFT virtual device. If the host is * WIN10 or newer, allow write_same. */ if (!strncmp(sdevice->vendor, "Msft", 4)) { switch (vmstor_proto_version) { - case VMSTOR_PROTO_VERSION_WIN8: case VMSTOR_PROTO_VERSION_WIN8_1: sdevice->scsi_level = SCSI_SPC_3; break; @@ -1703,28 +1707,6 @@ static enum scsi_timeout_action storvsc_eh_timed_out(struct scsi_cmnd *scmnd) return SCSI_EH_RESET_TIMER; } -static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) -{ - bool allowed = true; - u8 scsi_op = scmnd->cmnd[0]; - - switch (scsi_op) { - /* the host does not handle WRITE_SAME, log accident usage */ - case WRITE_SAME: - /* - * smartd sends this command and the host does not handle - * this. So, don't send it. - */ - case SET_WINDOW: - set_host_byte(scmnd, DID_ERROR); - allowed = false; - break; - default: - break; - } - return allowed; -} - static enum scsi_qc_status storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) { @@ -1738,21 +1720,6 @@ static enum scsi_qc_status storvsc_queuecommand(struct Scsi_Host *host, u32 payload_sz; u32 length; - if (vmstor_proto_version <= VMSTOR_PROTO_VERSION_WIN8) { - /* - * On legacy hosts filter unimplemented commands. - * Future hosts are expected to correctly handle - * unsupported commands. Furthermore, it is - * possible that some of the currently - * unsupported commands maybe supported in - * future versions of the host. - */ - if (!storvsc_scsi_cmd_ok(scmnd)) { - scsi_done(scmnd); - return 0; - } - } - /* Setup the cmd request */ cmd_request->cmd = scmnd; -- 2.25.1