This repository was archived by the owner on Jan 28, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Android Emulator may dynamically create and destroy temporary
memory mappings at guest runtime for certain rendering tasks via
hax_user_backed_ram_map() and hax_user_backed_ram_unmap()
($AOSP/external/qemu/target/i386/hax-mem.c), e.g.:
hax_user_backed_ram_map() <1>
1.1) ADD_RAMBLOCK <1>: HVA 0x14e070000..0x16e070000
1.2) SET_RAM2 (map) <1>: GPA 0x7dffff000..0x7fffff000 =>
HVA 0x14e070000..0x16e070000
hax_user_backed_ram_unmap() <1>
1.3) SET_RAM2 (unmap) <1>: GPA 0x7dffff000..0x7fffff000
hax_user_backed_ram_map() <2>
2.1) ADD_RAMBLOCK <2>: HVA 0x14de70000..0x16de70000
The second ADD_RAMBLOCK call fails, because its HVA range overlaps
with that of the first ADD_RAMBLOCK call.
The problem is that the "map" step creates a RAM block, but the
"unmap" step doesn't destroy it. Instead of adding a DEL_RAMBLOCK
ioctl, simply exempt the caller from calling ADD_RAMBLOCK in the
first place:
along with a new capability flag for this API change.
Instead, call SET_RAM2 with the new flag. (This will be done on
the Android Emulator side.)
stand-alone mapping.
of the corresponding stand-alone RAM block will hit 0, which
allows SET_RAM2 to destroy this temporary RAM block.
not directly in touch with user space.