IP Library Granted Patent US 12,417,185
Granted Patent B2
US 12,417,185 · App. 18/302,540 · Granted Sep 16, 2025

Dynamic direct memory access mapping for peripheral devices

Inventor: Michael Tsirkin (Yokneam Illit, IL)
Assignee: Red Hat, Inc.
G06F12/1081G06F12/1009
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,417,185
App. No.
18/302,540
Granted
Sep 16, 2025
Kind
B2
Abstract

The technology disclosed herein enables receiving, by an operating system running on a host computer system, a request to map a physical address associated with a peripheral device, identifying, based on the request, a mapping type, wherein the mapping type is one of: a first mapping type or a second mapping type, mapping, based on the mapping type of the request, the physical address to a virtual address referencing a memory page having one of: a first page size or a second page size, wherein the second page size exceeds the first page size, and storing a mapping of physical address to the virtual address in an input/output memory management unit (IOMMU) page table associated with the peripheral device.

Claims (39)

1. A method comprising:

receiving, by an operating system running on a host computer system, a plurality of mapping requests, wherein each mapping request maps a first physical address associated with a peripheral device;

for each mapping request of the plurality of mapping requests, identifying a mapping type, wherein the mapping type is selected from a group comprising a first mapping type and a second mapping type;

identifying, from the plurality of mapping requests, a subset of the plurality of mapping requests, wherein the subset is a predetermined number of mapping requests, and wherein the mapping type of each mapping request of the subset is the second mapping type;

mapping a plurality of first physical addresses of the subset to a first virtual address referencing a memory page, wherein the predetermined number of mapping requests is determined based on a page size of the memory page referenced by the first virtual address; and

storing the mapping of the plurality of first physical addresses of the subset to the first virtual address in an input/output memory management unit (IOMMU) page table associated with the peripheral device.

2. The method of claim 1 , wherein each of the plurality of mapping requests includes a mapping flag indicating the mapping type.

3. The method of claim 1 , wherein the page size is 1 gigabyte.

4. The method of claim 1 , further comprising:

receiving a request to unmap a second physical address;

identifying, from the IOMMU page table, at least one mapping of the second physical address; and

responsive to determining that the second physical address is one physical address of a plurality of physical addresses mapped to a second virtual address associated with the at least one mapping of the second physical address, unmapping the second physical address from the second virtual address.

5. A system comprising:

a memory device;

a processing device, operatively coupled to the memory device, to perform operations comprising:

receiving, by an operating system running on a host computer system, a plurality of mapping requests, wherein each mapping request maps a first physical address associated with a peripheral device;

for each mapping request of the plurality of mapping requests, identifying a mapping type, wherein the mapping type is selected from a group comprising a first mapping type and a second mapping type;

identifying, from the plurality of mapping requests, a subset of the plurality of mapping requests, wherein the subset is a predetermined number of mapping requests, and wherein the mapping type of each mapping request of the subset is the second mapping type;

mapping a plurality of first physical addresses of the subset to a first virtual address referencing a memory page, wherein the predetermined number of mapping requests is determined based on a page size of the memory page referenced by the first virtual address; and

storing the mapping of the plurality of first physical addresses of the subset to the first virtual address in an input/output memory management unit (IOMMU) page table associated with the peripheral device.

6. The system of claim 5 , wherein each of the plurality of mapping requests to map the physical address includes a mapping flag indicating the mapping type.

7. The system of claim 5 , wherein the second page size is 1 gigabyte.

8. The system of claim 5 , wherein the processing device is to perform further operations comprising:

receiving a request to unmap a second physical address;

identifying, from the IOMMU page table, at least one mapping of the second physical address; and

responsive to determining that the second physical address is one physical address of a plurality of physical addresses mapped to a second virtual address associated with the at least one mapping of the second physical address, unmapping the second physical address from the second virtual address.

9. A non-transitory computer-readable storage medium including instructions that, when executed by a processing device, cause the processing device to perform a method comprising:

receiving, by an operating system running on a host computer system, a plurality of mapping requests, wherein each mapping request maps a first physical address associated with a peripheral device;

for each mapping request of the plurality of mapping requests, identifying a mapping type, wherein the mapping type is selected from a group comprising: a first mapping type and a second mapping type;

identifying, from the plurality of mapping requests, a subset of the plurality of mapping requests, wherein the subset is a predetermined number of mapping requests, and wherein the mapping type of each mapping request of the subset is the second mapping type;

mapping a plurality of first physical addresses of the subset to a first virtual address referencing a memory page, wherein the predetermined number of mapping requests is determined based on a page size of the memory page referenced by the first virtual address;

storing the mapping of the plurality of first physical addresses of the subset to the first virtual address in an input/output memory management unit (IOMMU) page table associated with the peripheral device.

10. The non-transitory computer-readable storage medium of claim 9 , wherein each mapping request of the plurality of mapping requests includes a mapping flag indicating the mapping type.

11. The non-transitory computer-readable storage medium of claim 9 , wherein the processing device is to perform methods further comprising:

receiving a request to unmap a second physical address;

identifying, in the IOMMU page table, at least one mapping of the second physical address; and

responsive to determining that the second physical address is one physical address of a plurality of physical addresses mapped to a second virtual address associated with the at least one mapping of the second physical address, unmapping the second physical address from the second virtual address.

12. The non-transitory computer-readable storage medium of claim 11 , wherein the processing device is to perform methods further comprising:

responsive to determining that each physical address of the plurality of physical addresses mapped to the second virtual address is unmapped, invalidating, in the IOMMU page table, the at least one mapping of the second physical address.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 19, 2023
From: TSIRKIN, MICHAEL
To: RED HAT, INC.
Reel/Frame 063369/0590 →