1. Technical Field
The present invention relates generally to communication protocols between a host computer and an input/output (I/O) adapter. More specifically, the present invention provides an implementation for virtualizing resources in a physical I/O adapter. In particular, the present invention provides a method, apparatus, and computer instructions for efficient and flexible sharing of adapter resources among multiple operating system instances.
2. Description of Related Art
A partitioned server is one in which platform firmware, such as a hypervisor, manages multiple partitions (one operating system (OS) instance in each partition) and each partition has allocated resources: processor (processors or portion of a processor), memory, and I/O adapters. An example of platform firmware used in logical partitioned data processing systems is a hypervisor, which is available from International Business Machines Corporation. The hypervisor mediates data movement between partitions to insure that the only data approved by their respective owning partitions are involved.
Existing partitioned servers typically have three access control levels:
(1) Hypervisor level—This level is used to subdivide physical server resources (processor, memory and I/O) into one or more shared resource groups that are allocated to an operating system (OS) instance. This level is referred to as privileged, because it is the only level that can perform physical resource allocation.
(2) OS level—Each OS instance created by the hypervisor executes at this level. An OS instance may only access resources that have been allocated to the OS instance at the hypervisor level. Each OS instance is isolated from other OS instances through hardware and the resource allocations performed at the hypervisor level. The resources allocated to a single OS instance can be further subdivided into one or more shared resource groups that are allocated to an application instance.
(3) Application level—Each application instance created by the OS executes at this level. An application instance can only access resources that have been allocated to the application instance at the OS level. Each application instance is isolated from other application instances through hardware and the resource allocations performed at the OS level.
A problem encountered with using I/O adapters in virtualized systems is an inability of the I/O adapter to share its resources. Currently, I/O adapters provide a single bus space for all memory mapped I/O operations. Currently available I/O adapters do not have a mechanism to configure multiple address spaces per adapter, where (1) each address space is associated to particular access level (hypervisor, OS, and application, respectively); and (2) the I/O adapter in conjunction with virtual memory manager (VMM) provides access isolation between the various OS instances that share the I/O adapter, on different access levels.
Without a direct mechanism for sharing I/O adapters, OS instances do not share an I/O adapter, or, alternatively, they share an I/O adapter by going through an intermediary, such as a hosting partition, hypervisor, or special I/O processor. The inability to share an I/O adapter between OS instances presents several problems, including requiring more I/O slots and adapters per physical server, and high performance I/O adapters may not be fully utilized by a single OS instance. Sharing an I/O adapter through a hosting partition or hypervisor also presents several problems, the most significant being the additional latency added to every I/O operation by going through the intermediary. If the intermediary is in the host (e.g., hosting partition or hypervisor), then the sharing function takes CPU cycles away from the application for each I/O operation. If the intermediary is outboard (e.g., I/O processor), then the sharing function requires an additional card, thus adding cost to the total server solution.
Therefore, it would be advantageous to have a mechanism for the direct sharing of adapter resources among multiple OS instances while the adapter enforces access level validation to the adapter resources.
The present invention provides a method, system, and computer program product for efficient and flexible sharing of adapter resources among multiple operating system instances. Specifically, the present invention provides a mechanism for dynamically allocating virtualized I/O adapter resources, without adding complexity to the adapter implementation. A hypervisor is used to locate available resources in an adapter and allocates an available adapter resource to a given partition. The adapter is notified of the allocation, and the adapter internal structure is updated to reflect the allocation.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
The present invention applies to any general or special purpose host that uses PCI family I/O adapter to directly attach storage or to attach to a network, where the network consists of endnodes, switches, router and the links interconnecting these components. The network links can be Fibre Channel, Ethernet, InfiniBand, Advanced Switching Interconnect, or a proprietary link that uses proprietary or standard protocols.
With reference now to the figures and in particular with reference to
Network 120 can also attach large host node 124 through port 136 which attaches to switch 140. Large host node 124 can also contain a second type of port 128, which connects to a direct attached storage subsystem, such as direct attached storage 132.
Network 120 can also attach a small integrated host node 144 which is connected to network 120 through port 148 which attaches to switch 140. Small integrated host node 144 can also contain a second type of port 152 which connects to a direct attached storage subsystem, such as direct attached storage 156.
Turning next to
In this example, small host node 202 includes two processor I/O hierarchies, such as processor I/O hierarchy 200 and 203, which are interconnected through link 201. In the illustrative example of
With reference now to
In this example, small integrated host node 302 includes two processor I/O hierarchies 300 and 303, which are interconnected through link 301. In the illustrative example, processor I/O hierarchy 300 includes processor chip 304, which is representative of one or more processors and associated caches. Processor chip 304 is connected to memory 312 through link 308. One of the links on the processor chip, such as link 330, connects to a PCI family adapter, such as PCI family adapter 345. Processor chip 304 has one or more PCI family (e.g., PCI, PCI-X, PCI-Express, or any future generation of PCI) links that is used to connect either PCI family I/O bridges or a PCI family I/O adapter, such as PCI family adapter 344 and PCI family adapter 345 through a PCI link, such as link 316, 330, and 324. PCI family adapter 345 can also be used to connect with a network, such as network 364, through link 356 via either a switch or router, such as switch or router 360. PCI family adapter 344 can be used to connect with direct attached storage 352 through link 348.
Turning now to
In this example, large host node 402 includes two processor I/O hierarchies 400 and 403 interconnected through link 401. In the illustrative example of
Turning next to
PCI bus transaction 500 shows three phases: an address phase 508; a data phase 512; and a turnaround cycle 516. Also depicted is the arbitration for next transfer 504, which can occur simultaneously with the address, data, and turnaround cycle phases. For PCI, the address contained in the address phase is used to route a bus transaction from the adapter to the host and from the host to the adapter.
PCI-X transaction 520 shows five phases: an address phase 528; an attribute phase 532; a response phase 560; a data phase 564; and a turnaround cycle 566. Also depicted is the arbitration for next transfer 524 which can occur simultaneously with the address, attribute, response, data, and turnaround cycle phases. Similar to conventional PCI, PCI-X uses the address contained in the address phase to route a bus transaction from the adapter to the host and from the host to the adapter. However, PCI-X adds the attribute phase 532 which contains three fields that define the bus transaction requester, namely: requester bus number 544, requester device number 548, and requester function number 552 (collectively referred to herein as a BDF). The bus transaction also contains a tag 540 that uniquely identifies the specific bus transaction in relation to other bus transactions that are outstanding between the requester and a responder. The byte count 556 contains a count of the number of bytes being sent.
Turning now to
PCI-E bus transaction 600 shows six phases: frame phase 608; sequence number 612; header 664; data phase 668; cyclical redundancy check (CRC) 672; and frame phase 680. PCI-E header 664 contains a set of fields defined in the PCI-Express specification. The requester identifier (ID) field 628 contains three fields that define the bus transaction requester, namely: requester bus number 684, requester device number 688, and requester function number 692. The PCI-E header also contains tag 652, which uniquely identifies the specific bus transaction in relation to other bus transactions that are outstanding between the requester and a responder. The length field 644 contains a count of the number of bytes being sent.
With reference now to
PCI family adapter 736 contains a set of physical adapter configuration resources 740 and physical adapter memory resources 744. The physical adapter configuration resources 740 and physical adapter memory resources 744 contain information describing the number of virtual adapters that PCI family adapter 736 can support and the physical resources allocated to each virtual adapter. As referred to herein, a virtual adapter is an allocation of a subset of physical adapter resources and virtualized resources, such as a subset of physical adapter resources and physical adapter memory, that is associated with a logical partition, such as system image 712 and applications 716 and 720 running on system image 712, as described more fully hereinbelow. LPAR manager 708 is provided a physical configuration resource interface 738, and physical memory configuration interface 742 to read and write into the physical adapter configuration resource and memory spaces during the adapter's initial configuration and reconfiguration. Through the physical configuration resource interface 738 and physical configuration memory interface 742, LPAR manager 708 creates virtual adapters and assigns physical resources to each virtual adapter. LPAR manager 708 may use one of the system images, for example a special software or firmware partition, as a hosting partition that uses physical configuration resource interface 738 and physical configuration memory interface 742 to perform a portion, or even all, of the virtual adapter initial configuration and reconfiguration functions.
After LPAR manager 708 configures the PCI family adapter 736, each system image is allowed to only communicate with the virtual adapters that were associated with that system image by LPAR manager 708. As shown in
With reference now to
If the processor, I/O hub, or I/O bridge 800 uses the same bus number, device number, and function number for all transaction initiators, then when a software component initiates a PCI-X or PCI-E bus transaction, such as host to adapter PCI-X or PCI-E bus transaction 812, the processor, I/O hub, or I/O bridge 800 places the processor, I/O hub, or I/O bridge's bus number in the PCI-X or PCI-E bus transaction's requester bus number field 820, such as requester bus number 544 field of the PCI-X transaction shown in
If the processor, I/O hub, or I/O bridge 800 uses a different bus number, device number, and function number for each transaction initiator, then the processor, I/O hub, or I/O bridge 800 assigns a bus number, device number, and function number to the transaction initiator. When a software component initiates a PCI-X or PCI-E bus transaction, such as host to adapter PCI-X or PCI-E bus transaction 812, the processor, I/O hub, or I/O bridge 800 places the software component's bus number in the PCI-X or PCI-E bus transaction's requester bus number 820 field, such as requester bus number 544 field shown in
With reference now to
Turning next to
The functions performed at the super-privileged physical resource allocation level 1000 include but are not limited to: PCI family adapter queries, creation, modification and deletion of virtual adapters, submission and retrieval of work, reset and recovery of the physical adapter, and allocation of physical resources to a virtual adapter instance. The PCI family adapter queries are used to determine, for example, the physical adapter type (e.g. Fibre Channel, Ethernet, iSCSI, parallel SCSI), the functions supported on the physical adapter, and the number of virtual adapters supported by the PCI family adapter. The LPAR manager, such as LPAR manager 708 shown in
The functions performed at the privileged virtual resource allocation level 1008 include, for example, virtual adapter queries, allocation and initialization of virtual adapter resources, reset and recovery of virtual adapter resources, submission and retrieval of work through virtual adapter resources, and, for virtual adapters that support offload services, allocation and assignment of virtual adapter resources to a middleware process or thread instance. The virtual adapter queries are used to determine: the virtual adapter type (e.g. Fibre Channel, Ethernet, iSCSI, parallel SCSI) and the functions supported on the virtual adapter. A system image, such as system image 712 shown in
Finally, the functions performed at the non-privileged level 1016 include, for example, query of virtual adapter resources that have been assigned to software running at the non-privileged level 1016 and submission and retrieval of work through virtual adapter resources that have been assigned to software running at the non-privileged level 1016. An application, such as application 716 shown in
Turning next to
The first exemplary mechanism that LPAR manager 708 can use to associate and make available host memory to a system image and to one or more virtual adapters is to write into the virtual adapter's resources a system image association list 1122. Virtual adapter resources 1120 contains a list of PCI bus addresses, where each PCI bus address in the list is associated by the platform hardware to the starting address of a system image (SI) page, such as SI 1 page 11128 through SI 1 page N 1136 allocated to system image 1108. Virtual adapter resources 1120 also contains the page size, which is equal for all the pages in the list. At initial configuration, and during reconfigurations, LPAR manager 708 loads system image association list 1122 into virtual adapter resources 1120. The system image association list 1122 defines the set of addresses that virtual adapter 1104 can use in DMA write and read operations. After the system image association list 1122 has been created, virtual adapter 1104 must validate that each DMA write or DMA read requested by system image 1108 is contained within a page in the system image association list 1122. If the DMA write or DMA read requested by system image 1108 is contained within a page in the system image association list 1122, then virtual adapter 1104 may perform the operation. Otherwise virtual adapter 1104 is prohibited from performing the operation. Alternatively, the PCI family adapter 1101 may use a special, LPAR manager-style virtual adapter (rather than virtual adapter 1104) to perform the check that determines if a DMA write or DMA read requested by system image 1108 is contained within a page in the system image association list 1122. In a similar manner, virtual adapter 1112 associated with system image 1116 validates DMA write or read requests submitted by system image 1116. Particularly, virtual adapter 1112 provides validation for DMA read and write requests from system image 1116 by determining whether the DMA write or read request is in a page in system image association list (configured in a manner similarly to system image association list 1122) associated with system image pages of system image 1116.
The second mechanism that LPAR manager 708 can use to associate and make available host memory to a system image and to one or more virtual adapters is to write a starting page address and page size into system image association list 1122 in the virtual adapter's resources. For example, virtual adapter resources 1120 may contain a single PCI bus address that is associated by the platform hardware to the starting address of a system image page, such as SI 1 Page 11128. System image association list 1122 in virtual adapter resources 1120 also contains the size of the page. At initial configuration, and during reconfigurations, LPAR manager 708 loads the page size and starting page address into system image association list 1122 into the virtual adapter resources 1120. The system image association list 1122 defines the set of addresses that virtual adapter 1104 can use in DMA write and read operations. After the system image association list 1122 has been created, virtual adapter 1104 validates whether each DMA write or DMA read requested by system image 1108 is contained within a page in system image association list 1122. If the DMA write or DMA read requested by system image 1108 is contained within a page in the system image association list 1122, then virtual adapter 1104 may perform the operation. Otherwise, virtual adapter 1104 is prohibited from performing the operation. Alternatively, the PCI family adapter 1101 may use a special, LPAR manager-style virtual adapter (rather than virtual adapter 1104) to perform the check that determines if a DMA write or DMA read requested by system image 1108 is contained within a page in the system image association list 1122. In a similar manner, virtual adapter 1112 associated with system image 1116 may validate DMA write or read requests submitted by system image 1116. Particularly, a system image association list similar to system image association list 1122 may be associated with virtual adapter 1112. The system image association list associated with virtual adapter 1112 is loaded with a page size and starting page address of a system image page of system image 1116 associated with virtual adapter 1112. The system image association list associated with virtual adapter 1112 thus provides a mechanism for validation of DMA read and write requests from system image 1116 by determining whether the DMA write or read request is in a page in a system image association list associated with system image pages of system image 1116.
The third mechanism that LPAR manager 708 can use to associate and make available host memory to a system image and to one or more virtual adapters is to write into the virtual adapter's resources a system image buffer association list 1154. In
The fourth mechanism that LPAR manager 708 can use to associate and make available host memory to a system image and to one or more virtual adapters is to write into the virtual adapter's resources a single starting and ending address in system image buffer association list 1154. In this implementation, virtual adapter resources 1150 contains a single pair of PCI bus starting and ending address that is associated by the platform hardware to a pair (starting and ending) of addresses associated with a system image buffer, such as SI 2 Buffer 11166. At initial configuration, and during reconfigurations, LPAR manager 708 loads the starting and ending addresses of SI 2 buffer 11166 into the system image buffer association list 1154 in virtual adapter resources 1150. The system image buffer association list 1154 then defines the set of addresses that virtual adapter 1112 can use in DMA write and read operations. After the system image buffer association list 1154 has been created, virtual adapter 1112 validates whether each DMA write or DMA read requested by system image 1116 is contained within the system image buffer association list 1154. If the DMA write or DMA read requested by system image 1116 is contained within system image buffer association list 1154, then virtual adapter 1112 may perform the operation. Otherwise, virtual adapter 1112 is prohibited from performing the operation. Alternatively, the PCI family adapter 1101 may use a special, LPAR manager-style virtual adapter (rather than virtual adapter 1150) to perform the check that determines if DMA write or DMA read requested by system image 1116 is contained within a page system image buffer association list 1154. In a similar manner, virtual adapter 1104 associated with system image 1108 may validate DMA write or read requests submitted by system image 1108. Particularly, virtual adapter 1104 provides validation for DMA read and write requests from system image 1108 by determining whether the DMA write or read requested by system image 1108 is contained within a buffer in a buffer association list that contains a single PCI bus starting and ending address in association with a system image buffer starting and ending address allocated to system image 1108 in a manner similar to that described above for system image 1116 and virtual adapter 1112.
Turning next to
A notable difference between the system image and virtual adapter configuration shown in
The first and second mechanisms that LPAR manager 708 can use to associate and make available PCI family adapter memory to a system image and to a virtual adapter is to write into the PCI family adapter's physical adapter memory translation table 1290 a page size and the starting address of one (first mechanism) or more (second mechanism) pages. In this case all pages have the same size. For example,
The third and fourth mechanisms that LPAR manager 708 can use to associate and make available PCI family adapter memory to a system image and to a virtual adapter is to write into the PCI family adapter's physical adapter memory translation table 1290 one (third mechanism) or more (fourth mechanism) buffer starting and ending addresses (or starting address and length). In this case, the buffers may have different sizes. For example,
With reference next to
The first mechanism is to compare the memory address of incoming PCI bus transaction 1304 with each row of high address cell 1316 and low address cell 1320 in buffer table 1390. High address cell 1316 and low address cell 1320 respectively define an upper and lower address of a range of addresses associated with a corresponding virtual or physical adapter identified in association cell 1324. If incoming PCI bus transaction 1304 has an address that is lower than the contents of high address cell 1316 and that is higher than the contents of low address cell 1320, then incoming PCI bus transaction 1304 is within the high address and low address cells that are associated with the corresponding virtual adapter identified in association cell 1324. In such a scenario, the incoming PCI bus transaction 1304 is allowed to be performed on the matching virtual adapter. Alternatively, if incoming PCI bus transaction 1304 has an address that is not between the contents of high address cell 1316 and the contents of low address cell 1320, then completion or processing of incoming PCI bus transaction 1304 is prohibited. The second mechanism is to simply allow a single entry in buffer table 1390 per virtual adapter.
The third mechanism is to compare the memory address of incoming PCI bus transaction 1304 with each row of page starting address cell 1322 and with each row of page starting address cell 1322 plus the page size in page table 1392. If incoming PCI bus transaction 1304 has an address that is higher than or equal to the contents of page starting address cell 1322 and lower than page starting address cell 1322 plus the page size, then incoming PCI bus transaction 1304 is within a page that is associated with a virtual adapter. Accordingly, incoming PCI bus transaction 1304 is allowed to be performed on the matching virtual adapter. Alternatively, if incoming PCI bus transaction 1304 has an address that is not within the contents of page starting address cell 1322 and page starting address cell 1322 plus the page size, then completion of incoming PCI bus transaction 1304 is prohibited. The fourth mechanism is to simply allow a single entry in page table 1392 per virtual adapter.
With reference next to
The requester bus number, such as host bus number 1408, requester device number, such as host device number 1412, and requester function number, such as host function number 1416, referenced in incoming PCI bus transaction 1404 provides an additional check beyond the memory address mappings that were set up by a host LPAR manager.
The present invention provides a method, system, and computer program product for efficient and flexible sharing of adapter resources among multiple operating system instances. The mechanism of the present invention allows for implementing flexible and dynamic resource allocation of virtualized I/O adapters, without adding complexity to the adapter implementation. The present invention separates the operation of adapter resource allocation from adapter resource management. Adapter resource allocation is performed by a hypervisor using a privileged address range, and adapter resource initialization is performed by an OS using an OS non-privileged address range. This flexible and dynamic allocation policy allows the hypervisor to perform adapter resource allocation and track allocated adapter resources.
Each adapter has a limited set of adapter resources. The variety of resources available depends on the adapter. For example, a Remote Direct Memory Access enabled Network Interface Controller (RNIC) I/O adapter providing RDMA capabilities has a wide set of different resources, such as: Queue Pairs (QP), Completion Queues (CQ), Protection Blocks (PB), Translation Tables (TT), etc. However, the I/O adapter still only supports a limited number of QPs, CQs, PBs and size of TT, etc. Since each partition may have its own needs (which are not necessarily the same for different partitions), it is advantageous to share resources according to partition demands rather than sharing all adapter resources in an equal manner, where each partition receives the same number of QPs, CQ, PBs, and size of TT.
The mechanism of the present invention also allows for sharing this variety of resources between different partitions according to the partition demands. Each I/O adapter resource is composed from multiple resource fields. The present invention provides for differentiating between address ranges in the fields, such that each adapter resource field may be accessed via a different address range. In addition, the access permissions depend on the address range through which the adapter resource field has been accessed. Example address ranges on the I/O adapter include a privileged address range, an OS non-privileged range, and an application non-privileged range. These address ranges are set to correspond to access levels in the partitioned server in the illustrative examples. For example, the privileged address range corresponds to the hypervisor access level, an OS non-privileged range corresponds to an OS access level, and an application non-privileged range corresponds to an application access level.
In particular, the hypervisor uses the privileged address range to perform physical resource allocation of adapter resources, and each adapter resource is associated with a particular partition/OS instance. OS non-privileged address range may be used by an operating system instance to access the adapter resources and perform initialization/management of those resources. These resources are owned by the OS instance and were previously allocated by hypervisor and associated with that OS instance. Application non-privileged address range may be used by an application running in the environment of the operating system instance to access the adapter resources owned by that OS instance.
Each PCI adapter resource associated with a particular partition/OS instance is located in the same I/O page. An I/O page refers to the I/O addressing space, typically in 4 KB pages, which is mapped by an OS or hypervisor to the hypervisor, OS or application address space respectively, and then may be accessed by a hypervisor, OS or application. By associating the adapter resources in the same I/O page with the same partition/OS instance, Virtual Memory Manager (VMM) services may be used to protect unauthorized access of one OS instance (and applications running in that OS environment) to the resources allocated for the other OS instance. Access may be controlled by mapping a particular I/O page to be owned by particular partition. Such mapping allows for restricting access to the I/O address space in page granularity, thus allowing access protection.
Once the adapter resource is allocated by the hypervisor for the particular OS instance, this adapter resource can remain in possession of the OS instance. The OS instance owns the allocated adapter resource and may reuse it multiple times. The hypervisor also may reassign an adapter resource by revoking OS ownership of the previously allocated adapter resource and grant ownership on that resource to another OS instance. These adapter resources are allocated and revoked on an I/O page basis.
In addition, an adapter may restrict/differentiate access to the adapter resource context fields for the software components with different privilege levels. Each resource context field has an associated access level, and I/O address ranges are used to identify the access level of the software that accesses the adapter resource context. Each access level (privileged, OS non-privileged and application) has an associated address range in adapter I/O space that can be used to access adapter resources. For example, fields having a privileged access level may be accessed by the I/O transaction initiated through the privileged address range only. Fields having an OS non-privileged access level may be accessed by the I/O transactions initiated through the privileged and OS non-privileged address ranges. In this manner, multiple OS instances may efficiently and flexibly share adapter resources, while the adapter enforces access level control to the adapter resources.
Turning now to
In particular, the left side of
For example, hypervisor 1502 may keep bitmap 1506 of all adapter queue pairs QPs with an indication which QPs are allocated to which particular partition. When hypervisor 1502 wants to allocate a new QP(s) to the given partition, the hypervisor first searches for the available (not allocated) QPs in bitmap 1506. Hypervisor 1502 may use LPAR ID fields 1508 and alloc/free fields 1510 to locate available QPs in bitmap 1506.
Hypervisor 1502 then allocates those QPs for the partition by marking the particular LPAR ID field and corresponding alloc/free field in bitmap 1506, such as LPAR ID field 1512 and alloc/free field 1514, as allocated. Hypervisor 1502 then notifies adapter 1504 (or updates the structure of adapter 1504) to reflect that those QPs were allocated for the given partition. Adapter 1504 respectively updates its internal structure 1512 to reflect the allocation, as shown by allocated resources 1514. The process of deallocation or reassignment of adapter resources is similar to the allocation process described above.
Hypervisor 1502 is shown in
As
For example, some of the fields may be accessed only by hypervisor 1616 (such as identification of the partition which owns the resource), some fields may be accessed by OS level software 1618 (such as the TCP source port number), or some fields may be accessed directly by applications 1620. For example, Doorbell field 1602 may be accessed by an application, such as application 1620, through a write-only type access. In addition, it should be noted that if a field is allowed to be accessed by OS level software, then this field may also be accessed by the hypervisor as well. Likewise, if a field is allowed to be accessed by an application, then this field may also be accessed by the OS and the hypervisor as well.
Turning now to
In particular,
Mappings 1710, 1714, and 1718 may be accessed by software of the certain protection level. For instance, privileged address range 1710 is used by hypervisor 1712 to update respective fields of the resource context for an allocated, deallocated, or reassigned resource. Privileged address range 1710 is mapped by hypervisor to the hypervisor virtual address space. For example, each adapter resource context contains a partition ID field, such as partition ID field 1610 in
Partition ID field 1610 may be updated only by hypervisor 1712, and is initialized at resource allocation time. Partition ID field 1610 identifies the partition that owns this resource, and used by adapter 1702 to prevent unauthorized access of the partition resource by another partition. I/O adapter 1702 uses the address range validating policy described above to prevent change of the partition ID field by OS-level code.
OS address range 1714 is used by OS instance 1716 to access the resource context of the resource allocated for this OS instance. OS address range 1714 is used to perform resource initialization and management. OS address range 1714 (or more exactly its parts—I/O pages) are mapped to the OS virtual space during the resource allocation process.
Application address range 1718 is used by application 1720 running on a particular OS instance, such as OS instance 1716, to directly communicate with I/O adapter 1702. In this manner, application 1720 may avoid OS involvement (context switch) while sending and receiving data (so-called Doorbell ring operations). I/O pages from application address range 1718 are mapped to the application address space.
Thus, I/O adapter 1702 uses these address ranges/mappings to identify the protection level of software that accesses adapter internal structures. This information together with access and protection attributes associated with each resource context field, allows adapter 1702 to perform access and protection validation.
In particular,
The resource context fields in
An alternative embodiment of the present invention for mapping the resource context to the adapter range is to employ a command-based approach. The command-based approach may be used in contrast with the direct mapping approach utilized in
In this illustrative approach, the command structure is mapped to the adapter address space using the adapter configuration, I/O address space, or memory address space. Software, such as a hypervisor, OS, or application, writes the command to the command structure. The software may also read the response from the response structure. Access to the command structure may be detected by dedicated adapter logic, which in turn may respond to the commands and update the resource context fields respectively.
For example, it is particularly useful to employ the command-based approach in a hypervisor implementation. Since the hypervisor is responsible for the allocation of adapter resources only, it is not necessary that the hypervisor be aware of the internal structure of the resource context. Rather, the hypervisor just needs to know what types and how many resources are supported by the adapter. For instance, while performing resource allocation, instead of performing a direct update of the resource context (e.g., with LPAR_ID), the hypervisor may request that the adapter allocate a particular instance of the given resource type to the particular partition (e.g., QP #17 is allocated to partition #5). Consequently, the adapter does not need to look for the available QP, since the particular instance of QP is specified by the hypervisor, and the hypervisor is not required to be aware of the internal structure of the QP context.
In particular, this command-based approach is important in situations where the accessing software should not be aware of the internal structure of the adapter resource. For example, this illustrative approach may be used to implement the hypervisor-adapter interface. The command-based interface allows for abstracting the hypervisor code from the adapter internal structure and for using the same hypervisor code to perform resource allocation for different I/O adapters. If the hypervisor is responsible only for resource allocation and resource initialization and management is performed by the OS, a simple querying and allocation protocol may satisfy hypervisor needs. For example, the protocol may include querying the resource types supported by the adapter, the amount of each supported resource, and the command to allocate/deallocate/reassign a resource number of the specified resource to a particular partition number.
Turning now to
In particular, software may be used to perform a memory-mapped input-output (MMIO) write to adapter address space 1902. Decoding logic within the adapter uses various bits within I/O address 1904 to write to adapter address space 1902. For example, decoding logic within adapter 1904 may detect an access to adapter address space 1902 by matching adapter base address (BA) bits 1906 from I/O address 1904 and adapter address space 1902. The base address is the beginning of the I/O address space that belongs to the adapter. The base address is typically aligned to the size of the adapter address space to allow easy detection/decoding process.
The adapter decoding logic also finds the referred address range (e.g., privileged 1908, OS 1910, or application 1912) of adapter address space 1902 using AR offs bits 1914. AR offs is an offset of the particular address range inside the adapter address space. Cntx offs bits 1916 may be used to locate the resource context, such as resource context 1918. Cntx offs is a resource context offset inside the particular adapter address range. The adapter decoding logic also uses field offs bits 1920 as an offset to the field inside the resource context, such as field 1922. Field offs is an offset of the particular field in the adapter resource context. In this manner, the adapter may use the address range type and the field attributes to validate access to the resource context.
Thus, the present invention provides a method, apparatus, and computer instructions for allowing multiple OS instances to directly share adapter resources. In particular, the present invention provides a mechanism for configuring multiple address spaces per adapter, where each address space is associated to particular access level of the partitioned server and the PCI adapter in conjunction with virtual memory manager (VMM) provides access isolation between the various OS instances sharing the PCI adapter.
The advantages of the present invention should be apparent in view of the detailed description provided above. Existing methods of using PCI adapters either do not allow for sharing of an adapter's resources or, alternatively, the adapter's resources are shared by going through an intermediary, such as a hosting partition, hypervisor, or special I/O processor. However, not sharing adapter resources requires more PCI I/O slots and adapters per physical server, and high performance PCI adapters may not be fully utilized by a single OS instance. Using an intermediary to facilitate PCI adapter sharing adds additional latency to every I/O operation. In contrast, the present invention not only reduces the amount of time and resources needed when using PCI adapters via sharing adapter resources among OS instances, but it also allows the adapter to enforce access control to the adapter resources.
It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
This application is related to commonly assigned and U.S. Pat. No. 7,493,425 entitled “Method, System and Program Product for Differentiating Between Virtual Hosts on Bus Transactions and Associating Allowable Memory Access for an Input/Output Adapter that Supports Virtualization”; U.S. patent application Ser. No. 11/066,645 entitled “Virtualized I/O Adapter for a Multi-Processor Data Processing System” now abandoned; U.S. Pat. No. 7,685,335 entitled “Virtualized Fibre Channel Adapter for a Multi-Processor Data Processing System”; U.S. Pat. No. 7,260,664 entitled “Interrupt Mechanism on an IO Adapter That Supports Virtualization”; U.S. Pat. No. 7,870,301 entitled “System and Method for Modification of Virtual Adapter Resources in a Logically Partitioned Data Processing System”; U.S. Pat. No. 7,480,742 entitled “Method, System, and Computer Program Product for Virtual Adapter Destruction on a Physical Adapter that Supports Virtual Adapters”; U.S. patent application Ser. No. 11/066,518 entitled “System and Method of Virtual Resource Modification on a Physical Adapter that Supports Virtual Resources”, now abandoned; U.S. Pat. No. 7,543,084 entitled “Method for Destroying Virtual Resources in a Logically Partitioned Data Processing System”; U.S. Pat. No. 7,398,337 entitled “Association of Host Translations that are Associated to an Access Control Level on a PCI Bridge that Supports Virtualization”; U.S. Pat. No. 7,483,679 entitled “Method, Apparatus, and Computer Program Product for Coordinating Error Reporting and Reset Utilizing an I/O Adapter that Supports Virtualization”; U.S. Pat. No. 7,475,166 entitled “Method and System for Fully Trusted Adapter Validation of Addresses Referenced in a Virtual Host Transfer Request”; U.S. Pat. No. 7,386,637 entitled “System, Method, and Computer Program Product for a Fully Trusted Adapter Validation of Incoming Memory Mapped I/O Operations on a Physical Adapter that Supports Virtual Adapters or Virtual Resources”; U.S. Pat. No. 7,464,191 entitled “System and Method for Host Initialization for an Adapter that Supports Virtualization”; U.S. patent application Ser. No. 11/065,829 entitled “Data Processing System, Method, and Computer Program Product for Creation and Initialization of a Virtual Adapter on a Physical Adapter that Supports Virtual Adapter Level Virtualization”, now abandoned; U.S. Pat. No. 7,546,386 entitled “System and Method for Virtual Resource Initialization on a Physical Adapter that Supports Virtual Resources”; U.S. patent application Ser. No. 11/065,821 entitled “Method and System for Native Virtualization on a Partially Trusted Adapter Using Adapter Bus, Device and Function Number for Identification”, now abandoned; U.S. patent application Ser. No. 11/066,487 entitled “Native Virtualization on a Partially Trusted Adapter Using PCI Host Memory Mapped Input/Output Memory Address for Identification”, now on appeal; U.S. Pat. No. 7,398,328 entitled “Native Virtualization on a Partially Trusted Adapter Using PCI Host Bus, Device, and Function Number for Identification; U.S. Pat. No. 7,376,770 entitled “System and Method for Virtual Adapter Resource Allocation”; U.S. patent application Ser. No. 11/067,354 entitled “System and Method for Providing Quality of Service in a Virtual Adapter”, now abandoned; and U.S. Pat. No. 7,308,551 entitled “System and Method for Managing Metrics Table Per Virtual Port in a Logically Partitioned Data Processing System” all of which are hereby incorporated by reference. This application is a continuation of application Ser. No. 11/066,419, filed Feb. 25, 2005, status pending.
Number | Name | Date | Kind |
---|---|---|---|
5668943 | Attanasio et al. | Sep 1997 | A |
6111894 | Bender et al. | Aug 2000 | A |
6134641 | Anand | Oct 2000 | A |
6199137 | Aguilar et al. | Mar 2001 | B1 |
6212585 | Chrabaszcz | Apr 2001 | B1 |
6370656 | Olarig et al. | Apr 2002 | B1 |
6453392 | Flynn, Jr. | Sep 2002 | B1 |
6487680 | Skazinski et al. | Nov 2002 | B1 |
6598144 | Bailey et al. | Jul 2003 | B1 |
6629157 | Falardeau et al. | Sep 2003 | B1 |
6629162 | Arndt et al. | Sep 2003 | B1 |
6662289 | Ang | Dec 2003 | B1 |
6704284 | Stevenson et al. | Mar 2004 | B1 |
6804741 | Cowan | Oct 2004 | B2 |
6823418 | Langendorf et al. | Nov 2004 | B2 |
7003586 | Bailey et al. | Feb 2006 | B1 |
7130982 | Boutcher et al. | Oct 2006 | B2 |
7200687 | Nordstrom et al. | Apr 2007 | B2 |
7356818 | Carollo et al. | Apr 2008 | B2 |
7480742 | Arndt et al. | Jan 2009 | B2 |
20020069335 | Flynn, Jr. | Jun 2002 | A1 |
20020085493 | Pekkala et al. | Jul 2002 | A1 |
20020112102 | Tarui et al. | Aug 2002 | A1 |
20020129212 | Lee et al. | Sep 2002 | A1 |
20030061379 | Craddock et al. | Mar 2003 | A1 |
20030204648 | Arndt | Oct 2003 | A1 |
20030236852 | Fernandes et al. | Dec 2003 | A1 |
20040202189 | Arndt et al. | Oct 2004 | A1 |
20040205253 | Arndt et al. | Oct 2004 | A1 |
20040215915 | Block et al. | Oct 2004 | A1 |
20050039180 | Fultheim et al. | Feb 2005 | A1 |
20050076157 | Serizawa et al. | Apr 2005 | A1 |
20050091365 | Lowell et al. | Apr 2005 | A1 |
20050102682 | Shah et al. | May 2005 | A1 |
20050119996 | Ohata et al. | Jun 2005 | A1 |
20050120160 | Plouffe et al. | Jun 2005 | A1 |
20050182788 | Arndt et al. | Aug 2005 | A1 |
20050228861 | Arndt et al. | Oct 2005 | A1 |
20050240932 | Billau et al. | Oct 2005 | A1 |
20050246450 | Enko et al. | Nov 2005 | A1 |
20060044301 | Ha | Mar 2006 | A1 |
20060069828 | Goldsmith | Mar 2006 | A1 |
20060095690 | Craddock et al. | May 2006 | A1 |
20060112376 | Broberg et al. | May 2006 | A1 |
20060184349 | Goud et al. | Aug 2006 | A1 |
20060193327 | Arndt et al. | Aug 2006 | A1 |
20060195617 | Arndt et al. | Aug 2006 | A1 |
20060195619 | Arndt et al. | Aug 2006 | A1 |
20060195620 | Arndt et al. | Aug 2006 | A1 |
20060195623 | Arndt et al. | Aug 2006 | A1 |
20060195626 | Arndt et al. | Aug 2006 | A1 |
20060195634 | Arndt et al. | Aug 2006 | A1 |
20060195642 | Arndt et al. | Aug 2006 | A1 |
20060195644 | Arndt et al. | Aug 2006 | A1 |
20060195663 | Arndt et al. | Aug 2006 | A1 |
20060195673 | Arndt et al. | Aug 2006 | A1 |
20060195674 | Arndt et al. | Aug 2006 | A1 |
20060195675 | Arndt et al. | Aug 2006 | A1 |
20060195848 | Arndt et al. | Aug 2006 | A1 |
20060209724 | Arndt et al. | Sep 2006 | A1 |
20060209863 | Arndt et al. | Sep 2006 | A1 |
20060212606 | Arndt et al. | Sep 2006 | A1 |
20060212608 | Arndt et al. | Sep 2006 | A1 |
20060212620 | Arndt et al. | Sep 2006 | A1 |
20060224790 | Arndt et al. | Oct 2006 | A1 |
20060239287 | Johnsen et al. | Oct 2006 | A1 |
20060242330 | Torudbakken et al. | Oct 2006 | A1 |
20060242332 | Johnsen et al. | Oct 2006 | A1 |
20060242333 | Johnsen et al. | Oct 2006 | A1 |
20060242352 | Torudbakken et al. | Oct 2006 | A1 |
20060242354 | Johnsen et al. | Oct 2006 | A1 |
20060253619 | Torudbakken et al. | Nov 2006 | A1 |
Number | Date | Country |
---|---|---|
1508855 | Aug 2004 | EP |
Number | Date | Country | |
---|---|---|---|
20080168461 A1 | Jul 2008 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11066419 | Feb 2005 | US |
Child | 12054578 | US |