ANDROID: virt: gunyah: Add addrspace_find_info_area hypercall
Newer versions of Gunyah provide a mechanism to discover early-boot configuration information. This information was previously non-discoverable and was provided via devicetree patching by Gunyah. The info area is a page allocated by the hypervisor and mapped into the guest. Bug: 395833312 Change-Id: I3dd4781f163d72c3826fcb4c354e4deda865efab Signed-off-by: Elliot Berman <elliot.berman@oss.qualcomm.com>
This commit is contained in:
@@ -45,6 +45,7 @@ EXPORT_SYMBOL_GPL(arch_is_gunyah_guest);
|
||||
#define GUNYAH_HYPERCALL_ADDRSPACE_UNMAP GUNYAH_HYPERCALL(0x802C)
|
||||
#define GUNYAH_HYPERCALL_MEMEXTENT_DONATE GUNYAH_HYPERCALL(0x8061)
|
||||
#define GUNYAH_HYPERCALL_VCPU_RUN GUNYAH_HYPERCALL(0x8065)
|
||||
#define GUNYAH_HYPERCALL_ADDRSPACE_FIND_INFO_AREA GUNYAH_HYPERCALL(0x806a)
|
||||
/* clang-format on */
|
||||
|
||||
/**
|
||||
@@ -275,5 +276,28 @@ gunyah_hypercall_vcpu_run(u64 capid, unsigned long *resume_data,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gunyah_hypercall_vcpu_run);
|
||||
|
||||
/**
|
||||
* gunyah_hypercall_addrspace_find_info_area() - Find the IPA and size of the info area
|
||||
* @ipa: Filled with the IPA of the info area
|
||||
* @size: Filled with the size of the info area
|
||||
*
|
||||
* See also:
|
||||
* https://github.com/quic/gunyah-hypervisor/blob/develop/docs/api/gunyah_api.md#address-space-management
|
||||
*/
|
||||
enum gunyah_error
|
||||
gunyah_hypercall_addrspace_find_info_area(unsigned long *ipa, unsigned long *size)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
|
||||
arm_smccc_1_1_hvc(GUNYAH_HYPERCALL_ADDRSPACE_FIND_INFO_AREA, 0, &res);
|
||||
if (res.a0 == GUNYAH_ERROR_OK) {
|
||||
*ipa = res.a1;
|
||||
*size = res.a2;
|
||||
}
|
||||
|
||||
return res.a0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gunyah_hypercall_addrspace_find_info_area);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Gunyah Hypervisor Hypercalls");
|
||||
|
||||
@@ -480,4 +480,7 @@ enum gunyah_error
|
||||
gunyah_hypercall_vcpu_run(u64 capid, unsigned long *resume_data,
|
||||
struct gunyah_hypercall_vcpu_run_resp *resp);
|
||||
|
||||
enum gunyah_error
|
||||
gunyah_hypercall_addrspace_find_info_area(unsigned long *ipa, unsigned long *size);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user