ANDROID: KVM: arm64: Expose kvm_flush_dcache_to_poc() in module_ops

Expose kvm_flush_dcache_to_poc() in the module_ops struct to allow CMOs
from pKVM modules.

Bug: 244543039
Bug: 244373730
Change-Id: I91d57a94effd2710d868591c6baf4a5672d149a4
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Quentin Perret
2022-10-26 10:32:15 +00:00
parent 4d4c9f9829
commit 4f73cf46ab
2 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ struct pkvm_module_ops {
void (*putx64)(u64 num);
void *(*fixmap_map)(phys_addr_t phys);
void (*fixmap_unmap)(void);
void (*flush_dcache_to_poc)(void *addr, size_t size);
};
struct pkvm_module_section {

View File

@@ -9,6 +9,11 @@
#include <nvhe/mm.h>
#include <nvhe/serial.h>
static void __kvm_flush_dcache_to_poc(void *addr, size_t size)
{
kvm_flush_dcache_to_poc((unsigned long)addr, (unsigned long)size);
}
const struct pkvm_module_ops module_ops = {
.create_private_mapping = __pkvm_create_private_mapping,
.register_serial_driver = __pkvm_register_serial_driver,
@@ -16,6 +21,7 @@ const struct pkvm_module_ops module_ops = {
.putx64 = hyp_putx64,
.fixmap_map = hyp_fixmap_map,
.fixmap_unmap = hyp_fixmap_unmap,
.flush_dcache_to_poc = __kvm_flush_dcache_to_poc,
};
int __pkvm_init_module(void *module_init)