From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B95E47ACD1 for ; Wed, 5 Aug 2026 20:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962289; cv=none; b=tygycXw83K+skOrLUeBVu5FTC/Plpi9c00Nsbm5KhGiAc7/JpMF3nSsBC1762JHKmHDXvRpXgz8Wzkuo1xcDLMh/Z1XnnI3QjhhU9b+MyhOSr0KR/J+p2isU6PyyxCudozzphptlwEVZNqtEQTmqx9KazqWVMYnmrL7gy5EEqE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962289; c=relaxed/simple; bh=MNTjFuYLFdVeyceY4LcPMIuVzMCe26DSnzXIN55cVDQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ULCCpQm5VLHEzd69+zo09jKvQJbb8EsAYZ89EbZaYSyFUDoHJuM+U+ULcHDiLh9eCbpZsXOJc/tCFopDUlvQiGWgia1HKUrXUxJXC6YBPPCiRH/S+pp7e4bpgfaeB0X1zDMFP8Xn47dhFnCOlc4Z6SI2GhgXZw0oszmdxtJ/OQE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ou1EJsC3; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ou1EJsC3" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2cca0c5799eso14153905ad.0 for ; Wed, 05 Aug 2026 13:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962287; x=1786567087; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=D2idJVNVVV8Bl12yg0gHJeA25XCgAkeyyrmZbnDeaoA=; b=ou1EJsC3OZ7//zRgTwMS9Yr9uGeE953OiBIwoPT6UXyMp/5frd+rzw8YTVbB3W84GW IkfKC7cwUmOLl8vIN/Tp5TwVnaVgXcqW5e6Pu0VmCoZdn82ni0kXLluQIliG8V1Kll9r uLUINfV7Jkov/FVjzQ71RS4UruWidWGSJ8cHOaV6WlTnmln7boGB30Xo9SH8z/z4XZ9M LfVk3f8HzliCd314HdxJdtZqAdU7RX4vxQvZU+Ps6lCv+XnCzDaaT5b7o9nvUb5nzrL7 XV5zNxCu9x2Vg9cwkzS+E79i0rckfsdclarihCqGORSC6Jf7ZdtJhhDkgxDKp7bAuNMP rE7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962287; x=1786567087; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=D2idJVNVVV8Bl12yg0gHJeA25XCgAkeyyrmZbnDeaoA=; b=c/qdvZMXD0x38Rg11kmmsa9SOnFnvlhexU2loOJ/iwTXswo3kh+gyPxLKDWBw/74Vw shAUsUp3aU7pBjLSnwVGS1jAfywOvM4kYOfErGFQr07jPjMjTpBiPkRAK3rEklsGHDJW LvjQfDpUA++5gL/2cKbLfVO8ekBkvVAimx0yWWDGFkmlVEtA5nzaX8DF1whULzFOwTrN 2FFtPA5MWkULgGp4fBk3S03wjq5bT3TFrqIQrWnLFf+vlUe/tJs9sTKju7ngp7pT92Hg iDbCMDlBeKgq0pibCAjFPO4zl5wGayxCSGwIa5RuhAZMUEqBWwJYQt2CFM0nXQ59vLUl /ZXQ== X-Gm-Message-State: AOJu0YzOFedhU0VCflzTJrUU6mSwK05aT9oJSoJkxu+cDlwKSKTjDRQM 9jANDPoN47t+gtyEYY4vt57FHE1ktzVtqKG35A1k1tWmyUPyZFX9Dgbz X-Gm-Gg: AR+sD10kZeAjqKDreRaE59zeZzOrozqWwrObC1AoJnajcOHq4ziPZSX/Zgn8aOOs0No +ddYYwdlxS0X5oLaYGP9g+2B3juWGofBagk7Nx40dy3bLgjbXcwHmUIYWJK0n+1WrisCH/fYl0t d7VKnYspGxFTtP3dXY7oBOpWioM4EQ6XGRlGUoEf7Ho54RS+u5NQPXgeMxLQhqcWpUsFkWMcZ86 3kW2CJpHkOt3BPXuUcpYVaW6o1d2Stz1rDVxrrV0stXFPiP8GD9ieKmlaGp44QjQyvnfkxStTGp juXdPD0LjkgnoziU3wmvK9/Y6kw1FVWFBI0hzpgtMPFonN4bmsnPH5Z74FG91zcclOaLxPf1wCt WP90PGYU3SHlSY4tR4XkjkCJbi/P9x0Vv1wWpyV1IWY//bAtW0WFKPN4YuPy5/0+teJBVABjmon ibil9yFVMden4ItKzGQG0KIzv6wZL3WfQRZGrneYKZBEH7Axh6/IPM15la5Qh4myekBzCoQxttB da2N8BQ6OIKaik04ixValUAXIu3DaaWeBnzHC9Mnd6EVsq+qLGYZA== X-Received: by 2002:a17:903:324b:b0:2bf:27b2:4b80 with SMTP id d9443c01a7336-2d0ca7fa969mr121691295ad.14.1785962287501; Wed, 05 Aug 2026 13:38:07 -0700 (PDT) Received: from localhost.localdomain (c-174-165-208-10.hsd1.wa.comcast.net. [174.165.208.10]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d0aa4c0b1fsm21372745ad.64.2026.08.05.13.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:07 -0700 (PDT) From: Michael Kelley X-Google-Original-From: Michael Kelley To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, linux-hyperv@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] scsi: storvsc: Remove support for storvsc protocol of old Hyper-V hosts Date: Wed, 5 Aug 2026 13:37:50 -0700 Message-Id: <20260805203751.2678-6-mhklinux@outlook.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260805203751.2678-1-mhklinux@outlook.com> References: <20260805203751.2678-1-mhklinux@outlook.com> Reply-To: mhklinux@outlook.com Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- No changes in v2. 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