From nobody Mon Feb 9 01:21:26 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 849162BEFEE; Mon, 26 Jan 2026 20:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769460966; cv=none; b=SYPhS95ZNpMcWd76AKA7130h+rgsBO9qnTaoYzojV8DlO9XxhqfW3PKSzPK+DCpcd6sndY+SfGwrzwnh+ssuPAhuCZQgIhFk9MD/cWNzaQyQKZMLXOkmNWc1gXox663hY6zwanrt/OjW6qka9g/W8wKnDCQWdw9Z9kyAP8zBegA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769460966; c=relaxed/simple; bh=L4E1wo8/6fKvJEozXW8vtzU2hTEpjK6jREA7Bfv0oJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TDIERa/BvB4HDaU2NOj5w4VIUnZw5nh8u9YFuZugN5u5TlYl4gZOovlajRocrTOHNAtyKNba9LObib7b/WoIN4DFOR5yjImIrVCsbwJIyuP0ae90rQxfkstCtbfXQU4k4LZ33/+bZAIWodbIWs13BrBS0LWL3JprqE2EgUn94u4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=ZiC1QIBo; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="ZiC1QIBo" Received: by linux.microsoft.com (Postfix, from userid 1032) id 8D8D020B716A; Mon, 26 Jan 2026 12:56:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8D8D020B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1769460965; bh=uE6yNFSdJktjcXi31tIk+NXAAyXVgXT3CJcMYC5oQGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiC1QIBowXMMXqmbZiZiHJK8UN+hnot+SN9WjOdm9gIdMjTDKvP8GXSuLhGcfsKPK lJOF4ugfHNbeenje8b64EbtYq44ByJmgW+mFlXeF4errb+QCEX/XgM6xaeD4uSD3Pg ycHBp5FDPK6w5hDe/vEHo+ODpCQBxfeVZLRR4m5c= From: Nuno Das Neves To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, mhklinux@outlook.com, skinsburskii@linux.microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, prapal@linux.microsoft.com, mrathor@linux.microsoft.com, paekkaladevi@linux.microsoft.com, Nuno Das Neves Subject: [PATCH v5 4/7] mshv: Always map child vp stats pages regardless of scheduler type Date: Mon, 26 Jan 2026 12:56:00 -0800 Message-ID: <20260126205603.404655-5-nunodasneves@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260126205603.404655-1-nunodasneves@linux.microsoft.com> References: <20260126205603.404655-1-nunodasneves@linux.microsoft.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" From: Stanislav Kinsburskii Currently vp->vp_stats_pages is only used by the root scheduler for fast interrupt injection. Soon, vp_stats_pages will also be needed for exposing child VP stats to userspace via debugfs. Mapping the pages a second time to a different address causes an error on L1VH. Remove the scheduler requirement and always map the vp stats pages. Signed-off-by: Stanislav Kinsburskii Signed-off-by: Nuno Das Neves --- drivers/hv/mshv_root_main.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index faca3cc63e79..fbfc9e7d9fa4 100644 --- a/drivers/hv/mshv_root_main.c +++ b/drivers/hv/mshv_root_main.c @@ -1077,16 +1077,10 @@ mshv_partition_ioctl_create_vp(struct mshv_partitio= n *partition, goto unmap_register_page; } =20 - /* - * This mapping of the stats page is for detecting if dispatch thread - * is blocked - only relevant for root scheduler - */ - if (hv_scheduler_type =3D=3D HV_SCHEDULER_TYPE_ROOT) { - ret =3D mshv_vp_stats_map(partition->pt_id, args.vp_index, - stats_pages); - if (ret) - goto unmap_ghcb_page; - } + ret =3D mshv_vp_stats_map(partition->pt_id, args.vp_index, + stats_pages); + if (ret) + goto unmap_ghcb_page; =20 vp =3D kzalloc(sizeof(*vp), GFP_KERNEL); if (!vp) @@ -1110,8 +1104,7 @@ mshv_partition_ioctl_create_vp(struct mshv_partition = *partition, if (mshv_partition_encrypted(partition) && is_ghcb_mapping_available()) vp->vp_ghcb_page =3D page_to_virt(ghcb_page); =20 - if (hv_scheduler_type =3D=3D HV_SCHEDULER_TYPE_ROOT) - memcpy(vp->vp_stats_pages, stats_pages, sizeof(stats_pages)); + memcpy(vp->vp_stats_pages, stats_pages, sizeof(stats_pages)); =20 /* * Keep anon_inode_getfd last: it installs fd in the file struct and @@ -1133,8 +1126,7 @@ mshv_partition_ioctl_create_vp(struct mshv_partition = *partition, free_vp: kfree(vp); unmap_stats_pages: - if (hv_scheduler_type =3D=3D HV_SCHEDULER_TYPE_ROOT) - mshv_vp_stats_unmap(partition->pt_id, args.vp_index, stats_pages); + mshv_vp_stats_unmap(partition->pt_id, args.vp_index, stats_pages); unmap_ghcb_page: if (mshv_partition_encrypted(partition) && is_ghcb_mapping_available()) hv_unmap_vp_state_page(partition->pt_id, args.vp_index, @@ -1754,9 +1746,8 @@ static void destroy_partition(struct mshv_partition *= partition) if (!vp) continue; =20 - if (hv_scheduler_type =3D=3D HV_SCHEDULER_TYPE_ROOT) - mshv_vp_stats_unmap(partition->pt_id, vp->vp_index, - vp->vp_stats_pages); + mshv_vp_stats_unmap(partition->pt_id, vp->vp_index, + vp->vp_stats_pages); =20 if (vp->vp_register_page) { (void)hv_unmap_vp_state_page(partition->pt_id, --=20 2.34.1