IP Library Granted Patent US 12,461,848
Granted Patent B2
US 12,461,848 · App. 18/685,060 · Granted Nov 4, 2025

Memory paging method and system, and storage medium

Inventor: Yun Xu (Hangzhou, CN)
Assignee: HANGZHOU ALICLOUD FEITIAN INFORMATION TECHNOLOGY CO., LTD.
G06F12/023G06F3/061G06F3/0655G06F3/0679G06F9/45558G06F2009/45583G06F2212/72
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,461,848
App. No.
18/685,060
Granted
Nov 4, 2025
Kind
B2
Abstract

A memory paging method and system, and a storage medium are provided. In the embodiments of the present application, for an IOMMU which does not support Page fault, a VMM may determine a GPA needing page update, and determine a first HPA corresponding to the GPA from a page table stored in the IOMMU of a host; determine a second HPA for replacing the first HPA from idle physical addresses stored in a host memory; further, copy data stored in the first HPA to the second HPA; and update a HPA that corresponds to the GPA needing update and is recorded in the page table of the IOMMU to the second HPA, and thus, page table replacement is implemented for the IOMMU which does not support Page fault.

Claims (65)

1 . A memory paging method, comprising:

determining a guest physical address needing page table update;

deleting the quest physical address from a page table of an MMU of a host;

blocking an access of a CPU of a virtual machine to the guest physical address;

determining, from a page table stored in an IOMMU of the host, a first host physical address corresponding to the guest physical address;

determining a second host physical address from idle physical addresses stored in a host memory;

copying data stored in the first host physical address to the second host physical address;

updating a host physical address that corresponds to the guest physical address and is recorded in the page table of the IOMMU to the second host physical address;

determining a third host physical address from the idle physical addresses of the host memory;

after copying the data stored in the first host physical address to the second host physical address, copying data stored in the second host physical address to the third host physical address;

in a case that the data stored in the first host physical address is the same as data stored in the third host physical address, releasing a memory space corresponding to the third host physical address; and

updating a host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

2 . The method according to claim 1 , wherein the blocking the access of the CPU to the guest physical address comprises:

acquiring an access request of the CPU for the guest physical address;

querying the page table of the MMU by utilizing the guest physical address;

executing a Page fault procedure in a case that a host physical address corresponding to the guest physical address is not found in the page table of the MMU; and

performing locking processing for a page table replacement progress of the MMU in a process of executing the Page fault procedure, to block the access of the CPU to the guest physical address.

3 . The method according to claim 1 , further comprising:

in a case that different data exists between the data stored in the first host physical address and the data stored in the third host physical address, for a first logical address where data is different, determining whether data at the first logical address from the data stored in the second host physical address is the same as data at the first logical address from the data stored in the third host physical address;

if a determination result is that the data at the first logical address from the data stored in the second host physical address is not the same as the data at the first logical address from the data stored in the third host physical address, releasing the memory space corresponding to the third host physical address; and

updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

4 . The method according to claim 3 , further comprising:

if the determination result is that the data at the first logical address from the data stored in the second host physical address is the same as the data at the first logical address from the data stored in the third host physical address, updating the data at the first logical address from the data stored in the second host physical address to data at the first logical address from the data stored in the first host physical address;

releasing the memory space corresponding to the third host physical address; and

updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

5 . The method according to claim 1 , further comprising:

comparing, in units of byte, the data stored in the first host physical address with the data stored in the third host physical address.

6 . The method according to claim 3 , further comprising:

after updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address, restoring the access of the CPU of the virtual machine to the guest physical address.

7 . The method according to claim 1 , wherein the determining the guest physical address needing page table update comprises:

acquiring a page table update request; and acquiring, from the page table update request, the guest physical address needing page table update.

8 . A computing system, comprising: a host and a virtual machine manager; wherein

the host is deployed with a virtual machine, and is mounted with a pass-through device to which the virtual machine directly accesses; the host further comprises: an IOMMU; a page table stored in the IOMMU records a correspondence relationship between guest physical addresses of virtual machines and host physical addresses; and the pass-through device accesses a memory of the host based on the correspondence relationship between the guest physical addresses of the virtual machines and the host physical addresses; and

the virtual machine manager is used for: determining a guest physical address needing page table update; deleting the guest physical address from a page table of an MMU of the host; blocking an access of a CPU of the virtual machine to the guest physical address; determining, from the page table stored in the IOMMU, a first host physical address corresponding to the guest physical address; determining a second host physical address from idle physical addresses in the memory of the host; copying data stored in the first host physical address to the second host physical address; updating a host physical address that corresponds to the guest physical address and is recorded in the page table of the IOMMU to the second host physical address; determining a third host physical address from the idle physical addresses of the memory of the host; after copying the data stored in the first host physical address to the second host physical address, copying data stored in the second host physical address to the third host physical address; in a case that the data stored in the first host physical address is the same as data stored in the third host physical address, releasing a memory space corresponding to the third host physical address; and updating a host physical address that corresponds to the quest physical address and is recorded in the page table of the MMU to the second host physical address.

9 . A non-transitory computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform operations of:

determining a guest physical address needing page table update;

deleting the guest physical address from a page table of an MMU of a host;

blocking an access of a CPU of a virtual machine to the guest physical address;

determining, from a page table stored in an IOMMU of the host, a first host physical address corresponding to the guest physical address;

determining a second host physical address from idle physical addresses stored in a host memory;

copying data stored in the first host physical address to the second host physical address;

updating a host physical address that corresponds to the guest physical address and is recorded in the page table of the IOMMU to the second host physical address;

determining a third host physical address from the idle physical addresses of the host memory;

after copying the data stored in the first host physical address to the second host physical address, copying data stored in the second host physical address to the third host physical address;

in a case that the data stored in the first host physical address is the same as data stored in the third host physical address, releasing a memory space corresponding to the third host physical address; and

updating a host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

10 . The non-transitory computer-readable storage medium according to claim 9 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

acquiring an access request of the CPU for the guest physical address;

querying the page table of the MMU by utilizing the guest physical address;

executing a Page fault procedure in a case that a host physical address corresponding to the guest physical address is not found in the page table of the MMU; and

performing locking processing for a page table replacement progress of the MMU in a process of executing the Page fault procedure, to block the access of the CPU to the guest physical address.

11 . The non-transitory computer-readable storage medium according to claim 9 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

in a case that different data exists between the data stored in the first host physical address and the data stored in the third host physical address, for a first logical address where data is different, determining whether data at the first logical address from the data stored in the second host physical address is the same as data at the first logical address from the data stored in the third host physical address;

if a determination result is that the data at the first logical address from the data stored in the second host physical address is not the same as the data at the first logical address from the data stored in the third host physical address, releasing the memory space corresponding to the third host physical address; and

updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

12 . The non-transitory computer-readable storage medium according to claim 11 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

if the determination result is that the data at the first logical address from the data stored in the second host physical address is the same as the data at the first logical address from the data stored in the third host physical address, updating the data at the first logical address from the data stored in the second host physical address to data at the first logical address from the data stored in the first host physical address;

releasing the memory space corresponding to the third host physical address; and

updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address.

13 . The non-transitory computer-readable storage medium according to claim 9 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

comparing, in units of byte, the data stored in the first host physical address with the data stored in the third host physical address.

14 . The non-transitory computer-readable storage medium according to claim 11 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

after updating the host physical address that corresponds to the guest physical address and is recorded in the page table of the MMU to the second host physical address, restoring the access of the CPU of the virtual machine to the guest physical address.

15 . The non-transitory computer-readable storage medium according to claim 9 , wherein the computer instructions, when executed by the one or more processors, cause the one or more processors to perform further operations of:

acquiring a page table update request; and acquiring, from the page table update request, the guest physical address needing page table update.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 30, 2026
From: HANGZHOU ALICLOUD FEITIAN INFORMATION TECHNOLOGY CO., LTD.
To: CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PRIVATE LIMITED
Reel/Frame 075366/0376 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 16, 2024
From: XU, YUN
To: HANGZHOU ALICLOUD FEITIAN INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 067434/0244 →
Priority Claims (1)
CN 202210150479.1 · Feb 18, 2022 · national
Continuity (1)
Related Publication 20240281365A1 · Aug 22, 2024
References Cited (16)
US 10691365B1 · Tsirkin · 2020 [cited by examiner]
US 20140298330A1 · Suzuki · 2014 [cited by examiner]
US 20180011797A1 · Shi et al. · 2018 [cited by applicant]
US 20180373556A1 · Tian et al. · 2018 [cited by applicant]
US 20230418644A1 · Tsirkin · 2023 [cited by examiner]
CN 103597451A · 2014 [cited by applicant]
CN 111966468A · 2020 [cited by applicant]
CN 112241310A · 2021 [cited by applicant]
CN 112925606A · 2021 [cited by applicant]
CN 114201269A · 2022 [cited by applicant]
Xu, Yu, “Optimization of Mediated Pass-Through for on-Device MMU Virtualization”, Shanghai Jiao Tong University, Shanghai, China, Mar. 10, 2018 (82 pages). [cited by applicant]
PCT International Search Report for PCT/CN2023/074406 entitled “Memory Paging Method and System, and Storage Medium” mailed Jun. 23, 2023 (6 pages including English-language translation). [cited by applicant]
First Office Action issued Apr. 2, 2022 in CN Application No. 202210150479.1 entitled “Memory Paging Method, System and Memory” (10 pages including English-language translation). [cited by applicant]
Second Office Action issued May 5, 2022 in CN Application No. 202210150479.1 entitled “Memory Paging Method, System and Memory” (12 pages including English-language translation). [cited by applicant]
PCT International Written Opinion for PCT/CN2023/074406 entitled “Memory Paging Method and System, and Storage Medium” mailed Jun. 23, 2023 (4 pages). [cited by applicant]
Extended European Search Report of European Patent Application No. 23755697.2 based on PCT/CN2023/074406, entitled “Memory Scanning Method and Apparatus,” dated Jun. 30, 2025 (10 pages). [cited by applicant]