ANDROID: KVM: arm64: balloon: Notify hyp before reporting free pages to host
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 being reported to the host as free and available for temporary reclaim. Bug: 240239989 Change-Id: I8718e468be63c3aacb2f79ff141fbcedd6d19b56 Signed-off-by: Keir Fraser <keirf@google.com> Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
parent
23cfd30bb3
commit
e95813e9da
@ -7,6 +7,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/scatterlist.h>
|
#include <linux/scatterlist.h>
|
||||||
|
#include <linux/mem_relinquish.h>
|
||||||
|
|
||||||
#include "page_reporting.h"
|
#include "page_reporting.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
@ -120,7 +121,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone,
|
|||||||
unsigned int page_len = PAGE_SIZE << order;
|
unsigned int page_len = PAGE_SIZE << order;
|
||||||
struct page *page, *next;
|
struct page *page, *next;
|
||||||
long budget;
|
long budget;
|
||||||
int err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform early check, if free area is empty there is
|
* Perform early check, if free area is empty there is
|
||||||
@ -175,6 +176,10 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone,
|
|||||||
--(*offset);
|
--(*offset);
|
||||||
sg_set_page(&sgl[*offset], page, page_len, 0);
|
sg_set_page(&sgl[*offset], page, page_len, 0);
|
||||||
|
|
||||||
|
/* Notify hyp that these pages are reclaimable. */
|
||||||
|
for (i = 0; i < (1<<order); i++)
|
||||||
|
page_relinquish(page+i);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user