On 02.07.19 16:36, Pratyush Yadav wrote:
From: Nikhil Devshatwar <[email protected]>
When IOMMU drivers are supported, it will setup the IO address
translation tables unique for each DMA context in the system.
To make it clearer: When ARM IOMMUs are supported...
A typical DMA context is identified by an integer called stream id.
To setup the correct IOMMU mapping, hypervisor should know
list of all the streamIDs that should be setup in the IOMMU.
Add an array of stream IDs in the cell config, bump up the config revision.
Change the python struct unpacking logic in the tools to reflect
revised config structure.
[[email protected]: Add size define for stream_ids]
Signed-off-by: Nikhil Devshatwar <[email protected]>
Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Pratyush Yadav <[email protected]>
---
include/jailhouse/cell-config.h | 6 +++++-
tools/jailhouse-cell-linux | 4 ++--
tools/jailhouse-hardware-check | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/jailhouse/cell-config.h b/include/jailhouse/cell-config.h
index 198fef5c..caf2fba8 100644
--- a/include/jailhouse/cell-config.h
+++ b/include/jailhouse/cell-config.h
@@ -50,7 +50,7 @@
* Incremented on any layout or semantic change of system or cell config.
* Also update HEADER_REVISION in tools.
*/
-#define JAILHOUSE_CONFIG_REVISION 10
+#define JAILHOUSE_CONFIG_REVISION 11
#define JAILHOUSE_CELL_NAME_MAXLEN 31
@@ -74,6 +74,9 @@
#define JAILHOUSE_CELL_DESC_SIGNATURE "JHCELL"
+#define JAILHOUSE_MAX_STREAMIDS 32
At the risk of having asked this already in the RFC:
Is 32 really enough in the foreseeable future? Or should we rather have some
resizable array, analogously to memory regions or PCI devices? That would also
allow to set it to 0 on non-SMMU platforms.
+#define JAILHOUSE_INVALID_STREAMID (~0)
+
/**
* The jailhouse cell configuration.
*
@@ -95,6 +98,7 @@ struct jailhouse_cell_desc {
__u32 pio_bitmap_size;
__u32 num_pci_devices;
__u32 num_pci_caps;
+ __u32 stream_ids[JAILHOUSE_MAX_STREAMIDS];
__u32 vpci_irq_base;
diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
index 49babd92..4b6f504b 100755
--- a/tools/jailhouse-cell-linux
+++ b/tools/jailhouse-cell-linux
@@ -564,8 +564,8 @@ class Irqchip:
class Config:
- _HEADER_FORMAT = '6sH32s4xIIIIIIIIIQ8x32x'
- _HEADER_REVISION = 10
+ _HEADER_FORMAT = '6sH32s4xIIIIIIII128xIQ8x32x'
+ _HEADER_REVISION = 11
def __init__(self, config_file):
self.data = config_file.read()
diff --git a/tools/jailhouse-hardware-check b/tools/jailhouse-hardware-check
index b86756ac..afd1139b 100755
--- a/tools/jailhouse-hardware-check
+++ b/tools/jailhouse-hardware-check
@@ -136,7 +136,7 @@ class Sysconfig:
X86_MAX_IOMMU_UNITS = 8
X86_IOMMU_SIZE = 20
- HEADER_REVISION = 10
+ HEADER_REVISION = 11
HEADER_FORMAT = '6sH'
def __init__(self, path):
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/33ad2ca9-c618-1443-9fb4-ab5af325ee25%40siemens.com.
For more options, visit https://groups.google.com/d/optout.