android_kernel_samsung_sm8650/arch/arm64/geniezone
Yi-De Wu 7cc3767c2a FROMLIST: virt: geniezone: Add block-based demand paging support
To balance memory usage and performance, GenieZone supports larger
granularity demand paging, called block-based demand paging.
Gzvm driver uses enable_cap to query the hypervisor if it supports
block-based demand paging and the given granularity or not. Meanwhile,
the gzvm driver allocates a shared buffer for storing the physical
pages later.

If the hypervisor supports, every time the gzvm driver handles guest
page faults, it allocates more memory in advance (default: 2MB) for
demand paging. And fills those physical pages into the allocated shared
memory, then calls the hypervisor to map to guest's memory.

The physical pages allocated for block-based demand paging is not
necessary to be contiguous because in many cases, 2MB block is not
followed. 1st, the memory is allocated because of VMM's page fault
(VMM loads kernel image to guest memory before running). In this case,
the page is allocated by the host kernel and using PAGE_SIZE. 2nd is
that guest may return memory to host via ballooning and that is still
4KB (or PAGE_SIZE) granularity. Therefore, we do not have to allocate
physically contiguous 2MB pages.

Change-Id: Id101da5a8ff73dbf5c9a3ab03526cdf5d2f6006e
Signed-off-by: Yingshiuan Pan <yingshiuan.pan@mediatek.com>
Signed-off-by: kevenny hsieh <kevenny.hsieh@mediatek.com>
Signed-off-by: Liju-Clr Chen <liju-clr.chen@mediatek.com>
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Bug: 301179926
Link: https://lore.kernel.org/all/20230919111210.19615-16-yi-de.wu@mediatek.com/
2023-10-20 16:31:15 +00:00
..
gzvm_arch_common.h FROMLIST: virt: geniezone: Add block-based demand paging support 2023-10-20 16:31:15 +00:00
Makefile FROMLIST: virt: geniezone: Add irqchip support for virtual interrupt injection 2023-08-29 18:02:40 +00:00
vcpu.c ANDROID: virt: geniezone: Refactoring vcpu to align with upstream v6 2023-10-20 16:31:15 +00:00
vgic.c ANDROID: virt: geniezone: Refactoring vgic to align with upstream v6 2023-10-20 16:31:15 +00:00
vm.c FROMLIST: virt: geniezone: Add block-based demand paging support 2023-10-20 16:31:15 +00:00