Document RPC layer and related components
Add documentation for the protocol layers of trusted services, the RPC
layer and TS RPC layer in particular. The patch also includes the
complete description of the TS RPC ABI and behavior.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I77031702b6a512d0b8edb0c826adeb2d762cecb3
diff --git a/docs/developer/image/TSProtocolLayers.svg b/docs/developer/image/TSProtocolLayers.svg
new file mode 100644
index 0000000..9ecebde
--- /dev/null
+++ b/docs/developer/image/TSProtocolLayers.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1241px" height="731px" viewBox="-0.5 -0.5 1241 731" style="background-color: rgb(255, 255, 255);"><defs/><g><rect x="630" y="0" width="610" height="100" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 608px; height: 1px; padding-top: 7px; margin-left: 632px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Service backend</div></div></div></foreignObject><text x="632" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Service backend</text></switch></g><rect x="0" y="0" width="610" height="100" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 608px; height: 1px; padding-top: 7px; margin-left: 2px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Service client interface</div></div></div></foreignObject><text x="2" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Service client interface</text></switch></g><rect x="0" y="150" width="1240" height="100" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 1238px; height: 1px; padding-top: 157px; margin-left: 2px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Service layer</div></div></div></foreignObject><text x="2" y="169" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Service layer</text></switch></g><rect x="0" y="280" width="1240" height="310" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 1238px; height: 1px; padding-top: 287px; margin-left: 2px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">RPC layer</div></div></div></foreignObject><text x="2" y="299" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">RPC layer</text></switch></g><rect x="0" y="610" width="1240" height="120" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 1238px; height: 1px; padding-top: 617px; margin-left: 2px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">FF-A layer<br /></div></div></div></foreignObject><text x="2" y="629" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">FF-A layer
</text></switch></g><path d="M 705 650 L 763.63 650" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 768.88 650 L 761.88 653.5 L 763.63 650 L 761.88 646.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 630 630 C 606 630 600 650 619.2 654 C 600 662.8 621.6 682 637.2 674 C 648 690 684 690 696 674 C 720 674 720 658 705 650 C 720 634 696 618 675 626 C 660 614 636 614 630 630 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 650px; margin-left: 601px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">FF-A</div></div></div></foreignObject><text x="660" y="654" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">FF-A</text></switch></g><path d="M 830 620 L 830 486.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 830 481.12 L 833.5 488.12 L 830 486.37 L 826.5 488.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="770" y="620" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 650px; margin-left: 771px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">libsp</div></div></div></foreignObject><text x="830" y="654" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">libsp</text></switch></g><path d="M 550 650 L 575 650 L 575 654 L 612.83 654" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 618.08 654 L 611.08 657.5 L 612.83 654 L 611.08 650.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="440" y="620" width="110" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 650px; margin-left: 441px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">libsp</div></div></div></foreignObject><text x="495" y="654" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">libsp</text></switch></g><path d="M 150 680 L 150 720 L 666 720 L 666 692.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 666 687.12 L 669.5 694.12 L 666 692.37 L 662.5 694.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="90" y="620" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 650px; margin-left: 91px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Linux FF-A driver</div></div></div></foreignObject><text x="150" y="654" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Linux FF-A driver</text></switch></g><path d="M 150 580 L 150 613.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 150 618.88 L 146.5 611.88 L 150 613.63 L 153.5 611.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="90" y="520" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 550px; margin-left: 91px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">TS TEE driver</div></div></div></foreignObject><text x="150" y="554" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">TS TEE driver</text></switch></g><path d="M 515 480 L 515 550 L 495 550 L 495 613.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 495 618.88 L 491.5 611.88 L 495 613.63 L 498.5 611.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="460" y="420" width="110" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 450px; margin-left: 461px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">ts_rpc_caller_sp</div></div></div></foreignObject><text x="515" y="454" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">ts_rpc_caller_sp</text></switch></g><path d="M 800 420 L 800 236.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 800 231.12 L 803.5 238.12 L 800 236.37 L 796.5 238.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 830 420 L 830 270 L 970 270 L 970 236.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 970 231.12 L 973.5 238.12 L 970 236.37 L 966.5 238.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 860 420 L 860 310 L 1110 310 L 1110 236.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 1110 231.12 L 1113.5 238.12 L 1110 236.37 L 1106.5 238.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="770" y="420" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 450px; margin-left: 771px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">ts_rpc_endpoint_sp</div></div></div></foreignObject><text x="830" y="454" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">ts_rpc_endpoint_sp</text></switch></g><path d="M 830 170 L 830 86.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 830 81.12 L 833.5 88.12 L 830 86.37 L 826.5 88.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="770" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 771px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Attestation<br />RPC service</div></div></div></foreignObject><text x="830" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Attestation...</text></switch></g><path d="M 970 170 L 970 86.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 970 81.12 L 973.5 88.12 L 970 86.37 L 966.5 88.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="910" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 911px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Crypto<br />RPC service</div></div></div></foreignObject><text x="970" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Crypto...</text></switch></g><path d="M 1110 170 L 1110 86.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 1110 81.12 L 1113.5 88.12 L 1110 86.37 L 1106.5 88.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="1050" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 1051px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Storage<br />RPC service</div></div></div></foreignObject><text x="1110" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Storage...</text></switch></g><path d="M 150 480 L 150 513.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 150 518.88 L 146.5 511.88 L 150 513.63 L 153.5 511.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="90" y="420" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 450px; margin-left: 91px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">ts_rpc_caller_linux</div></div></div></foreignObject><text x="150" y="454" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">ts_rpc_caller_linux</text></switch></g><rect x="770" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 771px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Attestation<br />backend</div></div></div></foreignObject><text x="830" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Attestation...</text></switch></g><rect x="910" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 911px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Crypto<br />backend</div></div></div></foreignObject><text x="970" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Crypto...</text></switch></g><rect x="1050" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 1051px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Storage<br />backend</div></div></div></foreignObject><text x="1110" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Storage...</text></switch></g><path d="M 190 230 L 190 265 L 302.5 265 L 302.5 293.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 302.5 298.88 L 299 291.88 L 302.5 293.63 L 306 291.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="130" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 131px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Attestation<br />RPC caller</div></div></div></foreignObject><text x="190" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Attestation...</text></switch></g><path d="M 330 230 L 330 293.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 330 298.88 L 326.5 291.88 L 330 293.63 L 333.5 291.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="270" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 271px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Crypto<br />RPC caller</div></div></div></foreignObject><text x="330" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Crypto...</text></switch></g><path d="M 470 230 L 470 265 L 357.5 265 L 357.5 293.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 357.5 298.88 L 354 291.88 L 357.5 293.63 L 361 291.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="410" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 411px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Storage<br />RPC caller</div></div></div></foreignObject><text x="470" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Storage...</text></switch></g><path d="M 190 80 L 190 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 190 168.88 L 186.5 161.88 L 190 163.63 L 193.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="130" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 131px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Attestation<br />client</div></div></div></foreignObject><text x="190" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Attestation...</text></switch></g><path d="M 330 80 L 330 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 330 168.88 L 326.5 161.88 L 330 163.63 L 333.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="270" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 271px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Crypto<br />client</div></div></div></foreignObject><text x="330" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Crypto...</text></switch></g><path d="M 470 80 L 470 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 470 168.88 L 466.5 161.88 L 470 163.63 L 473.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="410" y="20" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 50px; margin-left: 411px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Storage<br />client</div></div></div></foreignObject><text x="470" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Storage...</text></switch></g><rect x="220" y="420" width="110" height="60" fill="#f5f5f5" stroke="#666666" stroke-dasharray="3 3" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 450px; margin-left: 221px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">direct</div></div></div></foreignObject><text x="275" y="454" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">direct</text></switch></g><rect x="340" y="420" width="110" height="60" fill="#f5f5f5" stroke="#666666" stroke-dasharray="3 3" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 450px; margin-left: 341px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">dummy</div></div></div></foreignObject><text x="395" y="454" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">dummy</text></switch></g><path d="M 302.5 360 L 302.5 390 L 150 390 L 150 413.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 150 418.88 L 146.5 411.88 L 150 413.63 L 153.5 411.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 357.5 360 L 357.5 390 L 515 390 L 515 413.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 515 418.88 L 511.5 411.88 L 515 413.63 L 518.5 411.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="275" y="300" width="110" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 330px; margin-left: 276px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">rpc_caller_session</div></div></div></foreignObject><text x="330" y="334" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">rpc_caller_session</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
diff --git a/docs/developer/image/TSServiceDiscovery.svg b/docs/developer/image/TSServiceDiscovery.svg
new file mode 100644
index 0000000..d9e4b7e
--- /dev/null
+++ b/docs/developer/image/TSServiceDiscovery.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1681px" height="661px" viewBox="-0.5 -0.5 1681 661" style="background-color: rgb(255, 255, 255);"><defs/><g><path d="M 1160.05 80 L 1160.1 180 L 840 180 L 840 268.03" fill="none" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 840 275.53 L 835 265.53 L 840 268.03 L 845 265.53 Z" fill="#82b366" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="all"/><path d="M 1180 80 L 1180 268.03" fill="none" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 1180 275.53 L 1175 265.53 L 1180 268.03 L 1185 265.53 Z" fill="#82b366" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="all"/><path d="M 1199.95 79.04 L 1200 180 L 1520 180 L 1520 268.03" fill="none" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 1520 275.53 L 1515 265.53 L 1520 268.03 L 1525 265.53 Z" fill="#82b366" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="all"/><path d="M 1105.75 68.28 L 500 68.3 L 500 273.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 500 278.88 L 496.5 271.88 L 500 273.63 L 503.5 271.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 1075 40 L 160 40 L 160 273.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 160 278.88 L 156.5 271.88 L 160 273.63 L 163.5 271.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 680 330 L 680 280 L 1000 280 L 1000 330" fill="#d5e8d4" stroke="#82b366" stroke-miterlimit="10" pointer-events="all"/><path d="M 680 330 L 680 510 L 1000 510 L 1000 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><path d="M 680 330 L 1000 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="839.5" y="302.5">TS SP</text><text x="839.5" y="316.5">FF-A UUID = bdcd76d7-825e-4751-963b-86d4f84943ac</text></g><rect x="700" y="350" width="280" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 278px; height: 1px; padding-top: 380px; margin-left: 702px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Attestation service<br />Interface ID = 0<br />UUID = a1baf155-8876-4695-8f7c-54955e8db974</div></div></div></foreignObject><text x="702" y="384" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Attestation service...</text></switch></g><rect x="700" y="430" width="280" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 278px; height: 1px; padding-top: 460px; margin-left: 702px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Crypto service<br />Interface ID = 1<br /><div style=""><span style="background-color: initial;">UUID = d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0</span></div></div></div></div></foreignObject><text x="702" y="464" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Crypto service...</text></switch></g><path d="M 1020 330 L 1020 280 L 1340 280 L 1340 330" fill="#d5e8d4" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><path d="M 1020 330 L 1020 510 L 1340 510 L 1340 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><path d="M 1020 330 L 1340 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="1179.5" y="302.5">TS SP</text><text x="1179.5" y="316.5">FF-A UUID = bdcd76d7-825e-4751-963b-86d4f84943ac</text></g><rect x="1040" y="350" width="280" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 278px; height: 1px; padding-top: 380px; margin-left: 1042px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Protected storage<br />Interface ID = 0<br />UUID = 751bf801-3dde-4768-a514-0f10aeed1790</div></div></div></foreignObject><text x="1042" y="384" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Protected storage...</text></switch></g><rect x="1040" y="430" width="280" height="60" fill="#d5e8d4" stroke="#82b366" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 278px; height: 1px; padding-top: 460px; margin-left: 1042px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Internal trusted storage<br />Interface ID = 1<br /><div style=""><span style="background-color: initial;">UUID = dc1eef48-b17a-5ccf-ac8b-dfcff7711b14</span></div></div></div></div></foreignObject><text x="1042" y="464" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Internal trusted storage...</text></switch></g><path d="M 1360 330 L 1360 280 L 1680 280 L 1680 330" fill="#d5e8d4" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><path d="M 1360 330 L 1360 510 L 1680 510 L 1680 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><path d="M 1360 330 L 1680 330" fill="none" stroke="#82b366" stroke-miterlimit="10" pointer-events="none"/><g fill="rgb(0, 0, 0)" font-family="Helvetica" font-weight="bold" pointer-events="none" text-anchor="middle" font-size="12px"><text x="1519.5" y="302.5">TS SP</text><text x="1519.5" y="316.5">FF-A UUID = bdcd76d7-825e-4751-963b-86d4f84943ac</text></g><rect x="1380" y="350" width="280" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 278px; height: 1px; padding-top: 380px; margin-left: 1382px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Crypto service<br />Interface ID = 0<br /><div style=""><span style="background-color: initial;">UUID = d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0</span></div></div></div></div></foreignObject><text x="1382" y="384" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Crypto service...</text></switch></g><rect x="340" y="280" width="320" height="50" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 318px; height: 1px; padding-top: 305px; margin-left: 341px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Non-TS SP<br />FF-A UUID = <span style="background-color: initial;">020b365f-e907-4f7e-999d-20fbb7a03183<br /></span></div></div></div></foreignObject><text x="500" y="309" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Non-TS SP...</text></switch></g><rect x="0" y="280" width="320" height="50" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 318px; height: 1px; padding-top: 305px; margin-left: 1px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Non-TS SP<br />FF-A UUID = <span style="background-color: initial;">444ca317-4205-4a7b-b263-a80ec7b0e776<br /></span></div></div></div></foreignObject><text x="160" y="309" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Non-TS SP...</text></switch></g><ellipse cx="1180" cy="40" rx="105" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 208px; height: 1px; padding-top: 40px; margin-left: 1076px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Phase 1.<br />FFA_PARTITION_INFO_GET<br />Select TS SPs by FF-A UUID</div></div></div></foreignObject><text x="1180" y="44" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Phase 1....</text></switch></g><path d="M 1180 560 L 1180 501.97" fill="none" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="none"/><path d="M 1180 494.47 L 1185 504.47 L 1180 501.97 L 1175 504.47 Z" fill="#82b366" stroke="#82b366" stroke-width="4" stroke-miterlimit="10" pointer-events="none"/><ellipse cx="1180" cy="610" rx="123" ry="50" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="none"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 244px; height: 1px; padding-top: 610px; margin-left: 1058px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Phase 2.<br />Select service of a TS SP by service UUID (Get service info query)</div></div></div></foreignObject><text x="1180" y="614" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Phase 2....</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
diff --git a/docs/developer/service-access-protocols.rst b/docs/developer/service-access-protocols.rst
index 4161f0d..8a8c8a4 100644
--- a/docs/developer/service-access-protocols.rst
+++ b/docs/developer/service-access-protocols.rst
@@ -10,42 +10,254 @@
- Message serialization code is decoupled from service provider code using an abstract 'serializer' interface. Alternative
concrete serializers may provide implementations of the interface.
-RPC Session
------------
-
-Before a client can call trusted service methods, an RPC session must be established where an association is made between an RPC
-Caller and a call endpoint that corresponds to the required service provider instance. To establish the session, the client
-must provide:
-
- - An identifier for the service provider instance.
- - Any client credentials that allow RPC layer access control to be applied if needed.
-
-.. uml:: uml/RpcSessionClassDiagram.puml
-
-Once the RPC session is established, the client may call service methods via an abstract RPC Caller interface that takes the
-following parameters:
-
- - The opcode that identifies the method to call.
- - A buffer for the serialized method parameters.
- - A buffer for the serialized return values.
-
A deployment independent interface for locating services and establishing RPC sessions is described here: :ref:`Service Locator`
+Trusted Services protocol layers
+--------------------------------
+
+.. image:: image/TSProtocolLayers.svg
+
+* Service client interface: This component provides the interface to a given service for a user application, i.e. the PSA
+ Crypto, Internal Trusted Storage, etc. interface.
+
+* Service layer: This layer is responsible for serializing and deserializing the service specific parameters and it provides
+ a transparent interface between the caller and endpoint side.
+
+* RPC layer:
+
+ * RPC caller session: This component provides a session-like object for the service layer. After opening the session, it is
+ tied to the opened service interface of the endpoint. Each service call can use the simple begin/invoke/end interface for
+ requesting a buffer for the call parameters, for invoking the call and for releasing the response buffer.
+
+ The RPC caller session manages the lifetime of the shared memory. Currently it has two options. It either creates the
+ memory on session open and keeps it while the session is open, or it creates the shared buffer for each call and releases
+ it when the call ends (``end()``).
+
+ * RPC caller implementations (`ts_rpc_caller_linux`, `ts_rpc_caller_sp`, etc.): The RPC caller session is built on the
+ primitives of the RPC callers. These primitives allow the caller session finding the remote endpoint, creating and
+ releasing shared memories and doing the actual call.
+
+ The main RPC implementation is the TS RPC which is a TS specific RPC solution over FF-A. The project contains caller
+ implementations for Linux and for S-EL0 SPs. The Linux implementation is split between the user space and a kernel driver.
+
+ There are other RPC caller implementations (dummy, direct) which are used for testing purposes.
+
+ * RPC endpoint (`ts_rpc_endpoint_sp`): This component provides the RPC endpoint which can host multiple services. Once it
+ receives the call from the client, it finds the matching service and forwards the serialized call parameters to it.
+
+* FF-A layer: It is the transport layer of the protocol stack, and it provides interfaces for sending messages and sharing
+ memory between normal world and secure world components.
+
+TS RPC implementation
+---------------------
+
+Generic concepts
+''''''''''''''''
+
+* The requests are always sent by the caller and the endpoint sends a response.
+* The protocol version describes the ABI, the allowed values of the message fields and the behavior of the calls.
+* Service endpoints are provided by FF-A secure partitions.
+* Each endpoint can implement multiple services. The services are identified by their service UUID (**not** FF-A UUID). To
+ avoid including the UUID in each service call, a short interface ID is assigned to each service. The mapping of service
+ UUIDs and interface IDs can be queried by an RPC call. The lifetime of the interface ID is the same as the lifetime of the
+ service. The `0xff` interface ID is used for the management interface.
+* The service calls use shared memory to forward the call payload. It has to be shared via FF-A and then retrieved by the
+ endpoint. The shared memories are tied to an endpoint not to a service.
+* The errors which happen in the RPC layer will result in a RPC status code which indicates an error.
+* The errors which happen in the service handler will result in a service status code which indicates an error. In this case
+ the RPC status code will be `RPC_SUCCESS` as the RPC layer was able to forward the call between the service caller and the
+ service handler.
+
+ABI
+'''
+
+The ABI of the TS RPC protocol uses the 32 bit variants of ``FFA_MSG_SEND_DIRECT_REQ`` and ``FFA_MSG_SEND_DIRECT_RESP``
+interfaces of the FF-A specification. The use of the implementation specific arguments is listed in the table below.
+
+.. list-table:: TS RPC ABI
+ :header-rows: 1
+
+ * - Message name
+ - Short message ID
+ - W3[31:30] - SAP
+ - W3[29:24] - Flags
+ - W3[23:16] - Interface ID
+ - W3[15:0] - Opcode
+ - W4 - Arg1
+ - W5 - Arg2
+ - W6 - Arg3
+ - W7 - Arg4
+ * - RPC protocol version get request
+ - ``VERSION_GET``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0000``
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ * - RPC protocol version get response
+ - ``VERSION_GET``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0000``
+ - Version, starting from ``0x00000001``
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ * - Memory retrieve request
+ - ``MEM_RETRIEVE``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0001``
+ - FF-A memory handle LSW
+ - FF-A memory handle MSW
+ - FF-A memory tag LSW
+ - FF-A memory tag MSW
+ * - Memory relinquish request
+ - ``MEM_RELINQUISH``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0002``
+ - FF-A memory handle LSW
+ - FF-A memory handle MSW
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ * - Memory retrieve/relinquish response
+ - ``MEM_RETRIEVE``/``MEM_RELINQUISH``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0001``/``0x0002``
+ - TS RPC status
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ * - Service info get request
+ - ``SERVICE_INFO_GET``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0003``
+ - Service UUID
+ - Service UUID
+ - Service UUID
+ - Service UUID
+ * - Service info get response
+ - ``SERVICE_INFO_GET``
+ - ``0b00``
+ - ``0b000000``
+ - ``0xff``
+ - ``0x0003``
+ - TS RPC status
+ - ``[31:8]`` Reserved
+
+ ``[7:0]`` Queried service interface ID
+ - Reserved (MBZ)
+ - Reserved (MBZ)
+ * - Service call request
+ -
+ - ``0b00``
+ - ``0b000000``
+ - Service interface ID
+ - Service opcode
+ - FF-A memory handle LSW
+ - FF-A memory handle MSW
+ - Request length
+ - Client ID
+ * - Service call response
+ -
+ - ``0b00``
+ - ``0b000000``
+ - Service interface ID
+ - Service opcode
+ - TS RPC status
+ - Service status
+ - Response length
+ - Reserved
+
+* **RPC protocol version get**
+
+ Queries the RPC protocol version. This message must be available and backwards compatible for all protocol versions.
+
+* **Memory retrieve**
+
+ Requests the endpoint to do an ``FFA_MEM_RETRIEVE_REQ`` call using the forwarded FF-A memory handle and tag.
+
+* **Memory relinquish**
+
+ Requests the endpoint to do an ``FFA_MEM_RELINQUISH`` call using the forwarded FF-A memory handle.
+
+* **Service info get**
+
+ Query service information from the endpoint by the UUID of the service. The UUID is transmitted as defined in SMCCC section
+ 5.3 but in registers W4-W7. The returned service interface ID should be used in the service calls. Multiple endpoints can
+ implement the same service but one endpoint can implement a service only once.
+
+* **Service call**
+
+ After creating a shared memory and querying the interface ID for a given service UUID the caller can make a service call. The
+ service opcode and the contents of the shared memory is service specific. The request and response length fields indicate the
+ used area of the shared memory.
+
+ It is allowed to do a limited service call without shared memory, i.e. doorbell call. In this case the FF-A memory ID has to
+ be the invalid handle value ``0xffffffffffffffff``.
+
+Service discovery
+'''''''''''''''''
+
+* Query all TS SPs via ``FFA_PARTITION_INFO_GET`` call made to the SPMC. All TS SPs have the same FF-A UUID:
+ ``bdcd76d7-825e-4751-963b-86d4f84943ac`` If the system setup has fixed SP endpoint IDs, this step can be skipped.
+* Iterate thought the TS SPs and make a "Service info get request" RPC call to the SPs, containing the service UUID. If the
+ RPC status in the "Service info get response" is `RPC_SUCCESS`, the SP implements the service and its interface ID is returned
+ in the response.
+* If there are multiple instances of a service, the selection between these should be done in a service specific way (i.e.
+ query service version, capabilities, etc.).
+
+.. image:: image/TSServiceDiscovery.svg
+
+RPC status code values
+'''''''''''''''''''''''
+
+The status codes for the RPC layer are defined in `components/rpc/common/interface/rpc_status.h`. Currently the following values
+are defined:
+
+.. literalinclude:: ../../components/rpc/common/interface/rpc_status.h
+ :lines: 20-32
+ :language: C
+
+Example TS RPC call
+'''''''''''''''''''
+
+This example shows the full sequence of a service call by opening the RPC session, doing the call (begin/invoke/end) and then
+closing the session. In this case the RPC session it set to create individual shared memory for each call.
+
+.. uml:: uml/TSRPCCall.puml
+
+.. note::
+ Although the TS RPC layer messages use ``FFA_MSG_SEND_DIRECT_REQ``/``FFA_MSG_SEND_DIRECT_RESP`` interface and go through the
+ SPMC their destination is not the SPMC but the RPC endpoint. For simplifying the diagram, these calls are showed as direct
+ calls between the TS RPC caller and the TS RPC endpoint.
+
Status Codes
------------
-On returning from a request to invoke a service method, two status codes are returned as follows:
+On returning from a request to invoke a service method, two status codes are returned:
- *RPC status* - A generic status code that corresponds to the RPC call transaction. RPC status codes are standardized across
- all services.
- - *Operation status* - a service specific status code.
+ all services. (See: `RPC status code values`_)
+ - *Service status* - a service specific status code. (See: `Service Status Codes`_ )
Separation of status codes by layer allows service specific status codes to be accommodated while keeping RPC status codes
common.
-A client should only check the returned operation status if the returned RPC status value is RPC_CALL_ACCEPTED. All other RPC
-status values indicate that an error occurred in delivering the RPC request. An RPC status of RPC_CALL_ACCEPTED does not
-indicate that the service operation was successful. It merely indicates that the request was delivered, a suitable handler was
+A client should only check the returned service status if the returned RPC status value is `RPC_SUCCESS`. All other RPC
+status values indicate that an error occurred in delivering the RPC request. An RPC status of `RPC_SUCCESS` does not
+indicate that the service was successful. It merely indicates that the request was delivered, a suitable handler was
identified and the request parameters were understood.
Service Access Protocol Definition Conventions
@@ -62,7 +274,7 @@
It is possible that for certain deployments, it will be necessary to customize which parameter encoding scheme is used. Many
schemes are possible such as Protocol Buffers, CBOR, JSON, TLV, TPM commands or packed C structures. To make scheme
-customization straight forward, serilize/deserialize operations should be encapsulated behind a common interface to decouple
+customization straight forward, serialize/deserialize operations should be encapsulated behind a common interface to decouple
service provider code from any particular serialization scheme. A section below describes a pattern for achieving this.
Service Namespace
@@ -122,14 +334,6 @@
protocols/service/crypto/protobuf/export_public_key.proto
-RPC Status Codes
-````````````````
-
-Generic RPC status code definitions using different definition schemes are defined here::
-
- protocols/rpc/common/protobuf/status.proto
- protocols/rpc/common/packed-c/status.h
-
Service Status Codes
````````````````````
@@ -182,21 +386,11 @@
int serialize_for_method(msg_buffer *buf, in args...);
int deserialize_for_method(const msg_buffer *buf, out args...);
-To extend a service provider to support a new serialization encoding, the following steps are required:
-
- 1. Define a new encoding identifier string if a suitable one doesn't exist. Currently used identifiers are protobuf and
- packed-c. The identifier will be used as a directory name so it needs to be filename-friendly. Some likely candidate
- identifiers could be cbor and json.
- 2. Add a new RPC encoding ID to *protocols/rpc/common/packed-c/encoding.h*. This is used by a caller to identify the encoding
- used for RPC parameters. This is analogous to the content-type header parameter used in HTTP.
- 3. Under the protocols parent directory, add a new access protocol definition for the service that needs extending. This will
- be a representation of existing service access protocols but using a definition notation compatible with the new encoding.
- 4. Add a new serializer implementation under the service provider's serializer directory e.g. for the crypto service -
- *components/service/crypto/provider/serializer*.
- 5. Add registration of the new serializer to any deployment initialization code where the new encoding is needed.
+Encoding types are represented as dedicated service interfaces in the RPC protocol and as such are identified by a uniq
+service UUID.
--------------
-*Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.*
+*Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.*
SPDX-License-Identifier: BSD-3-Clause
diff --git a/docs/developer/uml/TSRPCCall.puml b/docs/developer/uml/TSRPCCall.puml
new file mode 100644
index 0000000..9359d27
--- /dev/null
+++ b/docs/developer/uml/TSRPCCall.puml
@@ -0,0 +1,107 @@
+'-------------------------------------------------------------------------------
+' Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+'
+' SPDX-License-Identifier: BSD-3-Clause
+'
+'-------------------------------------------------------------------------------
+
+@startuml TS RPC call sequence
+
+autoactivate on
+
+participant "Service caller" as service_caller
+participant "RPC caller session" as rpc_session
+participant "TS RPC caller" as rpc_caller
+participant "SPMC" as spmc
+participant "TS RPC endpoint" as endpoint
+participant "Service" as service
+
+service_caller -> rpc_session: open(service_uuid)
+
+' Sesssion open
+rpc_session -> rpc_caller: find_and_open_session(service_uuid)
+
+rpc_caller -> spmc: FFA_PARTITION_INFO_GET(ts_rpc_uuid)
+spmc --> rpc_caller: FF-A endpoint_id
+
+rpc_caller -> endpoint: TS_RPC_VERSION_GET
+endpoint --> rpc_caller: TS RPC protocol version
+
+rpc_caller -> endpoint: TS_RPC_SERVICE_INFO_GET(service_uuid)
+endpoint --> rpc_caller: Service interface_id
+
+rpc_caller --> rpc_session: TS RPC status
+
+rpc_session --> service_caller: TS RPC status
+
+' Begin
+service_caller -> rpc_session: begin(request_length, response_max_length)
+
+rpc_session -> rpc_session: allocate_buffer(MAX(request_length, response_max_length))
+rpc_session --> rpc_session: buffer
+
+rpc_session -> rpc_caller: create_shared_memory(endpoint_id, buffer)
+
+rpc_caller -> spmc: FFA_MEM_SHARE(endpoint_id, buffer)
+spmc --> rpc_caller: memory_handle, memory_tag
+
+rpc_caller -> endpoint: TS_RPC_MEM_RETRIEVE(memory_handle, memory_tag)
+
+endpoint -> spmc: FFA_MEM_RETRIEVE(memory_handle, memory_tag)
+spmc --> endpoint: buffer
+
+endpoint --> rpc_caller: TS RPC status
+
+rpc_caller --> rpc_session: TS RPC status, shared_memory
+
+rpc_session --> service_caller: Request buffer
+
+' Serialize
+service_caller -> service_caller: Serialize parameters to request buffer
+service_caller --> service_caller
+
+' Invoke
+service_caller -> rpc_session: invoke(opcode)
+
+rpc_session -> rpc_caller: call(opcode, shared_memory, request_length)
+
+rpc_caller -> endpoint: service_call(interface_id, opcode, memory_handle, request_length)
+
+endpoint -> service: service_call(opcode, request)
+service --> endpoint: service status, response
+
+endpoint --> rpc_caller: TS RPC status, service status, response length
+
+rpc_caller --> rpc_session: TS RPC status, service status, response length
+
+rpc_session --> service_caller: TS RPC status, service status, response
+
+' Deserialize
+service_caller -> service_caller: Deserialize return values from the response buffer
+service_caller --> service_caller
+
+' End
+service_caller -> rpc_session: end()
+
+rpc_session -> rpc_caller: release_shared_memory(shared_memory)
+
+rpc_caller -> endpoint: TS_RPC_MEM_RELINQUISH(memory_handle)
+
+endpoint -> spmc: FFA_MEMORY_RELINQUISH(memory_handle)
+spmc --> endpoint: FFA_SUCCESS
+
+endpoint --> rpc_caller: TS RPC status
+
+rpc_caller -> spmc: FFA_MEM_RECLAIM(memory_handle)
+spmc --> rpc_caller: FFA_SUCCESS
+
+rpc_caller -> rpc_caller: free(buffer)
+rpc_caller --> rpc_caller
+
+rpc_caller --> rpc_session: TS RPC status
+
+rpc_session --> service_caller: TS RPC status
+
+service_caller -> rpc_session: close()
+rpc_session --> service_caller: TS RPC status
+@enduml