From nobody Wed Aug 26 20:42:01 2026 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 CECF74071FF for ; Wed, 5 Aug 2026 20:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962286; cv=none; b=iwBW3eWdVgePqktfXDOEAOl2pmFMRMLnUHZQMNwPBEB0MlgEYvtqqvtPXSbFbfYClsa7byy1zDEftyXcyeDKvgde/dK1GKi/edsKNTFhzYrGxIEupfSb7aw0hFtneTg4EjM6+0qbS2m4IdwVioZ70v5kLJEJTh4al9G2dSzavFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962286; c=relaxed/simple; bh=2JV7r7V/5Mfq8JH8nQM5E/GaIrbQyMtNDpsDFRzujZ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k1oYuDkS2dppYIZlTPNmxe4yIeXeY9NIHGnVnDX7rpqeG7lraB0HiP4jFIbCCxIsDY6thxZsCBgSrImoiz3z6cmoZ1SWkRGJAd5d8u/ylEirKi99pzIMQD83oma0lY7OWDaYz9CplzECIK2OrGYD6R3mfE8Mt53/0qiVScwLY68= 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=A+eeck3O; arc=none smtp.client-ip=209.85.214.170 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="A+eeck3O" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2d01663d816so13591375ad.1 for ; Wed, 05 Aug 2026 13:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962284; x=1786567084; 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=9jA62W3yoTyokb29gnpNc2qYchzwbF/7Ke7VtlhKVyA=; b=A+eeck3OGxbUWyYhtNL1rFuLKVIBEvEF9eTiCr6jMU2EvpAgWLfwBrR1m3mDrPWaRz J5HAMDRDZ1+v8KT6cUFSnjUGwOBPKHLp//n1T6q+MSpQvK3qlLtioQPCCeBMh6kwne6S cK7aCWmmHOVsjVV1DTz6nCsTL2wne5DNhFyqiupBQAcp7feP1c7Xfp0ST7JR/cZxXsaE pkWn43MI2H43DHgOw60Qclnm2KDm6SYqgR7jX4CrPidd51By3V4TaWqJ/XPf/bmKruvI Cdn/Jph18GNVGh1e+IW9vqYQ+Ze/Oeg+zz/TKcNkKcNzUkWCSBJkyREPPas8B4/QkIhL CsDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962284; x=1786567084; 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=9jA62W3yoTyokb29gnpNc2qYchzwbF/7Ke7VtlhKVyA=; b=Bauc2yHRhKSAwM8PlaLz8L91QjxQJcoleuKeTv06+9hCZt/PcCuU6503P0LnbX/beE wycdsZ032lbec31Jy3L7z5AKFBvjYYazajRZgDckSe/OWGHFhnUMtz3UuTTMC/7Nb9Wz n1qhRJAYSl8JIuAXciR2U44cTF6uDqvfvfkqrUOOi8YVQ3N3iyglb1shui3bMaubeYxz uEB4M1dwhVmWDp+C/LyZt1BXHjHiq2VMLXaRDjIp9gqfazPRea9YaCPNTQIoXm3jR2Oi Ur12M8PEiPiAyVjiM1KPDDXFrXaJd7lk76ahr37L5sMk24yIG5nmTA6nhOGitm2+koFd FBvw== X-Gm-Message-State: AOJu0Yy9Z9lsrHijVFPxTBkaPwZsCWum31wX/FpT0Q0TwdQUtNnHgAC2 uZ+yy2Ix7iPH59efg2O1sJ5umPe9nI2FAOgTHQd34QE6m4SkmvScGUVi X-Gm-Gg: AR+sD12iRtfEZCDG5dkjHj2ENvoTYHBx+fmLWb0nrngRqHUAMUq91270VtQFyVvTliO RFRbL9kFgJvKW++WOmVTrOPUi+eCNUcXxl3+erTExftFrri8JqkrfWyBxrYNUa4Q6T9OuVgCGUX u8Fc5W9cNaSq62FKKSHOSvFCKklnL+4CVix1pYi9wiWD39+zSWrdRkd0tSt9eSDtoaHALkX7plI 0wwXl2Kl5i94lNdUzL6sPtpcQO31enbleA0qu9KRmDsqC3TdXdaJheHo4I98wiwmbXm7fbqL9Rg fV74WwhMLj+d6URAJrnw+ldRb5hhIXLPJcwGOegYzFlvpm/5KacJF24zIEKY8WBlvwsMQ2VueCx Ep0SkocS43fxGgN2SfYE99XCKl4F7R2GYIEsIBpxVxnZuPHcypEEU1UB6/4Pa0uwnwqy/jl/I53 V/2MMDAbnW4DgMZgLDl23TBdZxK5mBqwQEQ94pKUBPgB0UuWZKqiI6AcvDYqD9aEBmWbcmZ1qnD yV8xtjv7MVtakjwCU11/+NXQtTsU1NiccV+MgYGysY= X-Received: by 2002:a17:903:18c:b0:2cf:7fab:3cf with SMTP id d9443c01a7336-2d0ca981a9fmr99371515ad.23.1785962283985; Wed, 05 Aug 2026 13:38:03 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:03 -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 1/6] Drivers: hv: Remove support for WS2012/2012R2 & Win8/8.1 version of Hyper-V Date: Wed, 5 Aug 2026 13:37:46 -0700 Message-Id: <20260805203751.2678-2-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: quoted-printable Content-Type: text/plain; charset="utf-8" Linux code for running as a Hyper-V guest includes special cases for running on Hyper-V in WS2012/2012R2 and Windows 8/8.1. These versions were initially released 14 years ago, and official support ended in 2023 (unless a customer has contracted for extended security updates). Given the release of subsequent versions with improved functionality, there's no need to continue to support the latest Linux kernels on these versions of Hyper-V. If someone is running Linux on one of these older Hyper-V versions and doesn't want to upgrade, they can continue to do so as presumably they don't want upgrade the Linux version either. Simplify Linux code by removing special cases for running on these old versions of Hyper-V. Remove the negotiation of the VMBus protocol versions for WS2012/Win8, and remove special case code based on those VMBus protocol versions. Also update the balloon and snapshot drivers to no longer negotiate driver-specific protocol versions for these older Hyper-V versions, and remove any related special cases. Signed-off-by: Michael Kelley --- Changes in v2: * Added error message in vmbus_connect() to indicate that running on an older version of Hyper-V is a possible cause of being unable to negotiate a compatible VMBus version [Hamza Mahfooz] * Added a check in vmbus_initiate_unload() to catch the CONNECTING state. This case was previously implicitly caught by the VMBus protocol version check that has been removed. [Sashiko] drivers/hv/channel_mgmt.c | 8 +++----- drivers/hv/connection.c | 11 +++++++---- drivers/hv/hv_balloon.c | 36 +++++++++++++++--------------------- drivers/hv/hv_snapshot.c | 5 ----- include/linux/hyperv.h | 5 ++--- 5 files changed, 27 insertions(+), 38 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 89d214dda360..a044fd3b3c4e 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -929,12 +929,10 @@ static void vmbus_unload_response(struct vmbus_channe= l_message_header *hdr) void vmbus_initiate_unload(bool crash) { struct vmbus_channel_message_header hdr; + enum vmbus_connect_state old_state; =20 - if (xchg(&vmbus_connection.conn_state, DISCONNECTED) =3D=3D DISCONNECTED) - return; - - /* Pre-Win2012R2 hosts don't support reconnect */ - if (vmbus_proto_version < VERSION_WIN8_1) + old_state =3D xchg(&vmbus_connection.conn_state, DISCONNECTED); + if (old_state =3D=3D DISCONNECTED || old_state =3D=3D CONNECTING) return; =20 reinit_completion(&vmbus_connection.unload_event); diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 0fd50d4cb573..1ab3581b096a 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -47,7 +47,9 @@ EXPORT_SYMBOL_GPL(vmbus_proto_version); =20 /* * Table of VMBus versions listed from newest to oldest. - * VERSION_WIN7 and VERSION_WS2008 are no longer supported in + * VERSION_WIN7,VERSION_WS2008, VERSION_WIN8 (which is + * Windows Server 2012) and VERSION_WIN8_1 (which is + * Windows Server 2012 R2) are no longer supported in * Linux guests and are not listed. */ static __u32 vmbus_versions[] =3D { @@ -57,9 +59,7 @@ static __u32 vmbus_versions[] =3D { VERSION_WIN10_V5_1, VERSION_WIN10_V5, VERSION_WIN10_V4_1, - VERSION_WIN10, - VERSION_WIN8_1, - VERSION_WIN8 + VERSION_WIN10 }; =20 /* @@ -304,6 +304,9 @@ int vmbus_connect(void) for (i =3D 0; ; i++) { if (i =3D=3D ARRAY_SIZE(vmbus_versions)) { ret =3D -EDOM; + pr_err("Hyper-V host does not support VMBus version %d.%d or higher;\n\ + the host may be an older version no longer supported by Linux\n", + vmbus_versions[i-1] >> 16, vmbus_versions[i-1] & 0xFFFF); goto cleanup; } =20 diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 42ce27be344d..9cba97e81111 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -58,6 +58,10 @@ #define DYNMEM_MAJOR_VERSION(Version) ((__u32)(Version) >> 16) #define DYNMEM_MINOR_VERSION(Version) ((__u32)(Version) & 0xff) =20 +/* + * VERSION_1 and VERSION_2 are retained for the historical record, + * but are no longer supported in Linux guests. + */ enum { DYNMEM_PROTOCOL_VERSION_1 =3D DYNMEM_MAKE_VERSION(0, 3), DYNMEM_PROTOCOL_VERSION_2 =3D DYNMEM_MAKE_VERSION(1, 0), @@ -65,9 +69,7 @@ enum { =20 DYNMEM_PROTOCOL_VERSION_WIN7 =3D DYNMEM_PROTOCOL_VERSION_1, DYNMEM_PROTOCOL_VERSION_WIN8 =3D DYNMEM_PROTOCOL_VERSION_2, - DYNMEM_PROTOCOL_VERSION_WIN10 =3D DYNMEM_PROTOCOL_VERSION_3, - - DYNMEM_PROTOCOL_VERSION_CURRENT =3D DYNMEM_PROTOCOL_VERSION_WIN10 + DYNMEM_PROTOCOL_VERSION_WIN10 =3D DYNMEM_PROTOCOL_VERSION_3 }; =20 /* @@ -1434,19 +1436,9 @@ static void version_resp(struct hv_dynmem_device *dm, version_req.version.version =3D dm->next_version; dm->version =3D version_req.version.version; =20 - /* - * Set the next version to try in case current version fails. - * Win7 protocol ought to be the last one to try. - */ - switch (version_req.version.version) { - case DYNMEM_PROTOCOL_VERSION_WIN8: - dm->next_version =3D DYNMEM_PROTOCOL_VERSION_WIN7; - version_req.is_last_attempt =3D 0; - break; - default: - dm->next_version =3D 0; - version_req.is_last_attempt =3D 1; - } + /* Set the next version to try in case current version fails. */ + dm->next_version =3D 0; + version_req.is_last_attempt =3D 1; =20 ret =3D vmbus_sendpacket(dm->dev->channel, &version_req, sizeof(struct dm_version_request), @@ -1735,16 +1727,18 @@ static int balloon_connect_vsp(struct hv_device *de= v) =20 /* * Initiate the hand shake with the host and negotiate - * a version that the host can support. We start with the - * highest version number and go down if the host cannot - * support it. + * a version that the host can support. The mechanism is in place + * to start with the highest version number and go down if the host + * cannot support it. But currently we only try the WIN10 version + * since support for older Hyper-V versions has been removed from + * Linux. */ memset(&version_req, 0, sizeof(struct dm_version_request)); version_req.hdr.type =3D DM_VERSION_REQUEST; version_req.hdr.size =3D sizeof(struct dm_version_request); version_req.hdr.trans_id =3D atomic_inc_return(&trans_id); version_req.version.version =3D DYNMEM_PROTOCOL_VERSION_WIN10; - version_req.is_last_attempt =3D 0; + version_req.is_last_attempt =3D 1; dm_device.version =3D version_req.version.version; =20 ret =3D vmbus_sendpacket(dev->channel, &version_req, @@ -1964,7 +1958,7 @@ static int balloon_probe(struct hv_device *dev, #endif dm_device.dev =3D dev; dm_device.state =3D DM_INITIALIZING; - dm_device.next_version =3D DYNMEM_PROTOCOL_VERSION_WIN8; + dm_device.next_version =3D 0; init_completion(&dm_device.host_event); init_completion(&dm_device.config_event); INIT_LIST_HEAD(&dm_device.ha_region_list); diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index 506871aeacf0..847dc69e8250 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -372,11 +372,6 @@ static void vss_on_reset(void) int hv_vss_init(struct hv_util_service *srv) { - if (vmbus_proto_version < VERSION_WIN8_1) { - pr_warn("Integration service 'Backup (volume snapshot)'" - " not supported on this host version.\n"); - return -ENOTSUPP; - } recv_buffer =3D srv->recv_buffer; vss_transaction.recv_channel =3D srv->channel; vss_transaction.recv_channel->max_pkt_size =3D VSS_MAX_PKT_SIZE; diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index a2b484679eb4..9652083b6798 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -260,9 +260,8 @@ static inline u32 hv_get_avail_to_write_percent( * 5 . 2 (Windows Server 2019, RS5) * 5 . 3 (Windows Server 2022) * - * The WS2008 and WIN7 versions are listed here for - * completeness but are no longer supported in the - * Linux kernel. + * The WS2008, WIN7, WIN8, and WIN8_1 versions are listed here for + * completeness but are no longer supported in the Linux kernel. */ =20 #define VMBUS_MAKE_VERSION(MAJ, MIN) ((((u32)MAJ) << 16) | (MIN)) --=20 2.25.1 From nobody Wed Aug 26 20:42:01 2026 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 7E17C420496 for ; Wed, 5 Aug 2026 20:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962286; cv=none; b=eYOBaGS950iDvP6BOK6DXLAO5qidkPQ5jiIO1uTmfPJXljwj/eXCDzGhUxd6jaOHdlwIYcFIXs48rhdUYRThBLcx+9CGjB1yRgAMdaEKUejaTxNM4t5QpytkIQf2oL6qr6X+qbHA3UDgUG/vhP3SkJxvNt1OduSjxEm53DowSeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962286; c=relaxed/simple; bh=UsrGlfHfBZ24s2mz89h36c6p74WT/yBuKhlLpP3iX+Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JxT3Y1o8aDGnauRHqpRmu53jlADdZ294ymhwIMjmKJaFL31dKCuhWlKgP1qJmHdeE8n/L8s5oMssyn3k2sSJkWHgZdHeGy5Ws2EmaRJ3B5KAyF3hQOt3TYDPWiK7RT9jEbtuFeL0hPVAc+ncupzTNy5TygOzaFcSHOx0yXw3KEo= 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=P2YcmqHF; arc=none smtp.client-ip=209.85.214.181 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="P2YcmqHF" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2cc97653887so17512035ad.1 for ; Wed, 05 Aug 2026 13:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962285; x=1786567085; 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=khZbcPeOcWMayZoJtmII1zy3N0Hefa7E1I1impxoRQ8=; b=P2YcmqHFuHEbTn9z3bsvbPIemFouU/5/I33WtR403jfvLCfdli43RO2H+JfLNSo+4r XIhncv5WtaF1gUuwDGondLpez+EV8d0l1+5K+kqKTmSGKVoup/gZTSjXASs2VyQrpxHB QZOcaQGpU2d6R3PZZir/bbIoiQKGWTdIQMgceTBAyzpOBL585x+pjcg3yu72/erBxfG6 ZKn2G1+dH4/l0mGSRWBVv5wGIInK8kugfyodBL51McCXfpRPCbe7sgOstSoaQxbD07Sh elqTB1rx4zUaMMS6n0wgbPaSuhnBLQeK1JJlwkYe8s+saypC7bW94n77v2VOfrQ0RCA8 VDHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962285; x=1786567085; 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=khZbcPeOcWMayZoJtmII1zy3N0Hefa7E1I1impxoRQ8=; b=X9oVcUEr5IcixVquKjLcTgP2nSu5XCopxBSBFz/7TBKyrj++Z8zt/4p5uP9ct2Co9U cGI9lGbE/vWmkdo4TNuCNlMmX/r2iJ8DTfwsVsJ8mqxHOXk+5HlfVtew9t1OY8rcRPFO 0eQKUQXvZHLtgRfR981hSuBbFKtgQZA8T108H5fSBo3WsXvQHbdCG8q9D7OPThU42UKq d2Ezk26GFft6sQlIfXyo+rgl9GiItX0H8ZBMF6YmSBJ92BZUdLgdeK4GyUBgFCJNElh/ E1lFG447yZLjtilQrvOtyE4UNyZT+2tONHW5tRr2Oq2pSvjANfzT7Hd3CcJ6Yyn6vRKa HEHw== X-Gm-Message-State: AOJu0YyQ4NxD2ereevWv71QvBwHdWYiEBx5dwfS/P0k/+WzM+y5uRTCC IyDbkDJhANsj8kSM8o7BlfUXIlV0JiYMik55XDXp6/sNwgnmFyLPjXsB X-Gm-Gg: AR+sD10TCKBnp0PQ5UVluTd1633a1yRXvQNOeFyfA9cKvout4j+xHB7BvU1wzsAizp8 JdwNJ+DIOM6SafsycudupYXkZcCO27NtmP2rYe0xPUrtXO8sBYgAxvPFTRI3tW9+zcwn9UWvzNn erfuOjXGBB7gKtkiBI2r15rtOHVOVgGI2ebAWAoceJcFYwVjbv/VmTvjUJ78Qdj5wxxZ3ZL4jbl MKr1FuWHSGyRQTWO2+MO2PT3gbNw3Nfm9fnsKEiQAzfrqp3fA4Klx/2IHnnG2fGkaPvij5dAL9f uwX9u5SNbtQS0fucPth5iUaH7dda62bSL16NRcr3BXyq1DrC877khB4rR5YqxFFdY8Id9M9jeb2 XabqSd3BQfuhERdDNTkPZZt9p5EswjB+a11iE+V5+ClSPsJiB6/cMrO7mK1QC+eYL65U0YZeeiB jadfPU+rWwSnz96BSckWP2pgbnN7DRaxnzIV5nu+FxFYdpb5I7zedVcRLqZ8qlLc6CjAudhjGY4 lJKjJsOAMgDtA+T9pNHgQJutMo6Xqic0oLVZq/6wMA= X-Received: by 2002:a17:902:ea01:b0:2c9:df1b:e948 with SMTP id d9443c01a7336-2d0ca70d2e9mr103696525ad.4.1785962284848; Wed, 05 Aug 2026 13:38:04 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:04 -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 2/6] hv_sock: Remove check for old Hyper-V hosts Date: Wed, 5 Aug 2026 13:37:47 -0700 Message-Id: <20260805203751.2678-3-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: quoted-printable Content-Type: text/plain; charset="utf-8" With the overall removal of Linux support for running on Hyper-V hosts earlier than WS2016 and Windows 10, the check for such versions during hv_sock initialization is no longer necessary. Remove the check. Signed-off-by: Michael Kelley --- No changes in v2. net/vmw_vsock/hyperv_transport.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transp= ort.c index 5405c2680dec..855b15971c35 100644 --- a/net/vmw_vsock/hyperv_transport.c +++ b/net/vmw_vsock/hyperv_transport.c @@ -961,9 +961,6 @@ static int __init hvs_init(void) { int ret; =20 - if (vmbus_proto_version < VERSION_WIN10) - return -ENODEV; - ret =3D vmbus_driver_register(&hvs_drv); if (ret !=3D 0) return ret; --=20 2.25.1 From nobody Wed Aug 26 20:42:01 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 60A90427FA6 for ; Wed, 5 Aug 2026 20:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962287; cv=none; b=aIJEvH8porzyoA41h1+jHfNizvHnNqGkpeUuB6qfDZGdZOcKF9HtDPDdQ2RHM2dDitaZD6V2wR9q6df9+OG3ZlC7sAARLrXfXKjHkPjTEzntx1QPpn2xs6ZWoTU00jfufcNMn+pU3DE8PyIxm1vRgUgvcNG2gfLgSc9owsE6HhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962287; c=relaxed/simple; bh=VsaTIDWzIDz8HB9EYpNvkcsnMfbvQ95aRyp/yCJU5AE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mJidD4pDLhk+eVYfI39Zfk7Z6rL7lCNjdoOHGlnr8JZ6k/hkwIRaxurUGpCrfbPAxrUBKWI6M4Y56hRdsJ2qqoZVWaG97N5D58nAFefpK/0Q5XSOfxCMnArXzMdgw8wodCx4HyIuwrdABSVAxDS1wdnSW17LoJY4gqt04utddmc= 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=SPv/dpud; arc=none smtp.client-ip=209.85.214.169 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="SPv/dpud" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2d049069377so15449595ad.0 for ; Wed, 05 Aug 2026 13:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962286; x=1786567086; 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=wufg7sO27f8/PuEZV6a7RVl6nQ0Yjk3GBfNCJb0RyYs=; b=SPv/dpudleDnRvMJQqE2w80+FzdU9Krd5DZ/5lz8dRFv9I6AQ2t83/gCsbAF5Y2lWn DiBNaE1CoRuC2K8PRwvflmFfJWU+ZfFxmVl2pX+CEy4zFcKbu1bYiN4gu/NmMVfU0COl VYdJJRbxJLkQL/OW10o0eKh7D1/DJ6yS9qYFkPnqS1KP1NtInKwljhTIRmBmQR9Nuqms 4gy27emivzr+O9EKZ2g++XR7kkCtRnWtvptOh4958kXltO9U2vQ+s3xlVyvp+Uj34ulD OKmDIZ9Iw0dpWvGCXbPQ432YHgUX/IQXIGd0rJbYikkqvxnyzEEXoNcvJDKpGk6imDvT sUKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962286; x=1786567086; 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=wufg7sO27f8/PuEZV6a7RVl6nQ0Yjk3GBfNCJb0RyYs=; b=E15xnb3PwHokt5GomBmlAJNBTQAO006qs85fyXJo3CnQVG7BIS6cjJRFGaXfBpG1cR jWCK3OKdj5aV2U7XbE6QmLpellm6+uvuXd6G7AlTAlEsq8k+3mUx/80rNfSk8HTV8/0u 774oLAjZAkzETXH/P2Tdmcl0/ylrcpzTxjyQwNE9k9I03k6F9943ooDsbH8Uq8ye5lj2 10tOP/Ji18IIoE3kplunWtgqkedcnbdUSkBd4G7wKB7vcpEKcsOQUuToAImgPlP/8F6U NIB+JIEPgoYTH7EN7wh+BIOEz7gIUynHhUw6NTCK8VR0Vx5lvyi4ozaLiXj3TmchdLij ZVNQ== X-Gm-Message-State: AOJu0YxFB5TsaJx/GOaP8cynAz3LIHMKE9c7n80I3MdQHHN3gKY3HSzM jCHN290KW3L2dkFvelJWai0uKfr4v4y1SSNgRIgFxZ2qS3GTqLeoEiM8CZeT1w== X-Gm-Gg: AR+sD10cHGeC8x2QRGxyr7W/Teczg2RTITjRfDAevTjoGM4sX6fdUbPUN/h8l0d0n9Q 9uDw6pJuN3qBQzcnmWgfDy1A3m1kIVwvYu6cNkiFZ2xQPdX7XIIUab3ecInC2GFBIX71mpeNMzc YRkqtvdD9aC0Ac/jamb2eGhZCCCLtoPBcbV5Dr6ZurgHrUCZWaBDJ8QqB4oz3BxTQtva0cxfvQy Y00cO5kZc0NCT3O7RUTSarg84tButJOMU32TzhGMs2liEr3aU7/1hW6ATERq8wj82UimpmPhgOd ++APybjRGQQ1MmO7lEIHJRFBNgbDFbLUIgFoUzVxy5L68surOFxanlCtU76q3/HCrupx0q/dwrd URl/y1nAisKuSioZLNxZgPRna3GzCG5Ospnc0O79CBhoqaZKpYZmKTYg+psHWNBS88Atx3l+0IL ju0SiDgj6ZcP3GLVeWCa/Z4YlXF/a8z5hOUiNwuVtykY0hWl9I6TvvfAz/jDWzTqPenGbJ1VXMH x6GZ+89T69vqASAHTRuTCxcpf/UVzSeV0GcZtrf3nY= X-Received: by 2002:a17:903:2bcc:b0:2b2:67ca:5ff9 with SMTP id d9443c01a7336-2d0ca159fd7mr117233285ad.0.1785962285806; Wed, 05 Aug 2026 13:38:05 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:05 -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 3/6] hv_netvsc: Remove GPADL teardown special case for old Hyper-V hosts Date: Wed, 5 Aug 2026 13:37:48 -0700 Message-Id: <20260805203751.2678-4-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: quoted-printable Content-Type: text/plain; charset="utf-8" With the overall removal of Linux support for running on Hyper-V hosts earlier than WS2016 and Windows 10, the special case handling of GPADL teardown is no longer necessary. Remove it. Signed-off-by: Michael Kelley --- No changes in v2. drivers/net/hyperv/netvsc.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 4d319c50955e..4295b96b4312 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -695,17 +695,8 @@ void netvsc_device_remove(struct hv_device *device) =3D rtnl_dereference(net_device_ctx->nvdev); int i; =20 - /* - * Revoke receive buffer. If host is pre-Win2016 then tear down - * receive buffer GPADL. Do the same for send buffer. - */ netvsc_revoke_recv_buf(device, net_device, ndev); - if (vmbus_proto_version < VERSION_WIN10) - netvsc_teardown_recv_gpadl(device, net_device, ndev); - netvsc_revoke_send_buf(device, net_device, ndev); - if (vmbus_proto_version < VERSION_WIN10) - netvsc_teardown_send_gpadl(device, net_device, ndev); =20 RCU_INIT_POINTER(net_device_ctx->nvdev, NULL); =20 @@ -733,14 +724,9 @@ void netvsc_device_remove(struct hv_device *device) /* Now, we can close the channel safely */ vmbus_close(device->channel); =20 - /* - * If host is Win2016 or higher then we do the GPADL tear down - * here after VMBus is closed. - */ - if (vmbus_proto_version >=3D VERSION_WIN10) { - netvsc_teardown_recv_gpadl(device, net_device, ndev); - netvsc_teardown_send_gpadl(device, net_device, ndev); - } + /* Must do the GPADL teardown after channel is closed */ + netvsc_teardown_recv_gpadl(device, net_device, ndev); + netvsc_teardown_send_gpadl(device, net_device, ndev); =20 /* Release all resources */ free_netvsc_device_rcu(net_device); --=20 2.25.1 From nobody Wed Aug 26 20:42:01 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 46D7942A15E for ; Wed, 5 Aug 2026 20:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962288; cv=none; b=C4FookhSr6Y22J0pnvp0W7N0XsDMz6DzZ76zmqNFheWErgWKzrErsZp4q1D6vuSfUoqCdWXGqkCICd9seuEbV4n5Lhr/gC1kzo157OR+a5g3fz6PbsrjcW73NiO4LcdujqA6p8bwH5vNwkztDZ+is+UBzkJ0j543Z38AhMqO46o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962288; c=relaxed/simple; bh=OopqtCN07oGoAKRVAQGlfvHRqLwfc1UdFt9BvhOiS3c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C8CrqZeEgaAjM9QZNuHDSgWpNm9TftyRHkYHBS5/Pijs6TWqCjOT0YdZDwgrbHzhTFAlmFE0Xlcu+/xxYE7AhVm9wRa2jHFG22I+AgJUgGHW+ElRA8NMQuhyjsmujR2SPrKHXh6KW70Fq+Mj8pygOreR+X0kqoap6ySV8WdbTnI= 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=hmiRGE3n; arc=none smtp.client-ip=209.85.214.178 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="hmiRGE3n" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2cace91f112so18025465ad.0 for ; Wed, 05 Aug 2026 13:38:07 -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=EdXY5/YY8vIPrZPChiWbr/RXKcHFj1ccguOM8+h3l00=; b=hmiRGE3nlfqYjKTtNGLiXlyTo7vpREGL5NvNYUMNxQjEE9ESa+nz3tlRrJAuoxqos+ +itGkjqzegbkHWG+Ebans7mZ4mbqQJXX/+3jFH9wdJPwWSgSfUcCUJ+vQueTJQKmdf7r sUJcvQ7iQST7goziRmUQKc4baKj2fxamgqI2lnEM15FgiHGpSp5cuKuJvfGVqchnIC3X FgSIFQ4hLoLfhtd2guecPMoVM9KyFCQ2WwXlk1w8umPsGfoKWrtwS7jcnKJ+iLnxcMRs amfcAoI+kRfkxGNbd0b7BUIdjA2gLHtNtyr9NLz4hSsOZHmiw/X3yfsldBRqeWEX7Aj0 0PVg== 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=EdXY5/YY8vIPrZPChiWbr/RXKcHFj1ccguOM8+h3l00=; b=ZgqWu8mG84qPMmkDuLmFnoO3dz2h53y84uniinchOphaFtVBpGTUqC6PdPq3T/25eJ pvunGFSKiqK4YWTuAkyCCCZqmRyM4hsoVE6/t5gAxq+5z2WVYjO5pSzshenHhixpcRv/ UNMN9BYhI1Q3dlAdzhSHZUZa2oBt36vgBQzAViZJXlZvtOu06LTsWtiHBSSmnW/P2z8j vN9NxHZQOj8Kd+sXXzof11Xr0boeCQ+6XrHyQELgRVygIZ2PLT7zt0DtEGr+OUPiseX/ ZfDJ0bsywHIHWWjfWzcx4J8alKYSpo4Gz9KEksBVKMt8aC5dK7m7zDBuCLlCJwgn9Wg3 8frQ== X-Gm-Message-State: AOJu0YyiQLzb4/l/2pNOn02X4CeF4FUeWCNUG5lQxTlkCi8AbrYWp+nO juYOss2Wg2NFh6JW5LoeYXRrNqZ2+Bfp06ssxvtH+RPFZK8PGPFE9n/z X-Gm-Gg: AR+sD10F7+5fKlxr8GBhVhQGa51SKn/fW4JnEgLQ0S/Y6ZnZtwH47l7gOeA4c3XM7Pg P9i0C6wYFi5FPZlarI0pLtQpYSfCy7KluoElgiafhnQWGrRYf/IZqisdPdrzahvuLhM7UOu0TTA 3o1cDnn+4nuVuYG7jmkBMYsnyZKdoxulX4acav26I8d3ys4VzelYhLiaGxXd0zwqFFfYtWRM6Sw 4gXN5oiImHuh9IeEapl2Bu7eqNkb1cIDimkuZgeZ+F4g9K/42ixqaD5NlmW3xarZOGIW8+Gxsgn nAVtHMEWZkuvNBTNP9XYsrrCWtldlXtHfwtv3y7CUy4Jc/PXPdty7tQwfSzSe7fn7T7Je3POODA rr4b3sKfKEUlNCABwSjxYh3rIMSDMN8R0O8n7sJOIn4sqaZYdIS65rB8x5Gdm38MAcB3uD/GRf5 QsSRXsH1Sz90pva2q0xelV6uvK/Bmgkk2ebnkZFChaAPdlr1gUWRByz/3yh6lmKUtTG2SwzDUDP ogPhE2ZMoiOSLWGoAkpg/+PomPpAUWfi5wM2hctQSftawMtN4uH7vk= X-Received: by 2002:a17:902:d2c9:b0:2cf:b330:e0e8 with SMTP id d9443c01a7336-2d0ca7599d6mr97124445ad.10.1785962286684; Wed, 05 Aug 2026 13:38:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:06 -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 4/6] drm_hyperv: Remove support for synth video protocol of old Hyper-V hosts Date: Wed, 5 Aug 2026 13:37:49 -0700 Message-Id: <20260805203751.2678-5-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 synthetic video protocols. Remove the support. Signed-off-by: Michael Kelley --- Changes in v2: * Removed now unused function hv_drm_version_ge() and field synthvid_version. While it's posssible that these might be needed again if a new synthetic frame buffer protocol version is introduced, my sense is that this is not an area of active development on the Hyper-V side, so a new protocol version is less likely. The function/field can be added back when/if needed. [Sashiko] drivers/gpu/drm/hyperv/hyperv_drm.h | 1 - drivers/gpu/drm/hyperv/hyperv_drm_proto.c | 44 ++++++----------------- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/hyperv/hyperv_drm.h b/drivers/gpu/drm/hyperv/h= yperv_drm.h index 78136ec2c2f4..29e6f54af15f 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm.h +++ b/drivers/gpu/drm/hyperv/hyperv_drm.h @@ -29,7 +29,6 @@ struct hv_drm_device { unsigned long fb_base; unsigned long fb_size; struct completion wait; - u32 synthvid_version; u32 mmio_megabytes; bool dirt_needed; =20 diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c b/drivers/gpu/drm/hy= perv/hyperv_drm_proto.c index f0ef627b4898..1d09bba1efdd 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_proto.c @@ -17,7 +17,7 @@ #define SYNTHVID_VER_GET_MAJOR(ver) (ver & 0x0000ffff) #define SYNTHVID_VER_GET_MINOR(ver) ((ver & 0xffff0000) >> 16) =20 -/* Support for VERSION_WIN7 is removed. #define is retained for reference.= */ +/* Support for WIN7 and WIN8 is removed. #define's retained for reference.= */ #define SYNTHVID_VERSION_WIN7 SYNTHVID_VERSION(3, 0) #define SYNTHVID_VERSION_WIN8 SYNTHVID_VERSION(3, 2) #define SYNTHVID_VERSION_WIN10 SYNTHVID_VERSION(3, 5) @@ -181,16 +181,6 @@ struct synthvid_msg { }; } __packed; =20 -static inline bool hv_drm_version_ge(u32 ver1, u32 ver2) -{ - if (SYNTHVID_VER_GET_MAJOR(ver1) > SYNTHVID_VER_GET_MAJOR(ver2) || - (SYNTHVID_VER_GET_MAJOR(ver1) =3D=3D SYNTHVID_VER_GET_MAJOR(ver2) && - SYNTHVID_VER_GET_MINOR(ver1) >=3D SYNTHVID_VER_GET_MINOR(ver2))) - return true; - - return false; -} - static inline int hv_drm_sendpacket(struct hv_device *hdev, struct synthvi= d_msg *msg) { static atomic64_t request_id =3D ATOMIC64_INIT(0); @@ -236,7 +226,6 @@ static int hv_drm_negotiate_version(struct hv_device *h= dev, u32 ver) return -ENODEV; } =20 - hv->synthvid_version =3D ver; drm_info(dev, "Synthvid Version major %d, minor %d\n", SYNTHVID_VER_GET_MAJOR(ver), SYNTHVID_VER_GET_MINOR(ver)); =20 @@ -557,23 +546,12 @@ int hv_drm_connect_vsp(struct hv_device *hdev) return ret; } =20 - /* Negotiate the protocol version with host */ - switch (vmbus_proto_version) { - case VERSION_WIN10: - case VERSION_WIN10_V5: - ret =3D hv_drm_negotiate_version(hdev, SYNTHVID_VERSION_WIN10); - if (!ret) - break; - fallthrough; - case VERSION_WIN8: - case VERSION_WIN8_1: - ret =3D hv_drm_negotiate_version(hdev, SYNTHVID_VERSION_WIN8); - break; - default: - ret =3D hv_drm_negotiate_version(hdev, SYNTHVID_VERSION_WIN10); - break; - } - + /* + * Negotiate the protocol version with host. Since support for hosts + * older than WIN10 has been removed from Linux, only negotiate the + * WIN10 version. + */ + ret =3D hv_drm_negotiate_version(hdev, SYNTHVID_VERSION_WIN10); if (ret) { drm_err(dev, "Synthetic video device version not accepted %d\n", ret); goto error; @@ -581,11 +559,9 @@ int hv_drm_connect_vsp(struct hv_device *hdev) =20 hv->screen_depth =3D SYNTHVID_DEPTH_WIN8; =20 - if (hv_drm_version_ge(hv->synthvid_version, SYNTHVID_VERSION_WIN10)) { - ret =3D hv_drm_get_supported_resolution(hdev); - if (ret) - drm_err(dev, "Failed to get supported resolution from host, use default= \n"); - } + ret =3D hv_drm_get_supported_resolution(hdev); + if (ret) + drm_err(dev, "Failed to get supported resolution from host, use default\= n"); =20 if (!hv->screen_width_max) { hv->screen_width_max =3D SYNTHVID_WIDTH_WIN8; --=20 2.25.1 From nobody Wed Aug 26 20:42:01 2026 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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. */ =20 #define VMSTOR_PROTO_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \ @@ -218,7 +224,6 @@ struct vmscsi_request { static const int protocol_version[] =3D { VMSTOR_PROTO_VERSION_WIN10, VMSTOR_PROTO_VERSION_WIN8_1, - VMSTOR_PROTO_VERSION_WIN8, }; =20 =20 @@ -1601,13 +1606,12 @@ static int storvsc_sdev_configure(struct scsi_devic= e *sdevice, sdevice->no_write_same =3D 1; =20 /* - * 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 =3D 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; } =20 -static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) -{ - bool allowed =3D true; - u8 scsi_op =3D 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 =3D 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(stru= ct Scsi_Host *host, u32 payload_sz; u32 length; =20 - if (vmstor_proto_version <=3D 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 =3D scmnd; =20 --=20 2.25.1 From nobody Wed Aug 26 20:42:01 2026 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 2596E47CC9C for ; Wed, 5 Aug 2026 20:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962291; cv=none; b=YQVtqV3VcGxjmxCFyJT2zmPy/u+YFkIpIQOitfadN8kgrOj2t6nMwrHdKF8TZ7X8YVFGAAh/5Qpv+9vH+Wc2Es8JgNHG/n5K/Q747UxiNMYTQZyB5H31+hP5IWOCUDF5AhodBl1Uv+PmKrP4vSkQtv4G+MRm/NbrUXPkSDCTRDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962291; c=relaxed/simple; bh=fXiqre4LsvEVRdwowGCqoYFCT02VztqtYAm1vXZBZx4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=h3eG0brzwubE2HoUTZCTi6L3IaHXz1Qregl5RqNMAlggP7aTpfID5rJ3sHLGHUBXRfnNhd1XcGnrdyTALtE8qvBREQK607eDK3l7GWvVvuv54gSiXO+q7FIdJjsoPT/uMYKpbwTzYCq3Ixj8Y9du9aFmejbHgR0ovK7qCoYA0do= 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=F0Iloh1D; arc=none smtp.client-ip=209.85.214.180 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="F0Iloh1D" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2cea3004256so18282195ad.0 for ; Wed, 05 Aug 2026 13:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962288; x=1786567088; 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=s3REC5jWXLnZosl7bVOoAJ3BcM3iaHGDbO/iwGWWlCA=; b=F0Iloh1D2KxbguX4xE94bt4wAv464mwaorLcgJ94MC/vJka20Si2PHLFTunCl99AO7 jUQ2E3IbODSJ5VQ/RDD9rwxic/tyxd2mgexrYISp+4V9EzN+NSvOl/Pvza8+RQmie6EB nHutWdYxDIOtmnLIZ7QelbtzqDCmv3qQk2KPUQT4ZuE4JtttSkdW9/1EQcg5MYrG61DX CS2vrrePgJE8Xone4WU0HoROKdbFJdQOl1TJnUmX7jhaaE6UP/OQNTbVdztdI5Ng4qWZ keYexaYJetUZfAQyrxacMAzakGPDZbqVEB5d8yWJ4qlr8ECJa1e+Cc2etlams4ZUKMtR ysMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962288; x=1786567088; 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=s3REC5jWXLnZosl7bVOoAJ3BcM3iaHGDbO/iwGWWlCA=; b=G84igm9AsuQOxTGC/MgPL9QNOZsUTOuHlRUqLtq8IR1kie5wJiWmg3fY9XGxrZ4VR8 Jqd2liq0Bnfe3vhovMlnwIn9jvFeGdvVNLcrsHk29drY0Mtn99RIG2iz/iYxZ5+Zp7m3 Sr7Pb8RzawNNWHxYqaUTZnYA0QhdkHaw7wy1dGer8N9iggC5Usn9pWad4yxaC6Lm/s+3 EONUgaaOOOvOh5nu33LePy2NHtuzCp5nv808NJcrqdm2WkrTbT7pQ7oDIyvA0V1e+aS4 NPJDjTf9pTCfKF0dPfqVJONFFwX5R5B+8FLXd+uAQJl47lsFueiwQZMuf+7QncjY8MFU 5eXg== X-Gm-Message-State: AOJu0Ywzd++6hbAGoap5MHtmYvNARJGIkBIUDofXBp8Bhe28rF5GFTiP 49mCXzOt2xtVMsyDLvD0Cy9nyd+D3nf5JI5C98QgVHOlZnnn/IbOUycr X-Gm-Gg: AR+sD11kFZXftf2//2Jug3BxSyAw2tOMQpFp+yWUjjKB8nQ+eQOgk2J59tKo7QL5oNi uiTJ2QQVlrufMXsF0T8kzPmDcFYytfPNBrF+wz/VV/uhWsvuwUov3uye0+QMT4s3BWgELKNpYP1 hY7D8mfeIB6zteyl2BUo4Gw8jtvN5IxrirzYWnSNY2eT4dIUz75ed1aaAyxLWs6ccQCWJ0fmBwf ptMQWrqErY5TkUPzGZfRUbywH0AS7YIO3ph9ZtCKF0KKWgVChQl6/gAd3GQU21DygrbMF3kge+b zo6Z6Pbi+6j9aikm21E5wOoRZmAwlVfASF96ykM+zR0KUb+hBcqihXPoW607TNsyrnTpsklN3DA 2NWTQs0v8kWWVM+ZC35RHW68VatpI5GgRBJ6YtX0MhAeFEmMC0Kc1IlFn+//50daDlk2HNq4zhI e2vIREqqCtwKeHZoASEuXta/scChEo9AV8O24FlApR20YBY1gApE+Fkh7TyccD2h8paVZz8f75r 5bLYGXLOp8uIWBDtYCRLjEdL3wHBnJSEmMSYczgZWU= X-Received: by 2002:a17:902:cec1:b0:2ca:1bd2:d57b with SMTP id d9443c01a7336-2d0ca16569bmr99897465ad.0.1785962288357; Wed, 05 Aug 2026 13:38:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 13:38:08 -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 6/6] clocksource: hyper-v: Remove support for stimer interrupts in message mode Date: Wed, 5 Aug 2026 13:37:51 -0700 Message-Id: <20260805203751.2678-7-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: quoted-printable Content-Type: text/plain; charset="utf-8" In Hyper-V versions prior to WS2016/Win10, Hyper-V synthetic timers interrupt the guest by delivering a message that is initially handled by the Linux VMBus driver. Starting with WS2016/Win10, Hyper-V can deliver stimer interrupts directly to an assigned interrupt vector without involving the VMBus driver. This is called "Direct Mode". 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 the legacy message-based delivery. Remove that delivery mechanism and always use Direct Mode. If for some reason, the Hyper-V host does not enumerate Direct Mode, output an error message but continue to run using the LAPIC timer instead of an stimer. With these changes, the VMBus driver no longer calls the stimer interrupt service routine. This removal has a broader benefit in unblocking the disentangling of VMBus code and stimer code, as they should be independent of each other. The final disentangling will come as a follow-on patch set. Signed-off-by: Michael Kelley --- No changes in v2. arch/x86/hyperv/hv_init.c | 17 ++-- arch/x86/kernel/cpu/mshyperv.c | 4 +- drivers/clocksource/hyperv_timer.c | 150 ++++------------------------- drivers/hv/hv.c | 4 - drivers/hv/vmbus_drv.c | 10 +- include/clocksource/hyperv_timer.h | 6 -- 6 files changed, 32 insertions(+), 159 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 55a8b6de2865..0b4a1c0b0b16 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -171,8 +171,7 @@ static int hv_cpu_init(unsigned int cpu) } =20 /* Allow Hyper-V stimer vector to be injected from Hypervisor. */ - if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) - apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, true); + apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, true); =20 return hyperv_init_ghcb(); } @@ -281,8 +280,7 @@ static int hv_cpu_die(unsigned int cpu) *ghcb_va =3D NULL; } =20 - if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) - apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, false); + apic_update_vector(cpu, HYPERV_STIMER0_VECTOR, false); =20 hv_common_cpu_die(cpu); =20 @@ -425,15 +423,18 @@ static void (* __initdata old_setup_percpu_clockev)(v= oid); =20 static void __init hv_stimer_setup_percpu_clockev(void) { + int ret; + /* - * Ignore any errors in setting up stimer clockevents + * Continue afters errors in setting up stimer clockevents * as we can run with the LAPIC timer as a fallback. */ - (void)hv_stimer_alloc(false); + ret =3D hv_stimer_alloc(false); + if (ret) + pr_warn("stimer setup failed with error %d\n", ret); =20 /* - * Still register the LAPIC timer, because the direct-mode STIMER is - * not supported by old versions of Hyper-V. This also allows users + * Still register the LAPIC timer to allows users * to switch to LAPIC timer via /sys, if they want to. */ if (old_setup_percpu_clockev) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 185d4f677ec0..f62319b73c20 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -716,9 +716,7 @@ static void __init ms_hyperv_init_platform(void) } =20 /* Install system interrupt handler for stimer0 */ - if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) { - sysvec_install(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0); - } + sysvec_install(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0); =20 # ifdef CONFIG_SMP smp_ops.smp_prepare_boot_cpu =3D hv_smp_prepare_boot_cpu; diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyper= v_timer.c index df567795d175..dddfff458ebf 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -31,44 +31,20 @@ static struct clock_event_device __percpu *hv_clock_eve= nt; /* Note: offset can hold negative values after hibernation. */ static u64 hv_sched_clock_offset __read_mostly; =20 -/* - * If false, we're using the old mechanism for stimer0 interrupts - * where it sends a VMbus message when it expires. The old - * mechanism is used when running on older versions of Hyper-V - * that don't support Direct Mode. While Hyper-V provides - * four stimer's per CPU, Linux uses only stimer0. - * - * Because Direct Mode does not require processing a VMbus - * message, stimer interrupts can be enabled earlier in the - * process of booting a CPU, and consistent with when timer - * interrupts are enabled for other clocksource drivers. - * However, for legacy versions of Hyper-V when Direct Mode - * is not enabled, setting up stimer interrupts must be - * delayed until VMbus is initialized and can process the - * interrupt message. - */ -static bool direct_mode_enabled; - static int stimer0_irq =3D -1; -static int stimer0_message_sint; static __maybe_unused DEFINE_PER_CPU(long, stimer0_evt); =20 -/* - * Common code for stimer0 interrupts coming via Direct Mode or - * as a VMbus message. - */ -void hv_stimer0_isr(void) +static void hv_stimer0_isr(void) { struct clock_event_device *ce; =20 ce =3D this_cpu_ptr(hv_clock_event); ce->event_handler(ce); } -EXPORT_SYMBOL_GPL(hv_stimer0_isr); =20 /* * stimer0 interrupt handler for architectures that support - * per-cpu interrupts, which also implies Direct Mode. + * per-cpu interrupts */ static irqreturn_t __maybe_unused hv_stimer0_percpu_isr(int irq, void *dev= _id) { @@ -91,7 +67,7 @@ static int hv_ce_shutdown(struct clock_event_device *evt) { hv_set_msr(HV_MSR_STIMER0_COUNT, 0); hv_set_msr(HV_MSR_STIMER0_CONFIG, 0); - if (direct_mode_enabled && stimer0_irq >=3D 0) + if (stimer0_irq >=3D 0) disable_percpu_irq(stimer0_irq); =20 return 0; @@ -104,23 +80,16 @@ static int hv_ce_set_oneshot(struct clock_event_device= *evt) timer_cfg.as_uint64 =3D 0; timer_cfg.enable =3D 1; timer_cfg.auto_enable =3D 1; - if (direct_mode_enabled) { - /* - * When it expires, the timer will directly interrupt - * on the specified hardware vector/IRQ. - */ - timer_cfg.direct_mode =3D 1; - timer_cfg.apic_vector =3D HYPERV_STIMER0_VECTOR; - if (stimer0_irq >=3D 0) - enable_percpu_irq(stimer0_irq, IRQ_TYPE_NONE); - } else { - /* - * When it expires, the timer will generate a VMbus message, - * to be handled by the normal VMbus interrupt handler. - */ - timer_cfg.direct_mode =3D 0; - timer_cfg.sintx =3D stimer0_message_sint; - } + + /* + * When it expires, the timer will directly interrupt + * on the specified hardware vector/IRQ. + */ + timer_cfg.direct_mode =3D 1; + timer_cfg.apic_vector =3D HYPERV_STIMER0_VECTOR; + if (stimer0_irq >=3D 0) + enable_percpu_irq(stimer0_irq, IRQ_TYPE_NONE); + hv_set_msr(HV_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); return 0; } @@ -175,25 +144,8 @@ int hv_stimer_cleanup(unsigned int cpu) if (!hv_clock_event) return 0; =20 - /* - * In the legacy case where Direct Mode is not enabled - * (which can only be on x86/64), stimer cleanup happens - * relatively early in the CPU offlining process. We - * must unbind the stimer-based clockevent device so - * that the LAPIC timer can take over until clockevents - * are no longer needed in the offlining process. Note - * that clockevents_unbind_device() eventually calls - * hv_ce_shutdown(). - * - * The unbind should not be done when Direct Mode is - * enabled because we may be on an architecture where - * there are no other clockevent devices to fallback to. - */ ce =3D per_cpu_ptr(hv_clock_event, cpu); - if (direct_mode_enabled) - hv_ce_shutdown(ce); - else - clockevents_unbind_device(ce, cpu); + hv_ce_shutdown(ce); =20 return 0; } @@ -268,23 +220,14 @@ int hv_stimer_alloc(bool have_percpu_irqs) * Hyper-V on x86. In that case, return as error as Linux will use a * clockevent based on emulated LAPIC timer hardware. */ - if (!(ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE)) + if (!(ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) || + !(ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE)) return -EINVAL; =20 hv_clock_event =3D alloc_percpu(struct clock_event_device); if (!hv_clock_event) return -ENOMEM; =20 - direct_mode_enabled =3D ms_hyperv.misc_features & - HV_STIMER_DIRECT_MODE_AVAILABLE; - - /* - * If Direct Mode isn't enabled, the remainder of the initialization - * is done later by hv_stimer_legacy_init() - */ - if (!direct_mode_enabled) - return 0; - if (have_percpu_irqs) { ret =3D hv_setup_stimer0_irq(); if (ret) @@ -293,11 +236,6 @@ int hv_stimer_alloc(bool have_percpu_irqs) hv_setup_stimer0_handler(hv_stimer0_isr); } =20 - /* - * Since we are in Direct Mode, stimer initialization - * can be done now with a CPUHP value in the same range - * as other clockevent devices. - */ ret =3D cpuhp_setup_state(CPUHP_AP_HYPERV_TIMER_STARTING, "clockevents/hyperv/stimer:starting", hv_stimer_init, hv_stimer_cleanup); @@ -314,67 +252,19 @@ int hv_stimer_alloc(bool have_percpu_irqs) } EXPORT_SYMBOL_GPL(hv_stimer_alloc); =20 -/* - * hv_stimer_legacy_init -- Called from the VMbus driver to handle - * the case when Direct Mode is not enabled, and the stimer - * must be initialized late in the CPU onlining process. - * - */ -void hv_stimer_legacy_init(unsigned int cpu, int sint) -{ - if (direct_mode_enabled) - return; - - /* - * This function gets called by each vCPU, so setting the - * global stimer_message_sint value each time is conceptually - * not ideal, but the value passed in is always the same and - * it avoids introducing yet another interface into this - * clocksource driver just to set the sint in the legacy case. - */ - stimer0_message_sint =3D sint; - (void)hv_stimer_init(cpu); -} -EXPORT_SYMBOL_GPL(hv_stimer_legacy_init); - -/* - * hv_stimer_legacy_cleanup -- Called from the VMbus driver to - * handle the case when Direct Mode is not enabled, and the - * stimer must be cleaned up early in the CPU offlining - * process. - */ -void hv_stimer_legacy_cleanup(unsigned int cpu) -{ - if (direct_mode_enabled) - return; - (void)hv_stimer_cleanup(cpu); -} -EXPORT_SYMBOL_GPL(hv_stimer_legacy_cleanup); - /* * Do a global cleanup of clockevents for the cases of kexec and * vmbus exit */ void hv_stimer_global_cleanup(void) { - int cpu; - - /* - * hv_stime_legacy_cleanup() will stop the stimer if Direct - * Mode is not enabled, and fallback to the LAPIC timer. - */ - for_each_present_cpu(cpu) { - hv_stimer_legacy_cleanup(cpu); - } - if (!hv_clock_event) return; =20 - if (direct_mode_enabled) { - cpuhp_remove_state(CPUHP_AP_HYPERV_TIMER_STARTING); - hv_remove_stimer0_irq(); - stimer0_irq =3D -1; - } + cpuhp_remove_state(CPUHP_AP_HYPERV_TIMER_STARTING); + hv_remove_stimer0_irq(); + stimer0_irq =3D -1; + free_percpu(hv_clock_event); hv_clock_event =3D NULL; =20 diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index ef4b1b03395d..fe50090dcc01 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -399,8 +399,6 @@ int hv_synic_init(unsigned int cpu) else hv_hyp_synic_enable_interrupts(); =20 - hv_stimer_legacy_init(cpu, VMBUS_MESSAGE_SINT); - return 0; } =20 @@ -630,8 +628,6 @@ int hv_synic_cleanup(unsigned int cpu) return -EBUSY; =20 always_cleanup: - hv_stimer_legacy_cleanup(cpu); - /* * First, disable the event and message pages * used for communicating with the host, and then diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 6824bd7cb3c4..e19ec73b0187 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1320,14 +1320,8 @@ static void vmbus_message_sched(struct hv_per_cpu_co= ntext *hv_cpu, void *message msg =3D (struct hv_message *)message_page_addr + VMBUS_MESSAGE_SINT; =20 /* Check if there are actual msgs to be processed */ - if (msg->header.message_type !=3D HVMSG_NONE) { - if (msg->header.message_type =3D=3D HVMSG_TIMER_EXPIRED) { - hv_stimer0_isr(); - vmbus_signal_eom(msg, HVMSG_TIMER_EXPIRED); - } else { - tasklet_schedule(&hv_cpu->msg_dpc); - } - } + if (msg->header.message_type !=3D HVMSG_NONE) + tasklet_schedule(&hv_cpu->msg_dpc); } =20 static void __vmbus_isr(void) diff --git a/include/clocksource/hyperv_timer.h b/include/clocksource/hyper= v_timer.h index d48dd4176fd3..8d3befb7e667 100644 --- a/include/clocksource/hyperv_timer.h +++ b/include/clocksource/hyperv_timer.h @@ -27,10 +27,7 @@ /* Routines called by the VMbus driver */ extern int hv_stimer_alloc(bool have_percpu_irqs); extern int hv_stimer_cleanup(unsigned int cpu); -extern void hv_stimer_legacy_init(unsigned int cpu, int sint); -extern void hv_stimer_legacy_cleanup(unsigned int cpu); extern void hv_stimer_global_cleanup(void); -extern void hv_stimer0_isr(void); =20 extern void hv_init_clocksource(void); extern void hv_remap_tsc_clocksource(void); @@ -107,10 +104,7 @@ hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page *= tsc_pg, u64 *cur_tsc, u64 } =20 static inline int hv_stimer_cleanup(unsigned int cpu) { return 0; } -static inline void hv_stimer_legacy_init(unsigned int cpu, int sint) {} -static inline void hv_stimer_legacy_cleanup(unsigned int cpu) {} static inline void hv_stimer_global_cleanup(void) {} -static inline void hv_stimer0_isr(void) {} =20 #endif /* CONFIG_HYPERV_TIMER */ =20 --=20 2.25.1