On 02/07/19 9:11 PM, Jan Kiszka wrote: > 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... Will update. >> >> 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: I thought you meant you wanted to change the hard value of 32 to a size define. My bad, sorry. > 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. Seems like a good number. We don't use more than 8 in our boards. But changing it to a resizeable array should not be a problem either. Now that I think of it, it is probably a better idea. I'll change it. >> +#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 > -- Regards, Pratyush Yadav -- 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/0bfd4d29-4f35-5346-209d-cafcdbdb2151%40ti.com. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 3/6] core: Add stream id list in the cell config
'Pratyush Yadav' via Jailhouse Wed, 03 Jul 2019 02:14:02 -0700
- Re: [PATCH 6/6] arm64: iommu: smmu-v3:... Jan Kiszka
- Re: [PATCH 6/6] arm64: iommu: smmu... 'Pratyush Yadav' via Jailhouse
- Re: [PATCH 6/6] arm64: iommu: ... Jan Kiszka
- Re: [PATCH 6/6] arm64: iom... 'Pratyush Yadav' via Jailhouse
- Re: [PATCH 6/6] arm64... Jan Kiszka
- Re: [PATCH 6/6] a... 'Pratyush Yadav' via Jailhouse
- Re: [PATCH 6/6] a... Jan Kiszka
- Re: [PATCH 6/6] a... 'Pratyush Yadav' via Jailhouse
- [PATCH 3/6] core: Add stream id list in the... 'Pratyush Yadav' via Jailhouse
- Re: [PATCH 3/6] core: Add stream id li... Jan Kiszka
- Re: [PATCH 3/6] core: Add stream i... 'Pratyush Yadav' via Jailhouse
