ANDROID: KVM: arm64: Expose __pkvm_create_private_mapping to pKVM modules

pKVM has an internal API allowing to create mappings in the 'private'
range of the hypervisor VA space for which there are no rules
constraining the VA-PA relation (hence comparable to the vmalloc area in
the kernel). This will be a useful API for hypervisor modules, so expose
it in the recently introduced module ops struct.

Bug: 244543039
Bug: 244373730
Change-Id: I2a8f958a02c3c3b9871224b65b00b207820a507a
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Quentin Perret
2022-09-19 13:12:44 +00:00
parent 4deb454ebf
commit c3db83c87f
2 changed files with 6 additions and 0 deletions

View File

@@ -3,9 +3,13 @@
#ifndef __ARM64_KVM_PKVM_MODULE_H__
#define __ARM64_KVM_PKVM_MODULE_H__
#include <asm/kvm_pgtable.h>
#include <linux/export.h>
struct pkvm_module_ops {
int (*create_private_mapping)(phys_addr_t phys, size_t size,
enum kvm_pgtable_prot prot,
unsigned long *haddr);
};
struct pkvm_module_section {

View File

@@ -6,8 +6,10 @@
#include <asm/kvm_pkvm_module.h>
#include <nvhe/modules.h>
#include <nvhe/mm.h>
const struct pkvm_module_ops module_ops = {
.create_private_mapping = __pkvm_create_private_mapping,
};
int __pkvm_init_module(void *module_init)