Storage device control method and apparatus, electronic device, and storage medium
By directly accessing the extended base address register space to obtain virtualization mapping information from the virtual machine client, a direct connection between the virtual machine client and the physical device is achieved, which solves the problems of increased load on the virtual machine host and low data access efficiency, and improves data access efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2026-03-17
AI Technical Summary
In cloud computing scenarios, when virtual machine clients use storage devices mounted on the virtual machine host, it increases the operating load on the virtual machine host and reduces data access efficiency.
By accessing the extended base address register space, the virtualization mapping information of the target physical device is obtained, enabling a direct connection between the virtual machine client and the target physical device, allowing direct operation on the target physical device and avoiding intermediate processing on the virtual machine host side.
It reduces the operating load on the virtual machine host and improves the data access efficiency between the virtual machine client and the physical device.
Smart Images

Figure CN117608757B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of cloud computing technology, and in particular to a storage device control method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, in cloud computing scenarios, storage costs for virtual machine clients are reduced by providing storage devices mounted locally on the virtual machine host to the virtual machine clients.
[0003] In existing technologies, when a virtual machine client uses a storage device mounted on the virtual machine host, it can increase the operating load on the virtual machine host and reduce data access efficiency. Summary of the Invention
[0004] This disclosure provides a storage device control method, apparatus, electronic device, and storage medium to overcome the problems of increased operating load on the virtual machine host and reduced data access efficiency.
[0005] In a first aspect, embodiments of this disclosure provide a storage device control method, including:
[0006] By accessing the extended base address register space, virtualization mapping information of the target physical device is obtained. The virtualization mapping information is used to establish a pass-through connection between the virtual machine client and the target physical device. The target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client. Based on the virtualization mapping information, a first operation request for the target virtual device is responded to, and the target physical device is operated on to obtain the operation result. The target virtual device is the virtualization device corresponding to the target physical device created within the virtual machine client.
[0007] In a second aspect, embodiments of this disclosure provide a storage device control apparatus, comprising:
[0008] The acquisition module is used to obtain the virtualization mapping information of the target physical device by accessing the extended base address register space. The virtualization mapping information is used to realize the pass-through connection between the virtual machine client and the target physical device. The target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client.
[0009] An operation module is configured to respond to a first operation request for a target virtual device based on the virtualization mapping information, perform an operation on the target physical device, and obtain an operation result, wherein the target virtual device is a virtualization device corresponding to the target physical device created within the virtual machine client.
[0010] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0011] The memory stores computer-executed instructions;
[0012] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the storage device control method as described in the first aspect and various possible designs of the first aspect.
[0013] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the storage device control method described in the first aspect and various possible designs of the first aspect.
[0014] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the storage device control method described in the first aspect and various possible designs of the first aspect.
[0015] The storage device control method, apparatus, electronic device, and storage medium provided in this embodiment obtain virtualization mapping information of a target physical device by accessing the extended base address register space. This virtualization mapping information enables a direct connection between the virtual machine client and the target physical device, where the target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client. Based on the virtualization mapping information, a first operation request for the target virtual device is responded to, and an operation is performed on the target physical device to obtain an operation result. Here, the target virtual device is a virtualized device corresponding to the target physical device created within the virtual machine client. By transparently transmitting the virtualization mapping information of the target physical device to the virtual machine client, the virtual machine client can establish a direct connection with the target physical device mounted on the virtual machine host based on this virtualization mapping information, thereby reducing the operating load on the virtual machine host and improving the data access efficiency between the virtual machine client and the physical device. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is an application scenario diagram of the storage device control method provided in the embodiments of this disclosure;
[0018] Figure 2 Flowchart of the storage device control method provided in the embodiments of this disclosure Figure 1 ;
[0019] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;
[0020] Figure 4 This is a schematic diagram illustrating the process of a virtual machine client controlling a target physical device, as provided in an embodiment of this disclosure.
[0021] Figure 5 Flowchart of the storage device control method provided in the embodiments of this disclosure Figure 2 ;
[0022] Figure 6 for Figure 5 A flowchart illustrating the specific implementation of step S205 in the illustrated embodiment;
[0023] Figure 7 for Figure 5 A flowchart illustrating the specific implementation of step S207 in the illustrated embodiment;
[0024] Figure 8 This is a schematic diagram illustrating a process for controlling a target physical device, provided as an embodiment of the present disclosure.
[0025] Figure 9 A structural block diagram of a storage device control apparatus provided in an embodiment of this disclosure;
[0026] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0027] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0029] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0030] The application scenarios of the embodiments of this disclosure are explained below:
[0031] Figure 1 This diagram illustrates an application scenario of the storage device control method provided in this disclosure. The storage device control method provided in this disclosure can be applied to application scenarios such as cloud computing and cloud services. More specifically, it can be applied in a private cloud scenario during the process of a virtual machine client (guest) accessing a solid-state drive (NVMe SSD) mounted on a virtual machine host (host) based on the Non-Volatile Memory Express Solid State Disk (NVMe SSD) specification. The executing entity in this embodiment can be a terminal device or server running the virtual machine client, or other electronic devices that perform similar functions. (See reference...) Figure 1 As shown, multiple virtual machine clients (guests) are created by deploying a virtual machine host within a cloud server, such as guest_0 and guest_1 shown in the diagram. A virtual machine client is a complete computer system simulated by software, possessing full hardware system functionality and running in an isolated environment. On the cloud server side where the virtual machine host is deployed, physical storage devices, such as NVMe SSDs, are mounted. The virtual machine clients can control these physical storage devices via control commands, such as reading and writing data, thereby enabling them to use the storage devices mounted on the virtual machine host. This approach allows for flexible adjustment of the hardware resources provided to the virtual machine clients, reducing the maintenance and adjustment costs of the entire virtual machine system.
[0032] In existing technologies, when a virtual machine client needs to use the physical storage device, it requires the virtual machine host to provide computing resources. For example, after the virtual machine client submits a data access request, the software running on the virtual machine client interacts with the physical storage device. In this case, the virtual machine host needs to consume additional threads to process the data access, resulting in additional computing resource consumption on the virtual machine host and causing latency in the data processing. This leads to increased workload on the virtual machine host and reduced data access efficiency.
[0033] This disclosure provides a storage device control method to solve the above-mentioned problems.
[0034] refer to Figure 2 , Figure 2 Flowchart of the storage device control method provided in the embodiments of this disclosure Figure 1 The method of this embodiment can be applied to terminal devices or servers running virtual machine clients. The storage device control method includes:
[0035] Step S101: Obtain the virtualization mapping information of the target physical device by accessing the extended base address register space. The virtualization mapping information is used to realize the pass-through connection between the virtual machine client and the target physical device. The target physical device is the storage device mounted on the virtual machine host corresponding to the virtual machine client.
[0036] Step S102: Based on the virtualization mapping information, respond to the first operation request for the target virtual device, perform the operation on the target physical device, and obtain the operation result. The target virtual device is the virtualization device corresponding to the target physical device created in the virtual machine client.
[0037] For example, refer to Figure 1 The illustrated application scenario diagram shows that after a virtual machine client (instance) is created on the virtual machine host, the virtual machine client runs as a complete computer system. Within the virtual machine client, a target virtual device, such as a virtualized disk, is configured. When the target virtual device needs to store or retrieve data from the virtualized disk based on user commands or program execution logic, the target virtual device receives or generates a first operation request. This first operation request is directed at the target virtual device, but due to the implementation principle of virtual machines, the final operation data will be written to or retrieved from the target physical device.
[0038] Furthermore, in response to the first operation request for the target virtual device, the virtual machine client needs to utilize the virtualization mapping information of the target physical device to perform data write or data read operations on the target physical device. The virtualization mapping information is used to establish a direct connection between the virtual machine client and the target physical device, so that the virtual machine client can control the virtualization mapping information without the virtual machine host processing the first operation request.
[0039] Furthermore, this virtualization mapping information is stored in the extended base address register space. The virtual machine client obtains the virtualization mapping information of the target physical device by accessing the extended base address register space, and then responds to the first operation request based on this virtualization mapping information. The base address register (BAR) is a concept in the PCIe standard. It exists in the configuration space and is used to determine the size of the system memory space required by a function and to provide the base address for mapping to the function's memory space. The space corresponding to each base address register is the base address register space. The operating system or functional program on the virtual machine host can set the contents of this base address register. The specific implementation and operation method of the base address register are existing technologies and will not be elaborated further here. The extended base address register space in this embodiment can be understood as a Bar that is custom-set in the configuration space. More specifically, for example, it is Bar5 (i.e., the 5th base address register in the configuration space), which is the extended base address register identifier. Through this extended base address register identifier, access to the extended base address register space of the target virtual device can be achieved. By storing virtualization mapping information in this custom base address register space and sending it to the virtual machine client, the virtual machine client can obtain the virtualization mapping information of the target physical device, thereby achieving a pass-through connection between the virtual machine client and the target physical device. This enables the virtual machine client to directly control and operate the target physical device, obtaining operation results such as an identifier indicating successful storage on the target physical device, or specific data read from the target physical device.
[0040] Furthermore, in one possible implementation, such as Figure 3 As shown, the specific implementation of step S102 includes:
[0041] Step S1021: Based on the virtualization mapping information, convert the first operation request into a second operation request for the target physical device;
[0042] Step S1022: Send a second operation request to the target physical device to perform an operation on the target physical device and obtain the operation result returned by the target physical device.
[0043] For example, upon obtaining virtualization mapping information, a first operation request for a virtual device is converted into a second operation request for a physical device based on the virtualization mapping information (that is, converting the IO submission of the virtual disk into the IO submission of the physical disk), thereby achieving pass-through control of the physical device without the involvement of the virtual machine host.
[0044] Figure 4 This is a schematic diagram illustrating the process of a virtual machine client controlling a target physical device according to an embodiment of this disclosure. The following is in conjunction with... Figure 4 To explain the above process in more detail, such as... Figure 4 As shown, firstly, after the virtual machine client initializes, it creates a target virtual device corresponding to the target physical device. Then, the virtual machine client obtains the virtualization mapping information by accessing the extended base address register space of the target virtual device. Next, when the virtual machine client receives a first operation request for the target virtual device, it uses the virtualization mapping information to convert the first operation request into a second operation request and sends the second operation request to the target physical device to perform operations, thus establishing a pass-through connection between the virtual machine client and the target physical device.
[0045] In this embodiment, the virtualization mapping information of the target physical device is obtained by accessing the extended base address register space. This virtualization mapping information enables a direct connection between the virtual machine client and the target physical device, which is a storage device mounted on the virtual machine host corresponding to the virtual machine client. Based on the virtualization mapping information, a first operation request for the target virtual device is responded to, and the target physical device is operated on to obtain the operation result. Here, the target virtual device is the virtualized device corresponding to the target physical device created within the virtual machine client. By transparently transmitting the virtualization mapping information of the target physical device to the virtual machine client, the virtual machine client can establish a direct connection with the target physical device mounted on the virtual machine host based on this virtualization mapping information, thereby reducing the operating load on the virtual machine host and improving the data access efficiency between the virtual machine client and the physical device.
[0046] refer to Figure 5 , Figure 5 Flowchart of the storage device control method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, steps S101-S102 are further refined. For example, the virtualization mapping information includes at least one of first mapping information, second mapping information, and third mapping information. The storage device control method includes:
[0047] Step S201: Create a target virtual device by calling the device driver of the target physical device, wherein the device driver contains the extended base address register identifier of the target virtual device.
[0048] Step S202: Receive configuration instructions sent by the virtual machine host. The configuration instructions contain virtualization mapping information.
[0049] Step S203: In response to the configuration instruction, write the virtualization mapping information into the extended base address register space of the target virtual device.
[0050] For example, the virtual machine client creates a target virtual device by calling the device driver (e.g., NVMe driver) of the target physical device. Simultaneously, the virtual machine client receives configuration instructions from the virtual machine host, which contain virtualization mapping information corresponding to the target physical device. This configuration instruction is then written into the extended base address register space of the target virtual device. This process can be the initialization process of the target virtual device or the target physical device. Specifically, during the initialization of the target virtual device or the target physical device, the virtual machine host mounting the target physical device transparently transmits the virtualization mapping information of the target physical device to the virtual machine client and stores it in a specified location (extended base address register space).
[0051] Step S204: Based on the device driver or the target virtual device, obtain the extended base address register identifier of the target virtual device.
[0052] Step S205: Based on the extended base address register identifier, access the extended base address register space of the target virtual device to obtain the virtualization mapping information.
[0053] For example, the extended base address register identifier of the target virtual device is then obtained by accessing the interface provided by the device driver or by accessing the attributes of the target virtual device. The extended base address register identifier is an identification identifier of the base address register identifier, used to distinguish between different base address register identifiers. The extended base address register identifier is, for example, BAR5, or the virtual address of the extended base address register.
[0054] For example, such as Figure 6 As shown, the specific implementation of step S205 includes:
[0055] Step S2051: Using the extended base address register identifier as the input parameter, call the input / input remapping method to obtain the extended base address register space address of the target virtual device.
[0056] Step S2052: Access the extended base address register space address to obtain virtualization mapping information.
[0057] For example, the input / input remapping method, ioremap(), is a function in the Linux kernel that maps physical addresses to the kernel virtual address space. For the ioremap function, knowing the virtual address addr and the physical address: register address (the passed parameter), the mapping function is directly called to program the MMU, establishing the mapping relationship between addr and the register address. The specific parameters, implementation, and calling method of the ioremap function are existing technologies and will not be elaborated here. By calling this input / input remapping method with the extended base address register identifier as the input parameter, the extended base address register space address of the target virtual device can be obtained. Then, by accessing the extended base address register space address, the virtualization mapping information stored within the extended base address register space can be obtained.
[0058] Step S206: Obtain the first direct memory access address of the target operation data corresponding to the first operation request.
[0059] Step S207: Based on the first mapping information, obtain the second direct memory access address corresponding to the first direct memory access address. The first mapping information is used to characterize the mapping relationship between the direct memory access address of the operation data in the virtual machine client and the direct memory access address of the operation data in the virtual machine host.
[0060] For example, a Direct Memory Access (DMA) address, also known as a DMA memory address, refers to the memory address of the data to be accessed by the DMA, which is a fast data transfer technique used to enable input / output (I / O) devices to directly access memory. In this embodiment, the first DMA address is the virtual address corresponding to the target virtual device before conversion, while the second DMA address obtained after conversion using the first mapping information is the DMA address within the virtual machine host. The mapping of the DMA address is achieved through the first mapping information. This process is also called DMA remapping.
[0061] In this embodiment, the direct memory access address (first direct memory access address) corresponding to the target virtual device is mapped to the direct memory access address (second direct memory access address) in the virtual machine host through the first mapping information, thereby realizing the DMA remapping process. Since the steps are executed on the virtual machine client side, the additional computing resource overhead on the virtual machine host side can be reduced, and the resource consumption on the virtual machine host side can be reduced.
[0062] For example, further, the first mapping information includes an Input / Output Memory Management Unit (IOMMU) address mapping, such as... Figure 7 As shown, the specific implementation of step S207 includes:
[0063] Step S2071: Generate a virtual input / output memory management unit address mapping based on the input / output memory management unit address mapping;
[0064] Step S2072: Based on the virtual input / output memory management unit address mapping, obtain the second direct memory access address corresponding to the first direct memory access address.
[0065] For example, the first mapping information includes IOMMU page table information. IOMMU, or Input / Output Memory Management Unit, connects the DMA-capable I / O bus (Direct Memory Access-capable I / O Bus) and main memory. IOMMU translates virtual addresses accessed by physical devices into physical addresses. IOMMU allows virtual devices to address within virtual memory, mapping virtual memory addresses to physical memory addresses, enabling physical devices to operate in a virtual memory environment (i.e., the virtual machine client). By passing the IOMMU page table information to the virtual machine client, the client, upon receiving the relevant information, constructs the corresponding Virtual Input / Output Memory Management Unit (VIOMMU) address mapping, i.e., the VIOMMU page table information. VIOMMU is the IOMMU function running in the virtual machine client, used to translate the virtual memory addresses accessed by the target virtual device into corresponding physical memory addresses. Subsequently, based on the address mapping of the Virtual Input / Output Memory Management Unit, the first direct memory access address is mapped to the corresponding second direct memory access address, which is the direct memory access address of the target physical device within the virtual machine host.
[0066] Further, optionally, in one possible implementation, after obtaining the second direct memory access address, combined with other preset information, such as the nid, qid, slba, etc. of the target physical device, a second operation request is generated based on the second direct memory access address.
[0067] In another possible implementation, the virtualization mapping information includes second mapping information, which characterizes the mapping relationship between the logical block address of the virtual device and the logical block address of the physical device, and further includes:
[0068] Step S208: Obtain the first logical block address of the target virtual device.
[0069] Step S209: Based on the second mapping information, obtain the second logical block address of the target physical device.
[0070] Step S210: Generate a second operation request based on the second direct memory access address and the second logical block address.
[0071] For example, further, the first logical block address (LBA) of the target virtual device is obtained, where the logical block address (LBA) can refer to the address of a data block or the data block pointed to by an address. The first logical block address corresponding to the target virtual device is a virtual address in the virtual machine client environment. Through the second mapping information, it is converted into the second logical block address corresponding to the target physical device, i.e., the actual physical address. This process is the I / O translation process. Then, based on the second direct memory access address and the second logical block address, a second operation request is generated.
[0072] Optionally, in one possible implementation, the virtualization mapping information also includes third mapping information, which is used to characterize the mapping relationship between the queue identifier of the physical device and the queue identifier of the virtual device.
[0073] Accordingly, the method in this embodiment also includes:
[0074] Step S211: Obtain the first queue identifier of the target virtual read / write submission queue corresponding to the first operation request.
[0075] Step S212: Based on the third mapping information and the first queue identifier, obtain the second queue identifier of the physical read / write submission queue of the target physical device.
[0076] Step S213: Determine the target physical read / write submission queue of the target physical device through the second queue identifier.
[0077] Step S214: Send a second operation request to the target physical read / write submission queue of the target physical device.
[0078] Step S215: After the target physical read / write submission queue responds to the second operation request, receive the operation result returned by the target physical read / write completion queue of the target physical device, and store the operation result in the virtual read / write completion queue corresponding to the virtual read / write submission queue.
[0079] For example, the Virtual IO Submission Queue (VIOSQ) in this embodiment is a virtual queue used to submit data requests in the virtual machine client environment, corresponding to the target virtual device. The virtualization mapping information also includes third mapping information representing the mapping relationship between the queue identifier (Queue ID, qid) of the physical device and the queue identifier of the virtual device. Through this third mapping information, the mapping between the read / write submission queue of the target virtual device and the physical read / write submission queue (IO Submission Queue, IOSQ) of the target physical device can be realized, thereby achieving pass-through between the two. Specifically, after obtaining the third mapping information by extending the base address register space, the virtual machine client maps the first queue identifier (qid) of the virtual read / write submission queue (VIOSQ) corresponding to the target virtual device indicated by the first operation request to the corresponding second queue identifier, and then determines the target physical read / write submission queue (IOSQ) of the target physical device based on the second queue identifier.
[0080] Next, a second operation request is sent to the target physical read / write commit queue of the target physical device. The target physical read / write commit queue processes this second operation request sequentially. After the target physical read / write commit queue responds to the second operation request, it generates the corresponding operation result and stores it in the corresponding target physical read / write completion queue (IO CompletionQueue, IOCQ). Then, the target physical read / write completion queue sends the operation result to the target virtual read / write completion queue (Virtual IO Completion Queue, VIOCQ) in the target virtual device for storage, thus completing the purpose of returning the operation result to the virtual machine client. The physical read / write commit queue and the physical read / write completion queue are task queues in the virtual machine client environment, residing in the virtual machine client's memory.
[0081] Figure 8 This is a schematic diagram illustrating a process for controlling a target physical device according to an embodiment of the present disclosure. The following is in conjunction with... Figure 8 The above process will be described as follows: Figure 8As shown, after receiving the virtualization mapping information sent by the virtual machine host, the virtual machine client responds to the user's input command and sends a first operation request cmd_1 (shown as cmd_1 in the figure) to the virtual read / write commit queue VIOSQ. Then, the virtual read / write commit queue converts the first operation request cmd_1 into a second operation request cmd_2 (shown as cmd_2 in the figure) through a conversion module and sends it to the physical read / write commit queue IOSQ in the target physical device. The conversion module obtains the virtualization mapping information Info (shown as Info in the figure) and converts the first operation request cmd_1 into the second operation request cmd_2 based on the virtualization mapping information Info. Subsequently, the physical read / write commit queue IOSQ responds to the second operation request cmd_2, performs an operation on the target physical device, such as writing operation data, and sends the operation result (shown as result in the figure) to the physical read / write completion queue IOCQ after being processed by the conversion module. Then, the physical read / write completion queue IOCQ returns the operation result result to the virtual read / write completion queue VIOCQ corresponding to the target virtual device, thereby realizing the process of returning the operation result to the virtual machine client.
[0082] Corresponding to the storage device control method in the above embodiments, Figure 9 This is a structural block diagram of a storage device control apparatus provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 9 The storage device control unit 3 includes:
[0083] The acquisition module 31 is used to obtain the virtualization mapping information of the target physical device by accessing the extended base address register space. The virtualization mapping information is used to realize the pass-through connection between the virtual machine client and the target physical device. The target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client.
[0084] The operation module 32 is used to respond to the first operation request for the target virtual device based on the virtualization mapping information, perform operations on the target physical device, and obtain the operation result. The target virtual device is the virtualization device corresponding to the target physical device created in the virtual machine client.
[0085] In one embodiment of this disclosure, the acquisition module 31 is specifically used to: acquire the extended base address register identifier of the target virtual device; and access the extended base address register space of the target virtual device according to the extended base address register identifier to obtain virtualization mapping information.
[0086] In one embodiment of this disclosure, when the acquisition module 31 accesses the extended base address register space of the target virtual device based on the extended base address register identifier to obtain virtualization mapping information, it is specifically used to: call the input / input remapping method with the extended base address register identifier as the input parameter to obtain the extended base address register space address of the target virtual device; and access the extended base address register space address to obtain virtualization mapping information.
[0087] In one embodiment of this disclosure, before obtaining the extended base address register identifier of the target virtual device, the obtaining module 31 is further configured to: create a target virtual device by calling the device driver of the target physical device, wherein the device driver contains the extended base address register identifier of the target virtual device; when obtaining the extended base address register identifier of the target virtual device, the obtaining module 31 is specifically configured to: obtain the extended base address register identifier of the target virtual device based on the device driver or the target virtual device.
[0088] In one embodiment of this disclosure, the acquisition module 31 is further configured to: receive a configuration instruction sent by the virtual machine host, the configuration instruction containing virtualization mapping information; and, in response to the configuration instruction, write the virtualization mapping information into the extended base address register space of the target virtual device.
[0089] In one embodiment of this disclosure, the operation module 32 is specifically used to: convert a first operation request into a second operation request for a target physical device based on virtualization mapping information; send the second operation request to the target physical device to perform an operation on the target physical device, and obtain the operation result returned by the target physical device.
[0090] In one embodiment of this disclosure, the virtualization mapping information includes first mapping information, which characterizes the mapping relationship between the direct memory access address of the operation data in the virtual machine client and the direct memory access address of the operation data in the virtual machine host. When the operation module 32 converts the first operation request into a second operation request for the target physical device based on the virtualization mapping information, it is specifically used to: obtain the first direct memory access address of the target operation data corresponding to the first operation request; obtain the second direct memory access address corresponding to the first direct memory access address based on the first mapping information; and generate the second operation request based on the second direct memory access address.
[0091] In one embodiment of this disclosure, the virtualization mapping information includes second mapping information, which is used to characterize the mapping relationship between the logical block address of the virtual device and the logical block address of the physical device; the operation module 32 is further configured to: obtain the first logical block address of the target virtual device; obtain the second logical block address of the target physical device based on the second mapping information; when the operation module 32 generates a second operation request based on the second direct memory access address, it is specifically configured to: generate a second operation request based on the second direct memory access address and the second logical block address.
[0092] In one embodiment of this disclosure, the first mapping information includes an input / output memory management unit address mapping; when the operation module 32 obtains the second direct memory access address corresponding to the first direct memory access address based on the first mapping information, it is specifically used to: generate a virtual input / output memory management unit address mapping based on the input / output memory management unit address mapping; and obtain the second direct memory access address corresponding to the first direct memory access address based on the virtual input / output memory management unit address mapping.
[0093] In one embodiment of this disclosure, the virtualization mapping information includes device third mapping information, which is used to characterize the mapping relationship between the queue identifier of the physical device and the queue identifier of the virtual device. The operation module 32 is further configured to: obtain the first queue identifier of the target virtual read / write submission queue corresponding to the first operation request; obtain the second queue identifier of the physical read / write submission queue of the target physical device based on the third mapping information and the first queue identifier; when the operation module 32 sends a second operation request to the target physical device to perform an operation on the target physical device and obtains the operation result returned by the target physical device, it is specifically configured to: determine the target physical read / write submission queue of the target physical device through the second queue identifier; send the second operation request to the target physical read / write submission queue of the target physical device; after the target physical read / write submission queue responds to the second operation request, receive the operation result returned by the target physical read / write completion queue of the target physical device, and store the operation result in the virtual read / write completion queue corresponding to the virtual read / write submission queue.
[0094] The acquisition module 31 and the operation module 32 are connected. The storage device control 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0095] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 10 As shown, the electronic device 4 includes:
[0096] Processor 41, and memory 42 communicatively connected to processor 41;
[0097] Memory 42 stores instructions executed by the computer;
[0098] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-8 Storage device control method in the illustrated embodiment.
[0099] Optionally, the processor 41 and the memory 42 are connected via a bus 43.
[0100] For relevant instructions, please refer to the corresponding text. Figures 2-8 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0101] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-8 The storage device control method provided in any of the corresponding embodiments.
[0102] To implement the above embodiments, this disclosure also provides an electronic device.
[0103] refer to Figure 11 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0104] like Figure 11As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0105] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0106] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0107] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0108] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0109] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0110] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] In a first aspect, according to one or more embodiments of the present disclosure, a storage device control method is provided, comprising:
[0116] By accessing the extended base address register space, virtualization mapping information of the target physical device is obtained. The virtualization mapping information is used to establish a pass-through connection between the virtual machine client and the target physical device. The target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client. Based on the virtualization mapping information, a first operation request for the target virtual device is responded to, and the target physical device is operated on to obtain the operation result. The target virtual device is the virtualization device corresponding to the target physical device created within the virtual machine client.
[0117] According to one or more embodiments of this disclosure, obtaining virtualization mapping information of a target physical device by accessing the extended base address register space includes: obtaining the extended base address register identifier of the target virtual device; and accessing the extended base address register space of the target virtual device based on the extended base address register identifier to obtain the virtualization mapping information.
[0118] According to one or more embodiments of this disclosure, the step of accessing the extended base address register space of the target virtual device based on the extended base address register identifier to obtain the virtualization mapping information includes: using the extended base address register identifier as an input parameter, calling an input / input remapping method to obtain the extended base address register space address of the target virtual device; and accessing the extended base address register space address to obtain the virtualization mapping information.
[0119] According to one or more embodiments of this disclosure, before obtaining the extended base address register identifier of the target virtual device, the method further includes: creating the target virtual device by calling the device driver of the target physical device, wherein the device driver contains the extended base address register identifier of the target virtual device; obtaining the extended base address register identifier of the target virtual device includes: obtaining the extended base address register identifier of the target virtual device based on the device driver or the target virtual device.
[0120] According to one or more embodiments of this disclosure, the method further includes: receiving a configuration instruction sent by a virtual machine host, the configuration instruction containing the virtualization mapping information; and in response to the configuration instruction, writing the virtualization mapping information into the extended base address register space of the target virtual device.
[0121] According to one or more embodiments of this disclosure, the step of responding to a first operation request for a target virtual device based on the virtualization mapping information, operating on the target physical device, and obtaining an operation result includes: converting the first operation request into a second operation request for the target physical device based on the virtualization mapping information; sending the second operation request to the target physical device to operate on the target physical device, and obtaining an operation result returned by the target physical device.
[0122] According to one or more embodiments of this disclosure, the virtualization mapping information includes first mapping information, which characterizes the mapping relationship between the direct memory access address of the operation data in the virtual machine client and the direct memory access address of the operation data in the virtual machine host. Based on the virtualization mapping information, converting the first operation request into a second operation request for the target physical device includes: obtaining a first direct memory access address of the target operation data corresponding to the first operation request; obtaining a second direct memory access address corresponding to the first direct memory access address based on the first mapping information; and generating the second operation request based on the second direct memory access address.
[0123] According to one or more embodiments of this disclosure, the virtualization mapping information includes second mapping information, which is used to characterize the mapping relationship between the logical block address of a virtual device and the logical block address of a physical device; the method further includes: obtaining a first logical block address of the target virtual device; obtaining a second logical block address of the target physical device based on the second mapping information; and generating a second operation request based on the second direct memory access address, including: generating the second operation request based on the second direct memory access address and the second logical block address.
[0124] According to one or more embodiments of this disclosure, the first mapping information includes an input / output memory management unit address mapping; obtaining a second direct memory access address corresponding to the first direct memory access address based on the first mapping information includes: generating a virtual input / output memory management unit address mapping based on the input / output memory management unit address mapping; and obtaining a second direct memory access address corresponding to the first direct memory access address based on the virtual input / output memory management unit address mapping.
[0125] According to one or more embodiments of this disclosure, the virtualization mapping information includes device third mapping information, which is used to characterize the mapping relationship between the queue identifier of the physical device and the queue identifier of the virtual device; the method further includes: obtaining a first queue identifier of the target virtual read / write submission queue corresponding to the first operation request; obtaining a second queue identifier of the physical read / write submission queue of the target physical device based on the third mapping information and the first queue identifier; sending the second operation request to the target physical device to operate on the target physical device and obtaining the operation result returned by the target physical device includes: determining the target physical read / write submission queue of the target physical device through the second queue identifier; sending the second operation request to the target physical read / write submission queue of the target physical device; after the target physical read / write submission queue responds to the second operation request, receiving the operation result returned by the target physical read / write completion queue of the target physical device, and storing the operation result in the virtual read / write completion queue corresponding to the virtual read / write submission queue.
[0126] Secondly, according to one or more embodiments of the present disclosure, a storage device control apparatus is provided, comprising:
[0127] The acquisition module is used to obtain the virtualization mapping information of the target physical device by accessing the extended base address register space. The virtualization mapping information is used to realize the pass-through connection between the virtual machine client and the target physical device. The target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client.
[0128] An operation module is configured to respond to a first operation request for a target virtual device based on the virtualization mapping information, perform an operation on the target physical device, and obtain an operation result, wherein the target virtual device is a virtualization device corresponding to the target physical device created within the virtual machine client.
[0129] According to one or more embodiments of this disclosure, the acquisition module is specifically configured to: acquire the extended base address register identifier of the target virtual device; and access the extended base address register space of the target virtual device according to the extended base address register identifier to obtain the virtualization mapping information.
[0130] According to one or more embodiments of this disclosure, when the acquisition module accesses the extended base address register space of the target virtual device based on the extended base address register identifier to obtain the virtualization mapping information, it is specifically used to: call an input / input remapping method with the extended base address register identifier as an input parameter to obtain the extended base address register space address of the target virtual device; and access the extended base address register space address to obtain the virtualization mapping information.
[0131] According to one or more embodiments of this disclosure, before obtaining the extended base address register identifier of the target virtual device, the obtaining module is further configured to: create the target virtual device by calling the device driver of the target physical device, wherein the device driver contains the extended base address register identifier of the target virtual device; when obtaining the extended base address register identifier of the target virtual device, the obtaining module is specifically configured to: obtain the extended base address register identifier of the target virtual device based on the device driver or the target virtual device.
[0132] According to one or more embodiments of this disclosure, the acquisition module is further configured to: receive a configuration instruction sent by a virtual machine host, the configuration instruction containing the virtualization mapping information; and, in response to the configuration instruction, write the virtualization mapping information into the extended base address register space of the target virtual device.
[0133] According to one or more embodiments of this disclosure, the operation module is specifically configured to: convert the first operation request into a second operation request for the target physical device based on the virtualization mapping information; send the second operation request to the target physical device to perform an operation on the target physical device, and obtain the operation result returned by the target physical device.
[0134] According to one or more embodiments of this disclosure, the virtualization mapping information includes first mapping information, which characterizes the mapping relationship between the direct memory access address of the operation data in the virtual machine client and the direct memory access address of the operation data in the virtual machine host. When the operation module converts the first operation request into a second operation request for the target physical device based on the virtualization mapping information, it is specifically configured to: obtain the first direct memory access address of the target operation data corresponding to the first operation request; obtain the second direct memory access address corresponding to the first direct memory access address based on the first mapping information; and generate the second operation request based on the second direct memory access address.
[0135] According to one or more embodiments of this disclosure, the virtualization mapping information includes second mapping information, which is used to characterize the mapping relationship between the logical block address of the virtual device and the logical block address of the physical device; the operation module is further configured to: obtain the first logical block address of the target virtual device; and obtain the second logical block address of the target physical device based on the second mapping information; when the operation module generates the second operation request based on the second direct memory access address, it is specifically configured to: generate the second operation request based on the second direct memory access address and the second logical block address.
[0136] According to one or more embodiments of this disclosure, the first mapping information includes an input / output memory management unit address mapping; when the operation module obtains the second direct memory access address corresponding to the first direct memory access address based on the first mapping information, it is specifically used to: generate a virtual input / output memory management unit address mapping based on the input / output memory management unit address mapping; and obtain the second direct memory access address corresponding to the first direct memory access address based on the virtual input / output memory management unit address mapping.
[0137] According to one or more embodiments of this disclosure, the virtualization mapping information includes device third mapping information, which is used to characterize the mapping relationship between the queue identifier of the physical device and the queue identifier of the virtual device; the operation module is further configured to: obtain the first queue identifier of the target virtual read / write submission queue corresponding to the first operation request; obtain the second queue identifier of the physical read / write submission queue of the target physical device based on the third mapping information and the first queue identifier; when the operation module sends the second operation request to the target physical device to operate on the target physical device and obtains the operation result returned by the target physical device, it is specifically configured to: determine the target physical read / write submission queue of the target physical device through the second queue identifier; send the second operation request to the target physical read / write submission queue of the target physical device; after the target physical read / write submission queue responds to the second operation request, receive the operation result returned by the target physical read / write completion queue of the target physical device, and store the operation result in the virtual read / write completion queue corresponding to the virtual read / write submission queue.
[0138] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0139] The memory stores computer-executed instructions;
[0140] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the storage device control method as described in the first aspect and various possible designs of the first aspect.
[0141] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the storage device control method described in the first aspect and various possible designs of the first aspect is implemented.
[0142] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the storage device control method as described in the first aspect and various possible designs of the first aspect.
[0143] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0144] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0145] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A storage device control method characterized by comprising: The method comprises the following steps: obtaining virtualization mapping information of a target physical device by accessing an extended base address register space, wherein the virtualization mapping information is provided by a virtual machine host and is used to realize direct connection between a virtual machine client and the target physical device, and the target physical device is a storage device mounted on the virtual machine host corresponding to the virtual machine client; performing an operation on the target physical device based on the virtualization mapping information and in response to a first operation request for a target virtual device, and obtaining an operation result, wherein the target virtual device is a virtualization device corresponding to the target physical device and is created in the virtual machine client.
2. The method of claim 1, wherein, The method of obtaining the virtualization mapping information of the target physical device by accessing the extended base address register space comprises the following steps: obtaining an extended base address register identifier of the target virtual device; accessing an extended base address register space of the target virtual device based on the extended base address register identifier, and obtaining the virtualization mapping information.
3. The method of claim 2, wherein, The method of accessing the extended base address register space of the target virtual device based on the extended base address register identifier and obtaining the virtualization mapping information comprises the following steps: calling an input / output remapping method with the extended base address register identifier as an input parameter, obtaining an extended base address register space address of the target virtual device; accessing the extended base address register space address, and obtaining the virtualization mapping information.
4. The method of claim 2, wherein, Before the step of obtaining the extended base address register identifier of the target virtual device, the method further comprises the following steps: creating the target virtual device by calling a device driver of the target physical device, wherein the device driver is provided with the extended base address register identifier of the target virtual device; The method of obtaining the extended base address register identifier of the target virtual device comprises the following steps: obtaining the extended base address register identifier of the target virtual device based on the device driver or the target virtual device.
5. The method of claim 1, wherein, The method further comprises the following steps: receiving a configuration instruction sent by the virtual machine host, wherein the configuration instruction contains the virtualization mapping information; writing the virtualization mapping information into the extended base address register space of the target virtual device in response to the configuration instruction.
6. The method of claim 1, wherein, The method of performing the operation on the target physical device based on the virtualization mapping information and in response to the first operation request for the target virtual device, and obtaining the operation result comprises the following steps: converting the first operation request into a second operation request for the target physical device based on the virtualization mapping information; sending the second operation request to the target physical device to perform the operation on the target physical device, and obtaining an operation result returned by the target physical device.
7. The method of claim 6, wherein, The virtualization mapping information comprises first mapping information, and the first mapping information is used to represent a mapping relationship between a direct memory access address of operation data in a virtual machine client and a direct memory access address of the operation data in a virtual machine host; The method of converting the first operation request into the second operation request for the target physical device based on the virtualization mapping information comprises the following steps: obtain a first direct memory access address corresponding to the target operation data of the first operation request; obtain a second direct memory access address corresponding to the first direct memory access address based on the first mapping information; generate the second operation request based on the second direct memory access address.
8. The method of claim 7, wherein, The virtualization mapping information includes second mapping information, and the second mapping information is used to represent a mapping relationship between a logical block address of a virtual device and a logical block address of a physical device; the method further includes: obtain a first logical block address of the target virtual device; obtain a second logical block address of the target physical device based on the second mapping information; generate the second operation request based on the second direct memory access address and the second logical block address. The first mapping information includes input / output memory management unit address mapping; 9. The method of claim 7, wherein, obtain a second direct memory access address corresponding to the first direct memory access address based on the first mapping information, including: generate a virtual input / output memory management unit address mapping based on the input / output memory management unit address mapping; obtain a second direct memory access address corresponding to the first direct memory access address based on the virtual input / output memory management unit address mapping. The virtualization mapping information includes third mapping information of a device, and the third mapping information is used to represent a mapping relationship between a queue identifier of a physical device and a queue identifier of a virtual device; the method further includes:
10. The method of claim 6, wherein, obtain a first queue identifier of a target virtual read / write commit queue corresponding to the first operation request; obtain a second queue identifier of a physical read / write commit queue of the target physical device based on the third mapping information and the first queue identifier; The sending, to the target physical device, of the second operation request to operate on the target physical device and obtaining of an operation result returned by the target physical device, includes: determine a target physical read / write commit queue of the target physical device through the second queue identifier; send the second operation request to the target physical read / write commit queue of the target physical device; after the target physical read / write commit queue responds to the second operation request, receive an operation result returned by a target physical read / write completion queue of the target physical device, and store the operation result in a virtual read / write completion queue corresponding to the virtual read / write commit queue. includes:
11. A storage device control apparatus characterized by comprising: an obtaining module, configured to obtain virtualization mapping information of a target physical device by accessing an extended base address register space, wherein the virtualization mapping information is provided by a virtual machine host end, and is used to realize a pass-through connection between a virtual machine client and the target physical device, and the target physical device is a storage device mounted on the virtual machine host end corresponding to the virtual machine client; An operation module is configured to operate the target physical device based on the virtualization mapping information and in response to a first operation request for a target virtual device, to obtain an operation result, wherein the target virtual device is a virtualization device corresponding to the target physical device and created in the virtual machine client.
12. An electronic device, comprising: The method comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the storage device control method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the storage device control method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the storage device control method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Testing method and device for equipment driving unit
CN114610557A
Storage device virtualization processing method, bridging device, system and medium
CN116774933A