The 'src_vmid' parameter of the 'qcom_scm_assign_mem' call
should include both memparcel owner and paparticipants.
Change-Id: I6999c9b51e76264e2a93e121ecd2a0ca4e197b4e
Signed-off-by: Tao Zhang <quic_taozhan@quicinc.com>
Set 'FLAGS[bit 0]' for memory 'MEM_SHARE'RM call to sanitize the
shared-memory block, so that gunyah and gunyah-bridge drivers
didn't need to clear the memory anymore.
Change-Id: Ib1a1aa2e4f0d11e6d85109dd2266fea1eb20cedd
Signed-off-by: Tao Zhang <quic_taozhan@quicinc.com>
This gunyah transport relies on notifier chain notifications for
transport status information. This differs from other transports like
rpmsg and mhi where the status is tied to a device probed by a bus.
This makes the notification interpretation more complex and nuanced
since the transport state is not tied to a device. Add an endpoint state
to prevent re-registering and unregistering uninitialized qrtr
endpoints. This is needed when the notification sequence is not clear or
unexpected.
Use a state variable and lock until the code can be refactored to better
tie the transport status to a device structure.
Change-Id: I3448b6b84494a34632700e827007254da36b15f3
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
It does not seem like the rm notifier chain will announce state changes
of an exiting or crashing vm fails to shutdown. The gunyah drivers
provide a notifier chain that is managed by the vm lifecycle driver.
Listen to this notifier chain instead of the rm notifier chain.
The notifier chain registration APIs are not stubbed out by the gunyah
vm header. Those APIs should only be applicable to the host. The QRTR
gunyah driver will stub out the APIs from gunyah vm in the short term.
Eventually qrtr gunyah may need to split into a host and guest
implementation to avoid compilation errors.
Change-Id: I36bf515844dd0fe039603720298608d390263859
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
In the case where the VM becomes unresponsive, the qrtr transport should
not block forever. If the 10 second timeout for waiting for the VM
occurs, then return an error back to the sender instead of retrying.
Change-Id: Id20655ac7bed80543451081c704739f3e83d7371
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
As we are merging upstream patches, resolve conflicts of namespaces in
downstream gunyah modules.
Change-Id: If7d731837704585635de2096b141acb9151d26dc
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Do not error print on receiving EAGAIN from doorbell APIs since this is
a common case and eventually resolves itself.
Change-Id: I5953abb0474a7dfb3e4040c8e55dbaee832f935f
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Max packet size at the transport layer should account for the extra
space and padding from the qrtr core layer. Add an extra 32 bytes to
MAX_PKT_SZ for the qrtr_v1 header size.
Change-Id: I0856dcc192561de4ff6c60dff79a0eed11737e6f
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Add bounds check on values read from shared memory in the tx path. In
cases where the VM is misbehaving, the qrtr gunyah transport should
exit and print a warning when bogus values may cause a read out of
bounds.
Change-Id: Iecc62f0183ff9984bfbbac9b8d14e6d19856cba5
Signed-off-by: Richard Maina <quic_rmaina@quicinc.com>
Validate the values read from shared memory in the recive path.In case
of a misbehaving VM, the qrtr gunyah transport should return immediately
and print a warning.
Change-Id: Ic5546f4a904bc888216f2a314f954585819e2af8
Signed-off-by: Richard Maina <quic_rmaina@quicinc.com>
There is a slim chance of a double read happening at the end of the
probe if the rx doorbell is triggered instantly after registration.
Add a check to quit from gunyah read in case it gets called from
doorbell and probe context at the same time.
Change-Id: Ief7a33c693645af585505c73101d691f66750481
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Reset pipe on gunyah if a corrupted packet is read to prevent an
interrupt storm.
Change-Id: Ie0c4a74a66eb9aac96999e9f4d0ef6cec4979baa
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Add support to handle paged skbs from the qrtr code layer. Neither the
pskb or the sg APIs support copying into io memory. Add a helper in
qrtr gunyah to copy from scatterlists into the fifo io memory.
Not all skbs coming from qrtr core will be paged skbs, keep support for
linear buffer copies in the tx path.
Change-Id: Ifccab77e45ec70fd4c7bad92b06497c65403461e
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
If a static carveout is not available for VMs they should be able to
fallback to a dynamic allocation from the CMA. Add support to dma alloc
contigous memory and share that memory to the VM.
Change-Id: Ie8c5b961b530102d9046818a6e0b31a70e05b896
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Instead of filtering pm_wakeup_event() call via node ID, add support to
do it based on the service ID. This provides more fine control over
which incoming packet can wakeup APPS.
Change-Id: I1e4a7f6d04a2e37104191bedc5d87070aabc002b
Signed-off-by: Tony Truong <quic_truong@quicinc.com>
There are cases where the doorbell interrupt is handled before the
probe can finish the endpoint registration with the qrtr core logic.
Move the RX doorbell register until after the endpoint is registered
and the qrtr core logic has initialized all the structures.
Change-Id: I8200651b3874c2bef3cbc0bae35b85c67c851eff
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Cleanup hypervisor resources during SSR. Register and
unregister qrtr endpoint at vm ready and reset
respectively. Reset the fifo indices on vm ready.
Change-Id: I31224f7afa86662a6df1944fcdd53982d5b29cf5
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Add the QRTR gunyah transport that facilitates sending and receiving
IPC Router messages between virtual machines that use the haven
hypervisor.
Change-Id: I805ee5b144c5a8fc92e4a045061770d06495f63c
Signed-off-by: Chris Lew <quic_clew@quicinc.com>