The state information of the Virtual PM group can be obtained
through this API.
Change-Id: I0a00e8bfe38f7908ed20bc105f66149097e6532b
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
Display uses RM owned MSGQ for lending mem and irq res handles. In
addition, display may need to communicate custom data between the VMs
based on the value added display features that need to be supported
while the trusted VM applications are active. This change introduces
the MSGQ dedicated for display to establish the communication channel.
Change-Id: I8d07a3eb8591364f245c37a947a9ba5457c46efb
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
No one is using HH_RM_MEM_NOTIFY_[OWNER/RECIPIENT]. Remove them.
Change-Id: I2ee4db2e9340fc291148f885a5098dea52b4ec0b
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Currently IRQ APIs are combined with notifications to VMs for sharing the
handles. This limit the clients for managing the error handling from the
drivers. Hence separate the notifications from the actual APIs so that
clients manage the error handling better. Add support for notifications
like IRQ_LEND/ACCEPT/RELEASE from SVM to PVM when SVM accept the irq
handle shared by PVM.
Change-Id: I49999c2d9494c68b1542680e521c012a25e3f6a8
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
It's useful for other virtual machines (VMs) to know if another
VM has successfully received a resource that was shared with it
(e.g. state tracking can be controlled better with this sort of
information). Add support for the MEM_ACCEPTED notification, which
clients can use to notify the VM that owns the resource that was
shared with it that it has accepted the resource and is using it.
Also, add support in the mem-notifier driver to forward the
MEM_ACCEPTED notification to clients.
Change-Id: I05b9f1d37906d7c2aa729b97df2f8ceb78b560bd
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Client drivers may lend IRQs with knowledge of only their GPIO interrupt
number, which would not directly have an underlying GIC hwirq. Thus,
tweak RM's understanding of IRQs to be aware of IRQ domains. Now, the
irq backed by GPIO will be translated to GIC domain.
Change-Id: I191d9e072b14f4501f5bbeb5d5263f50e0eef8c1
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Clean up compiler warnings in haven control driver.
Change-Id: I6246a108f2e30c812071df9e5c1adbce12853fbf
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Client drivers may successfully register with a doorbell even before
doorbell capids are known to Linux. However, we do need to know capids
for send, read, reset, and mask functions. Here, we mirror the behavior
of message queues by placing the calling thread in a waitqueue until the
capids are populated by RM.
Change-Id: Ie1cf98d0fe344bb2a878bb655db78705d4292ff9
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
RM-VM(Resource Manager) send various vm status notifications(INIT/READY/
RUNNING etc) back to primary VM while PIL loader is loading the VM
images. Listern to these notifications and make a call to get the
hypervisor resources to configure doorbell and message queues.
Change-Id: Ia378a1df82ef960e2c11bf715100e38de82b670c
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
This patch adds the /sys/hypervisor sysfs interface for the Haven
hypervisor. When running hosted on the Haven hypervisor, this interface
provides the Haven API and version information, and an interface for
controlling debug features. Haven also provides a call to disable its
UART driver. Disabling Haven's UART driver is exposed through a Kconfig
option.
Change-Id: I2a5ca7b01487e01e2d1dd56f5d15e826e70af081
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Haven hypervisor provides RM dt entries in a slightly different format
than has been used. Namely: the compatible string, capids are now
described by "reg" property, VMID/owner vmid is in a sibling DT node,
and names of some properties are changed. Thus, update RM driver to
parse accordingly. Common message queue dt parsing was moved into the
msgq driver helper function "hh_msgq_probe".
Change-Id: If3fe026bb6055267705a19d8ed7fd90ef0934270
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add display specific tag for memory sharing notifications.
Change-Id: I5cdad2c4e99fab7d3c71ae9e5865f99bfe5ccb05
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Supplement the existing Haven memory resource notification
interface with a framework that can be used to dispatch
notifications about memory resources being shared/released
to the resource owners.
Change-Id: Ibbc14f4b29d68ffb1a9d6b035c79867783872225
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The memory information tag is meant to be used in conjunction with
the memory notification interfaces to associate a label or tag with
a memory parcel. This memory information tag is meant to be used
for distinguishing between different memory resources that can be
transferred between Virtual Machines (VMs).
Change-Id: I6856284430ce5a78461c203904695aed25868706
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
There are Non-VM (Virtual Machine) supported target drivers which
may refer some of the APIs defined for VMs. But those drivers are
compiled irrespective of VM or non-VM configurations. Add stubs to
support to compile drivers for non vm supported targets.
Change-Id: Ibc0c2c55b3b264c43c4793f153e723f8d344423a
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Add library for client drivers to lend interrupts to each other.
Change-Id: I4c60e0443d178e83c0bb4ec824915e4bdadb9c39
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
A VM may release a lent IRQ back to its lender. The lendee VM notifies
the resource manager that it may give the interrupt back to the lender
via its interrupt handle. The lender then must notify the lender VM that
it has released the interrupt. The lender VM must then reclaim the
interrupt via the handle.
Change-Id: Ic76f5a3692b4041bc3f260b4add06da11746f19e
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
An IRQ lender driver will likely ought to need to use the IRQ handle to
reclaim the interrupt when the lendee is done with the interrupt.
Change-Id: I0b791ecfb7b169d5cf2677d324e9aceea51feb5d
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
VMID is represented inconsistently in payload structs. Consistently use
hh_vmid_t to reduce mistakes around sizing of vmid. IRQ notify request
payload was also incorrectly formatted according to specification.
Change-Id: I0875655f69946eb0af609c67bdfdfa0dab5c7acc
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Update handling of msgq response to send/recv to update internal state of
rx_empty/tx_full.
Change-Id: I8c744b2ed1dafc9b89576eb216a790d4f59530f5
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
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: Elliot Berman <eberman@codeaurora.org>
Currently, the hh_msgq driver allocates the receive-buffer on behalf
of the clients and it's the clients' responsibility to free it.
However, this creates asymmetry in the buffer management and may lead
to confusion. Hence, let the clients take full control of the buffers-
allocation and freeing.
Also make changes to the client driver to adapt to the new hh_msgq_recv
interface.
Change-Id: I95b72621ede5e62411e78e45c36d8a7ff3686bd4
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Fix other headers to work when KERNEL_HEADER_TEST is enabled by adding
dependencies and advance struct prototypes where appropriate.
Change-Id: Ic0dedbad6804e5dca75b33b3d0ae9e3b89a51669
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
The haven RM driver header file exposes functions where notifier
blocks are used. However, not all clients who include the
header file will necessarily have the notifier header file
in their source file, which causes compilation errors. Thus,
include the notifier header file in the RM driver header file
so that all other clients don't have to.
Change-Id: If74509e5d7fc2bbaeb4a427a7cd576f853fd8358
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Currently, the cap-id for Tx and Rx of the message-queue are
initialized with 0. However, 0 is a valid value for cap-id.
A better value to initialize the cap-id is with U64_MAX. Hence,
make corrections to use U64_MAX, defined as HH_CAPID_INVAL, in
the message-queue driver.
Change-Id: Ia501e87dc3cb8d880ea3d35ff000ca07b64aeced
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Add labels for the neuron and qrtr labels. The neuron block protocol
requires two doorbell pairs and qrtr requires one doorbell pair.
Change-Id: I7d9c3da5ae620209b0d7a374bd487d567efbb97a
Signed-off-by: Chris Lew <clew@codeaurora.org>
vcpu affinity can be used to set or change the physical CPU affinity
of a VCPU thread.
Change-Id: I5f92205640ed1440e8ed0676e2bfcacbcef91f90
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Clients may need irq number to handle doorbell, e.g. to use a common irq
handler framework.
Change-Id: Iab64a0ce3330eab2b8fa052e9d8b9b9856510e6a
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
MEM_NOTIFY is useful for sending VMs notifications about
memory that has been shared with them, as well as sending
owners of memory an indication that a VM has released memory
that they own, so add support for it.
Change-Id: I65bf0d000c8b3850f04c85eec70692728314b26d
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Relying on hyp_assign for sharing memory is not sufficient,
as there are certain cases where hyp_assign is not applicable
for sharing memory (e.g. I/O memory). Add support for the MEM_SHARE
and MEM_LEND operations for sharing/lending memory with other
VMs respectively.
Change-Id: I7de502385a045f073540fa30c164b3410f6b5bd0
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The MEM_ACCEPT call is required for VMs to map the
memory represented by a handle into their RM managed
page-tables, so add support for it.
Change-Id: I669ebd8298af405ca586a5721b26c4e19ffe39aa
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The MEM_RELEASE/MEM_RECLAIM RM calls are required to unmap memory
from the RM managed page-tables of VMs, as well as for VMs that
own memory to reclaim it respectively, so add support for it.
Change-Id: I6b8025cb08067331deb9cc89ec1d36c94c959c59
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The MEM_QCOM_LOOKUP_SGL RM call is required to retrieve
handles for memparcels created through hyp assign. Thus,
add support for it in the RM driver.
Change-Id: Ib854187daffa13a44c948111ef560c3479f2590c
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Expose the label used for the mem-buf message queue.
Change-Id: I6f7c7629f9f6a4aefaea65653187ba210ef6ceb8
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The memparcel handles are standard in the haven interface,
so expose them to the rest of the kernel.
Change-Id: Id8eafd5f3fe0f1403b9b76b9a0176c11d6546707
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Add console APIs to emulate virtual console mechanism between SVM and
PVM to get the SVM messages to PVM for debug purpose.
Change-Id: I24ec2c427460195c83f5975de70f4ec5c4f2f763
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
RM allows VMs to lend interrupts to one another. This patch implements
the lender API.
Change-Id: I7671a2b346d2425f963631da4b8529fc9b10dc40
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add VM management APIs so that clients can start VMs and allocate/get
vmids associated with VMs.
Change-Id: I7a9138a9479665f6c09aae98390a30c23011b3b1
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
In haven one way to provide inter VMs(Virtual Machines)
communication is through the use of doorbell interrupts.
Individual VMs make use of these doorbells by calling
send and/or a receive primitives exposed by driver and
trigger an interrupt to each other and exchange the data.
Change-Id: I6d797d78cddc96a23680554e2b3fc1031446cbe5
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>