Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73eacbb2 authored by Elliot Berman's avatar Elliot Berman
Browse files

haven: rm: Add HH_SELF_VM name



RM accepts "VMID 0" as meaning "self." Thus, add a vm_name "HH_SELF_VM"
which means the same. Haven RM console operates on vm_names and can use
HH_SELF_VM to talk to RM about this VM's console.

Change-Id: I7663db28497ad86a94d4a8c98f3b7068f5644915
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent 91553bb2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static int __init hvc_hh_console_init(void)
{
	int ret;

	ret = hvc_instantiate(hh_vm_name_to_vtermno(HH_PRIMARY_VM), 0,
	ret = hvc_instantiate(hh_vm_name_to_vtermno(HH_SELF_VM), 0,
			      &hh_hv_ops);

	return ret < 0 ? -ENODEV : 0;
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ int hh_rm_get_vmid(enum hh_vm_names vm_name, hh_vmid_t *vmid)
{
	hh_vmid_t _vmid = hh_vm_table[vm_name].vmid;

	if (!_vmid) {
	if (!_vmid && vm_name != HH_SELF_VM) {
		pr_err("%s: No vmid associated with the vm\n", __func__);
		return -EINVAL;
	}
@@ -346,7 +346,7 @@ int hh_rm_vm_alloc_vmid(enum hh_vm_names vm_name)
	/* Look up for the vm_name<->vmid pair if already present.
	 * If so, return.
	 */
	if (!hh_vm_table[vm_name].vmid) {
	if (hh_vm_table[vm_name].vmid || vm_name == HH_SELF_VM) {
		pr_err("%s: VM_ALLOCATE already called for this VM\n",
			__func__);
		return -EINVAL;
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,11 @@ typedef u64 hh_dbl_flags_t;
#define HH_CAPID_INVAL	U64_MAX

enum hh_vm_names {
	/*
	 * HH_SELF_VM is an alias for VMID 0. Useful for RM APIs which allow
	 * operations on current VM such as console
	 */
	HH_SELF_VM,
	HH_PRIMARY_VM,
	HH_TRUSTED_VM,
	HH_VM_MAX