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

Commit 0390237b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "haven: Add Haven Message Queue driver"

parents 7f4a58ae 0ae181fd
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */
#ifndef __ASM_HH_HCALL_H
#define __ASM_HH_HCALL_H

#include <linux/types.h>

#include <linux/haven/hcall_common.h>

/**
 * _hh_hcall: Performs an AArch64-specific call into hypervisor using Haven ABI
 * @hcall_num: Hypercall function ID to invoke
 * @args: Hypercall argument registers
 * @resp: Pointer to location to store response
 */
static inline int _hh_hcall(const hh_hcall_fnid_t hcall_num,
	const struct hh_hcall_args args,
	struct hh_hcall_resp *resp)
{
	uint64_t _x18;

	register uint64_t _x0 asm("x0") = args.arg0;
	register uint64_t _x1 asm("x1") = args.arg1;
	register uint64_t _x2 asm("x2") = args.arg2;
	register uint64_t _x3 asm("x3") = args.arg3;
	register uint64_t _x4 asm("x4") = args.arg4;
	register uint64_t _x5 asm("x5") = args.arg5;
	register uint64_t _x6 asm("x6") = args.arg6;
	register uint64_t _x7 asm("x7") = args.arg7;

	asm volatile (
		"str	x18, [%[_x18]]\n"
		"hvc	%[num]\n"
		"ldr	x18, [%[_x18]]\n"
		"str	xzr, [%[_x18]]\n"
		: "+r"(_x0), "+r"(_x1), "+r"(_x2), "+r"(_x3), "+r"(_x4),
		  "+r"(_x5), "+r"(_x6), "+r"(_x7)
		: [num] "i" (hcall_num), [_x18] "r"(&_x18)
		: "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17",
		  "memory"
		);

	resp->resp0 = _x0;
	resp->resp1 = _x1;
	resp->resp2 = _x2;
	resp->resp3 = _x3;
	resp->resp4 = _x4;
	resp->resp5 = _x5;
	resp->resp6 = _x6;
	resp->resp7 = _x7;

	return _x0;
}

#endif
+1 −0
Original line number Diff line number Diff line
@@ -32,4 +32,5 @@ config FSL_HV_MANAGER
	     partition shuts down.

source "drivers/virt/vboxguest/Kconfig"
source "drivers/virt/haven/Kconfig"
endif
+1 −0
Original line number Diff line number Diff line
@@ -5,3 +5,4 @@

obj-$(CONFIG_FSL_HV_MANAGER)	+= fsl_hypervisor.o
obj-y				+= vboxguest/
obj-y				+= haven/
+27 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

menuconfig HAVEN_DRIVERS
	bool "Haven Virtualization drivers"
	help
	  The Haven drivers are the helper interfaces that runs on the
	  virtual machines that provides support such as memory/device
	  sharing, IRQ sharing, IPC/signalling mechanisms, and so on.

	  Say Y here to enable the drivers needed to work on Haven
	  virtualization environment.

	  If you say N, all options in this submenu will be skipped and disabled.

if HAVEN_DRIVERS

config HH_MSGQ
	tristate "Haven Message Queue driver"
	help
	  Haven offers message-queues as one of the IPC mechanisms to
	  communicate among the Virtual Machines. The message queue drivers
	  runs on the Virtual machines to provide an interface to the clients
	  who wish to communicate to other clients on a different VM. Currently,
	  the services offered by the drivers is simply to send and receive
	  messages in a blocking manner.

endif
+2 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_HH_MSGQ)		+= hh_msgq.o
Loading