US 12,265,638 B2
Direct access to host memory for guests
Stefan Hajnoczi, St. Neots (GB); Vivek Goyal, Westford, MA (US); David Alan Gilbert, Manchester (GB); Steven John Whitehouse, Swansea (GB); and Miklos Szeredi, Piliscsaba (HU)
Assigned to Red Hat, Inc., Raleigh, NC (US)
Filed by Red Hat, Inc., Raleigh, NC (US)
Filed on Apr. 18, 2022, as Appl. No. 17/722,600.
Application 17/722,600 is a division of application No. 16/259,595, filed on Jan. 28, 2019, granted, now 11,308,230.
Prior Publication US 2022/0237313 A1, Jul. 28, 2022
Int. Cl. G06F 21/62 (2013.01); G06F 9/455 (2018.01); G06F 9/54 (2006.01); G06F 12/0804 (2016.01); G06F 12/1009 (2016.01); G06F 21/53 (2013.01); G06F 21/60 (2013.01)
CPC G06F 21/6218 (2013.01) [G06F 9/45558 (2013.01); G06F 9/546 (2013.01); G06F 12/0804 (2013.01); G06F 12/1009 (2013.01); G06F 21/53 (2013.01); G06F 21/604 (2013.01); G06F 2009/45579 (2013.01); G06F 2209/548 (2013.01); G06F 2212/151 (2013.01); G06F 2212/206 (2013.01); G06F 2221/2141 (2013.01)] 18 Claims
OG exemplary drawing
 
1. A system comprising:
a processor, a host memory, a filesystem daemon, a guest including a guest memory device and a storage controller, and a filesystem queue accessible to both the filesystem daemon and the storage controller, wherein the storage controller is configured to:
receive a file retrieval request associated with a file stored in the host memory and including an identifier of an identified part of the file to be accessed; and
forward the file retrieval request to the filesystem daemon by adding the file retrieval request to the filesystem queue, wherein the filesystem daemon is separate from the guest,
wherein the filesystem daemon is configured to:
retrieve the file retrieval request from the filesystem queue;
in response to retrieving the file retrieval request from the filesystem queue, allow the guest to directly access the file in the host memory by causing a host memory address (HMA) associated with the file to be mapped to a guest memory address (GMA) of the guest, wherein the GMA comprises a guest physical address, and wherein the guest physical address is mapped to a guest virtual address;
determine a memory offset associated with a starting position of the identified part in the host memory; and
adjust the HMA with the memory offset to allow the quest to directly access the identified part via the GMA,
wherein the guest is configured to:
after the HMA is mapped to the GMA, directly access the file in the host memory via the guest virtual address; and
later terminate access to the file, wherein the filesystem daemon is then configured to cause the GMA to be unmapped.