{"id":2231625,"url":"http://patchwork.ozlabs.org/api/patches/2231625/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-5-mrathor@linux.microsoft.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","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-5-mrathor@linux.microsoft.com>","list_archive_url":null,"date":"2026-05-01T00:41:50","name":"[V2,04/11] mshv: Declarations and definitions for VFIO-MSHV bridge device","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"0d641693ed4b26662ed6a2fb75e09631bf6353c6","submitter":{"id":91512,"url":"http://patchwork.ozlabs.org/api/people/91512/?format=json","name":"Mukesh R","email":"mrathor@linux.microsoft.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-5-mrathor@linux.microsoft.com/mbox/","series":[{"id":502410,"url":"http://patchwork.ozlabs.org/api/series/502410/?format=json","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/2231625/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231625/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-53562-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=gZNJ3KIr;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-53562-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=\"gZNJ3KIr\"","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 [172.232.135.74])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6C1q3s0bz1y1d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 10:42:55 +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 6D7EF30181BA\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 00:42:35 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 351FB2C0294;\n\tFri,  1 May 2026 00:42:18 +0000 (UTC)","from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 51C25274B2A;\n\tFri,  1 May 2026 00:42:15 +0000 (UTC)","from mrdev.corp.microsoft.com (unknown [40.86.183.173])\n\tby linux.microsoft.com (Postfix) with ESMTPSA id 0B23020B7175;\n\tThu, 30 Apr 2026 17:42:13 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777596138; cv=none;\n b=NRrX2vDX7wN+pDS4BAwGAEZEDruxYbpemhnXkCtFuFZet8zFBqMLmKGtkQNvInEpfUCu9xCRj79kKUS4PsnXD/ohDTGmyXv7TPik2EVtfgpp+g+PUjWOkVoPg16r9EX23IlW6sS+WE30LSmBtjN78CpB7UJlRopqhPYQk0mw43E=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777596138; c=relaxed/simple;\n\tbh=i7TTD4rbc9FHgT/PqRax2hCxSF14mcjnAspWxjiAQFI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Pe7zXjx/5zoj/aU4/Ck4VCKkMj3cMPk3H4wBA+haxQGsPqASDuNCEDSPMotidhkKk7g9EtVqrCX62pfyMINZvZk4aUtQ3f/CJy+mphnNPTgVIxgl4Ph08fr+vha0MkbMrHH4m1YzO9Y3Mwm34UFWJCij3lV8EP3KlO4PfSBb0VI=","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=gZNJ3KIr;\n arc=none smtp.client-ip=13.77.154.182","DKIM-Filter":"OpenDKIM Filter v2.11.0 linux.microsoft.com 0B23020B7175","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n\ts=default; t=1777596135;\n\tbh=tidzTRCfJneaHjA+fOlX3DgM/7vG+INZY/lk1h6owmY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gZNJ3KIrHIBUNDw3xlzlRd2by6ZLmwHIEgPm19cQF0wcUqS/oWugSnF7NPun4LxIh\n\t TTiMPEgr6BWvgZ2jZ/ZF3lEdN9mJsRuSJ6xK4zS9VWC3JRBLSUJTUrzdr2KGG7fH1H\n\t 6N7NOsD1XhcBqhmiRkjqjiT5NTP2pdjaOELszUW0=","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 04/11] mshv: Declarations and definitions for VFIO-MSHV\n bridge device","Date":"Thu, 30 Apr 2026 17:41:50 -0700","Message-ID":"<20260501004157.3108202-5-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":"Add data structs needed by the subsequent patch that introduces a new\nmodule to implement VFIO-MSHV pseudo device.\n\nSigned-off-by: Mukesh R <mrathor@linux.microsoft.com>\n---\n drivers/hv/mshv_root.h    | 19 +++++++++++++++++++\n include/uapi/linux/mshv.h | 30 ++++++++++++++++++++++++++++++\n 2 files changed, 49 insertions(+)","diff":"diff --git a/drivers/hv/mshv_root.h b/drivers/hv/mshv_root.h\nindex a85c24dcc701..b9880d0bdc4d 100644\n--- a/drivers/hv/mshv_root.h\n+++ b/drivers/hv/mshv_root.h\n@@ -227,6 +227,25 @@ struct port_table_info {\n \t};\n };\n \n+struct mshv_device {\n+\tconst struct mshv_device_ops *device_ops;\n+\tstruct mshv_partition *device_pt;\n+\tvoid *device_private;\n+\tstruct hlist_node device_ptnode;\n+};\n+\n+struct mshv_device_ops {\n+\tconst char *device_name;\n+\tlong (*device_create)(struct mshv_device *dev);\n+\tvoid (*device_release)(struct mshv_device *dev);\n+\tlong (*device_set_attr)(struct mshv_device *dev,\n+\t\t\t\tstruct mshv_device_attr *attr);\n+\tlong (*device_has_attr)(struct mshv_device *dev,\n+\t\t\t\tstruct mshv_device_attr *attr);\n+};\n+\n+extern struct mshv_device_ops mshv_vfio_device_ops;\n+\n int mshv_update_routing_table(struct mshv_partition *partition,\n \t\t\t      const struct mshv_user_irq_entry *entries,\n \t\t\t      unsigned int numents);\ndiff --git a/include/uapi/linux/mshv.h b/include/uapi/linux/mshv.h\nindex 32ff92b6342b..4373a8243951 100644\n--- a/include/uapi/linux/mshv.h\n+++ b/include/uapi/linux/mshv.h\n@@ -404,4 +404,34 @@ struct mshv_sint_mask {\n /* hv_hvcall device */\n #define MSHV_HVCALL_SETUP        _IOW(MSHV_IOCTL, 0x1E, struct mshv_vtl_hvcall_setup)\n #define MSHV_HVCALL              _IOWR(MSHV_IOCTL, 0x1F, struct mshv_vtl_hvcall)\n+\n+/* device passhthru */\n+#define MSHV_CREATE_DEVICE_TEST\t\t1\n+\n+enum {\n+\tMSHV_DEV_TYPE_VFIO,\n+\tMSHV_DEV_TYPE_MAX,\n+};\n+\n+struct mshv_create_device {\n+\t__u32\ttype;\t     /* in: MSHV_DEV_TYPE_xxx */\n+\t__u32\tfd;\t     /* out: device handle */\n+\t__u32\tflags;\t     /* in: MSHV_CREATE_DEVICE_xxx */\n+};\n+\n+#define MSHV_DEV_VFIO_FILE      1\n+#define MSHV_DEV_VFIO_FILE_ADD\t1\n+#define MSHV_DEV_VFIO_FILE_DEL\t2\n+\n+struct mshv_device_attr {\n+\t__u32\tflags;\t\t/* no flags currently defined */\n+\t__u32\tgroup;\t\t/* device-defined */\n+\t__u64\tattr;\t\t/* group-defined */\n+\t__u64\taddr;\t\t/* userspace address of attr data */\n+};\n+\n+/* Device fds created with MSHV_CREATE_DEVICE */\n+#define MSHV_SET_DEVICE_ATTR\t_IOW(MSHV_IOCTL, 0x00, struct mshv_device_attr)\n+#define MSHV_HAS_DEVICE_ATTR\t_IOW(MSHV_IOCTL, 0x01, struct mshv_device_attr)\n+\n #endif\n","prefixes":["V2","04/11"]}