mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ANDROID: KVM: arm64: memory balloon: Notify hyp when ballooning
When running as a protected VM, the hypervisor isolates the VM's memory pages from the host. Returning ownership of a VM page therefore requires hypervisor involvement, and acknowledgement from the protected VM that it is voluntarily cooperating. To this end, notify pages via the new relinquish hypercall when they are entered into the memory balloon. Bug: 240239989 Change-Id: Ic89b45312a7478ddff081a934d99e693eded92dc Signed-off-by: Keir Fraser <keirf@google.com>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mem_relinquish.h>
|
||||
|
||||
/*
|
||||
* Balloon device information descriptor.
|
||||
@@ -103,6 +104,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon,
|
||||
__SetPageMovable(page, balloon->inode->i_mapping);
|
||||
set_page_private(page, (unsigned long)balloon);
|
||||
list_add(&page->lru, &balloon->pages);
|
||||
page_relinquish(page);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -147,6 +149,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon,
|
||||
{
|
||||
__SetPageOffline(page);
|
||||
list_add(&page->lru, &balloon->pages);
|
||||
page_relinquish(page);
|
||||
}
|
||||
|
||||
static inline void balloon_page_delete(struct page *page)
|
||||
|
||||
Reference in New Issue
Block a user