# US 2024/0202133 A1 · Fine-grained dirty page tracking of iommu second-stage large pages

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0202133 A1
- Document ID: US20240202133A1
- Status: Published application
- Kind: A1
- Application number: 18/080,951
- Filed: 2022-12-14
- Published: 2024-06-20
- Earliest claimed: 2022-12-14
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Karthik V. Narayanan; Raghunathan Srinivasan
- Web page: https://patentgrep.com/patent/US20240202133A1

## CPC

- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/084: with a shared cache
- G06F 12/1081: for peripheral access to main memory, e.g. direct memory access [DMA]
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06F 12/04: Addressing variable-length words or parts of words
- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 2212/1016: Performance improvement
- G06F 2212/502: using adaptive policy
- G06F 2212/651: Multi-level translation tables
- G06F 2212/652: Page size control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An example of an apparatus may include memory and an input/output (IO) bus, where an address space of the memory and the IO bus is at least partially organized as a plurality of large pages, and where a large page is organized as two or more sub-pages. In some examples, the apparatus further includes circuitry coupled to the memory and the IO bus to map an IO address to a physical address, and track a modification to a large page at a granularity that corresponds to a size of a subset of the large page. Other embodiments are disclosed and claimed.

## Claims

### Claim 1

An apparatus, comprising:
memory and an input/output (IO) bus, wherein an address space of the memory and the IO bus is at least partially organized as a plurality of large pages, and wherein a large page is organized as two or more sub-pages; and
circuitry coupled to the memory and the IO bus to:
map an IO address to a physical address; and
track a modification to a large page at a granularity that corresponds to a size of a subset of the large page.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the circuitry is further to:
selectively track the modification to the large page at a first granularity that corresponds to the size of the subset of the large page or a second granularity that corresponds to the size of the large page based on a configuration setting.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the circuitry is further to:
determine the configuration setting based on a field of a register.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the circuitry is further to:
maintain a page table to map the IO address to the physical address; and
maintain a shadow page table to track the modification to the large page at the granularity that corresponds to the size of the subset of the large page.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the shadow page table is adjacent and physically contiguous to the page table.

### Claim 6 (depends on 4)

The apparatus of claim 4, wherein the circuitry is further to:
set a value of a field in a page table entry of the shadow page table to indicate a modification to a sub-page of the large page.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the field in the page table entry corresponds to a range of two or more sub-pages of the large page, wherein a size of the range corresponds to the size of the subset of the large page.

### Claim 8 (depends on 4)

The apparatus of claim 4, wherein the circuitry is further to:
maintain a shadow pointer table with an entry to point to the shadow page table.

### Claim 9 (depends on 8)

The apparatus of claim 8, wherein the shadow pointer table is adjacent and physically contiguous to the page table.

### Claim 10

An apparatus, comprising:
memory; and
an input/output memory management unit (IOMMU) coupled to the memory, the IOMMU including circuitry to:
manage access from input/output (IO) devices to the memory at a page level that includes at a higher-level page and a lower-level page, wherein a higher-level page includes a plurality of lower-level pages, and
selectively track higher-level dirty pages at a first granularity that corresponds to a first size of a higher-level page or at a second granularity that corresponds to a second size of a subset of the higher-level page.

### Claim 11 (depends on 10)

The apparatus of claim 10, further comprising:
a register to store an indication of whether the circuitry is to track higher-level dirty pages at the first granularity or the second granularity.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the circuitry is further to:
determine if an IO device modifies a higher-level page; and
set a dirty bit in a shadow higher-level page table entry that corresponds to a modified subset of the modified higher-level page if the register stores an indication that the circuitry is to track higher-level dirty pages at the second granularity.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein the memory is to store a table with an indication of whether the first size of the higher-level page corresponds to a first large page size or a second large page size.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein, if the register stores an indication that the circuitry is to track higher-level dirty pages at the second granularity, the circuitry is further to:
utilize a shadow higher-level page structure that is adjacent to a higher-level page directory to store dirty bits that correspond to modified subsets of a higher-level page, if the table stores an indication of that the first size of the higher-level page corresponds to the first large page size.

### Claim 15 (depends on 13)

The apparatus of claim 13, wherein, if the register stores an indication that the circuitry is to track higher-level dirty pages at the second granularity, the circuitry is further to:
utilize a first shadow higher-level page structure that is adjacent to a higher-level page directory to store pointers to respective second shadow higher-level page structures that store dirty bits that correspond to modified subsets of a higher-level page, if the table stores an indication of that the first size of the higher-level page corresponds to the second large page size.

### Claim 16

A system, comprising:
a processor;
memory;
a memory management unit (MMU) coupled between the processor and the memory; and
an input/output (IO) MMU (IOMMU) coupled to the memory to manage access to the memory from one or more IO devices and to selectively track dirty large pages at one or more granularities including at least a first granularity that corresponds to a first size of a large page or at a second granularity that corresponds to a second size of a subset of the large page, wherein the large page includes two or more sub-pages.

### Claim 17 (depends on 16)

The system of claim 16, wherein the memory is to store a page table with an indication of whether the first size of the large page corresponds to a first large page size or a second large page size.

### Claim 18 (depends on 16)

The system of claim 16, further comprising:
a configuration register to store a global indication of the one or more granularities to be tracked for the dirty large pages.

### Claim 19 (depends on 18)

The system of claim 18, further comprising non-transitory instructions that when executed by the processor cause the processor to determine if the configuration register stores an indication that the IOMMU is to track dirty large pages at the second granularity and, if so determined, to:
create a first set of page structures to be utilized by the IOMMU to manage the access to the memory from the one or more IO devices; and
create a second set of shadow page structures to be utilized by the IOMMU to track dirty subsets of the large pages.

### Claim 20 (depends on 19)

The system of claim 19, wherein the IOMMU is further to:
set a dirty bit in a shadow page table entry of the second set of shadow page structures that corresponds to a modified subset of a modified large page.

### Claim 21 (depends on 16)

The system of claim 16, further comprising non-transitory instructions that when executed by the processor cause the processor to:
migrate only subsets of the large pages indicated as dirty by the second set of shadow page structures, in response to a migration request.
