Sharing unclaimed USB devices as PCI devices
AssigneeVMware, Inc.
InventorErik Cota-Robles
Life of this patent
Estimating the term…
Abstract
Examples of the disclosure safely share universal service bus (USB) devices with peripheral component interconnect (PCI) passthrough, and share devices in the USB hierarchy. An in-use counter is maintained for the USB bus and/or for USB hubs. The in-use counter is checked and adjusted when a VM or entity claims and/or unclaims a device. For example, when a PCI passthrough of a USB host controller device is requested, the global in-use counter is checked to determine whether to grant the request. When a VM or entity requests to claim a USB hub, the in-use counter is checked to determine whether to grant the request. The in-use counter indicates whether any USB device attached has been claimed and/or whether the USB host controller device has been claimed by a PCI passthrough operation.
Claims20
A system for safely sharing universal serial bus (USB) host controller devices as peripheral component interconnect (PCI) devices, said system comprising:
- a memory area associated with a computing device, said memory area storing a global in-use counter corresponding to a quantity of devices attached to a USB host controller device that are claimed by at least one of a plurality of entities with access to the computing device;
- and
- a processor programmed to:
- interrogate a USB bus to calculate the global in-use counter;
- receive, from one entity of the plurality of entities, a request for peripheral component interconnect (PCI) passthrough of the USB host controller device on the computing device;
- responsive to the received request, determine whether the USB host controller device is claimed by at least one of the plurality of entities with access to the computing device;
- and
- grant the request based on the determination.
A method comprising:
- interrogating a universal serial bus (USB) bus to calculate a global in-use counter, wherein the global in-use counter corresponds to a quantity of devices attached to a USB host controller device that are claimed by at least one of a plurality of entities with access to a computing device;
- receiving, from one entity of the plurality of entities with access to the computing device, a request for peripheral component interconnect (PCI) passthrough of the USB host controller device on the computing device;
- responsive to the received request, determining whether the USB host controller device is claimed by at least one of the plurality of entities with access to the computing device;
- and
- granting the request based on the determination.
One or more computer-readable storage media including computer-executable instructions that, when executed, cause at least one processor to safely share universal serial bus (USB) host controller devices as peripheral component interconnect (PCI) devices by:
- receiving, from one entity of a plurality of entities with access to a computing device, a request for PCI pass through of a USB host controller device on the computing device;
- responsive to the received request, determining whether the USB host controller device is claimed by at least one of the plurality of entities with access to the computing device;
- and
- granting the request based on the determination, wherein granting the request comprising:
- preventing any user mode USB host controller driver from performing input/output (I/O) control (IOCTL) operations on the USB host controller device on determining that the USB host controller device will be claimed by a kernel mode USB host controller driver, and
- preventing any kernel mode USB host controller driver from claiming the USB host controller device for I/O access on determining that the USB host controller device is available to be claimed by one or more user mode USB host controller drivers.
Dependencies are inferred from the claim text.