Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2231630/?format=api
{ "id": 2231630, "url": "http://patchwork.ozlabs.org/api/patches/2231630/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-12-mrathor@linux.microsoft.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260501004157.3108202-12-mrathor@linux.microsoft.com>", "list_archive_url": null, "date": "2026-05-01T00:41:57", "name": "[V2,11/11] mshv: Mark mem regions as non-movable upfront if device passthru", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "425bdbd281b72b18db2984a00447b8c992f6bddc", "submitter": { "id": 91512, "url": "http://patchwork.ozlabs.org/api/people/91512/?format=api", "name": "Mukesh R", "email": "mrathor@linux.microsoft.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-12-mrathor@linux.microsoft.com/mbox/", "series": [ { "id": 502410, "url": "http://patchwork.ozlabs.org/api/series/502410/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=502410", "date": "2026-05-01T00:41:46", "name": "PCI passthru on Hyper-V (Part I)", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502410/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231630/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231630/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-53568-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com\n header.a=rsa-sha256 header.s=default header.b=EONvDO0s;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-53568-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.microsoft.com\n header.i=@linux.microsoft.com header.b=\"EONvDO0s\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=13.77.154.182", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.microsoft.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.microsoft.com" ], "Received": [ "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6C3Q1g40z1y1d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 10:44:18 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 3034F3016009\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 1 May 2026 00:43:22 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A83FD29E0FD;\n\tFri, 1 May 2026 00:42:33 +0000 (UTC)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D5553296BC8;\n\tFri, 1 May 2026 00:42:31 +0000 (UTC)", "from mrdev.corp.microsoft.com (unknown [40.86.183.173])\n\tby linux.microsoft.com (Postfix) with ESMTPSA id 1B8E720B716E;\n\tThu, 30 Apr 2026 17:42:31 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777596153; cv=none;\n b=RPZc6fsgyubjlP+HVk9uSWdsaRC5UKh2Y8Z7HeGbH7GkeNRfJM/qIKQHqf7632L3UBlirYHGR5p+KIincG6+5injEskGL/EaI0jqSRJ9rKy0k6DI8CxbWA6KbSKQaBnIEOPIlHzQH9pU7nGShIckmthHKDELSay30LwXxhOIP2o=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777596153; c=relaxed/simple;\n\tbh=mcU8SYICc38QiN8NqXflQT7TqsEN9UagRERq43TZdyQ=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=byXUuImcrW/B4dJHNe0LwdwVD5njxV9ZKlPTCssE4V2h4sK3umDdTnyYLt5iLPksYUq44U3kb5ER0cV7+eamudMPkqIUOfHHbeQefkxc1KsdHfD1pfQK9EzqNcZRKjac/0+lytbFUWmY7lShkeMAsy9gkCAqtgiYOrkPdnWOyNY=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.microsoft.com;\n spf=pass smtp.mailfrom=linux.microsoft.com;\n dkim=pass (1024-bit key) header.d=linux.microsoft.com\n header.i=@linux.microsoft.com header.b=EONvDO0s;\n arc=none smtp.client-ip=13.77.154.182", "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 1B8E720B716E", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n\ts=default; t=1777596152;\n\tbh=Tzlgjea1nxDXUDjkwgZNQOaBEUR7afZAQnfUGwI6GXc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=EONvDO0sMq/bqamsitYbZVI1KN0cT9vnSU35bbSD4wXN1iZt351G3xFD7AovMpBj8\n\t 4etmfKggNOlM5bJU0boUNAGpQGr+E7im55kyl/JMgQeamCH/sX1QnuICp4u8Gnb4na\n\t eIglW5V8rGG0kS79OBiRzkqxjcMko0p34kSkHwr8=", "From": "Mukesh R <mrathor@linux.microsoft.com>", "To": "hpa@zytor.com,\n\trobin.murphy@arm.com,\n\trobh@kernel.org,\n\twei.liu@kernel.org,\n\tmrathor@linux.microsoft.com,\n\tmhklinux@outlook.com,\n\tmuislam@microsoft.com,\n\tnamjain@linux.microsoft.com,\n\tmagnuskulke@linux.microsoft.com,\n\tanbelski@linux.microsoft.com,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-hyperv@vger.kernel.org,\n\tiommu@lists.linux.dev,\n\tlinux-pci@vger.kernel.org,\n\tlinux-arch@vger.kernel.org", "Cc": "kys@microsoft.com,\n\thaiyangz@microsoft.com,\n\tdecui@microsoft.com,\n\tlongli@microsoft.com,\n\ttglx@kernel.org,\n\tmingo@redhat.com,\n\tbp@alien8.de,\n\tdave.hansen@linux.intel.com,\n\tx86@kernel.org,\n\tjoro@8bytes.org,\n\twill@kernel.org,\n\tlpieralisi@kernel.org,\n\tkwilczynski@kernel.org,\n\tbhelgaas@google.com,\n\tarnd@arndb.de", "Subject": "[PATCH V2 11/11] mshv: Mark mem regions as non-movable upfront if\n device passthru", "Date": "Thu, 30 Apr 2026 17:41:57 -0700", "Message-ID": "<20260501004157.3108202-12-mrathor@linux.microsoft.com>", "X-Mailer": "git-send-email 2.51.2.vfs.0.1", "In-Reply-To": "<20260501004157.3108202-1-mrathor@linux.microsoft.com>", "References": "<20260501004157.3108202-1-mrathor@linux.microsoft.com>", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "If a VM is started with device attached, the mem regions must be marked\nnon-movable as the device attach hypercall right away allows the use of\nSLAT for IOMMU. Marking them non-movable forces mapping of the entire\nguest RAM in the SLAT at the time of region creation along with the\nregion pinned. Also, because a device could be dynamically attached\nmuch later in a VM, create a boot parameter to disable movable pages\nthat users can set if they anticipate such an action.\n\nSigned-off-by: Mukesh R <mrathor@linux.microsoft.com>\n---\n drivers/hv/mshv_root.h | 1 +\n drivers/hv/mshv_root_main.c | 15 ++++++++++++++-\n 2 files changed, 15 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/hv/mshv_root.h b/drivers/hv/mshv_root.h\nindex b9880d0bdc4d..d57c26950203 100644\n--- a/drivers/hv/mshv_root.h\n+++ b/drivers/hv/mshv_root.h\n@@ -141,6 +141,7 @@ struct mshv_partition {\n \tpid_t pt_vmm_tgid;\n \tbool import_completed;\n \tbool pt_initialized;\n+\tbool pt_regions_pinned;\n #if IS_ENABLED(CONFIG_DEBUG_FS)\n \tstruct dentry *pt_stats_dentry;\n \tstruct dentry *pt_vp_dentry;\ndiff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c\nindex a7864463961b..ac71534733bd 100644\n--- a/drivers/hv/mshv_root_main.c\n+++ b/drivers/hv/mshv_root_main.c\n@@ -49,6 +49,10 @@ MODULE_DESCRIPTION(\"Microsoft Hyper-V root partition VMM interface /dev/mshv\");\n static bool hv_nofull_mmio;\t/* don't map entire mmio region upon fault */\n module_param(hv_nofull_mmio, bool, 0644);\n \n+static bool hv_no_movbl_pgs;\t/* disable movable pages completely */\n+module_param(hv_no_movbl_pgs, bool, 0644);\n+MODULE_PARM_DESC(hv_no_movbl_pgs, \"If set, don't do movable pages for VMs\");\n+\n struct mshv_root mshv_root;\n \n enum hv_scheduler_type hv_scheduler_type;\n@@ -1303,6 +1307,12 @@ static void mshv_async_hvcall_handler(void *data, u64 *status)\n \t*status = partition->async_hypercall_status;\n }\n \n+static bool mshv_do_pt_regions_pinned(struct mshv_partition *pt)\n+{\n+\treturn pt->pt_regions_pinned || mshv_partition_encrypted(pt) ||\n+\t hv_no_movbl_pgs;\n+}\n+\n /*\n * NB: caller checks and makes sure mem->size is page aligned\n * Returns: 0 with regionpp updated on success, or -errno\n@@ -1333,7 +1343,7 @@ static int mshv_partition_create_region(struct mshv_partition *partition,\n \n \tif (is_mmio)\n \t\trg->mreg_type = MSHV_REGION_TYPE_MMIO;\n-\telse if (mshv_partition_encrypted(partition) ||\n+\telse if (mshv_do_pt_regions_pinned(partition) ||\n \t\t !mshv_region_movable_init(rg))\n \t\trg->mreg_type = MSHV_REGION_TYPE_MEM_PINNED;\n \telse\n@@ -1808,6 +1818,9 @@ static long mshv_partition_ioctl_create_device(struct mshv_partition *partition,\n \tif (copy_to_user(uarg, &devargk, sizeof(devargk)))\n \t\treturn -EFAULT; /* cleanup in mshv_device_fop_release() */\n \n+\t/* For now, all regions must be pinned if there is device passthru. */\n+\tpartition->pt_regions_pinned = true;\n+\n \treturn 0;\n \n undo_out:\n", "prefixes": [ "V2", "11/11" ] }