On 2018-04-23 16:21, [email protected] wrote:
> On Friday, April 20, 2018 at 12:07:58 PM UTC+5:30, J. Kiszka wrote:
>> On 2018-04-20 07:01, [email protected] wrote:
>>> On Thursday, April 19, 2018 at 8:17:18 PM UTC+5:30, J. Kiszka wrote:
>>>> On 2018-04-19 09:51, [email protected] wrote:
>>>>> Hi,
>>>>>
>>>>>   I am trying some experiments in Shared memory, 
>>>>> CASE 1:
>>>>> I have shared some common memory region between root and non-root cell. 
>>>>> using this mem-region i am able to communicate between root and non-root 
>>>>> cell(if i write data from root cell to that mem-region i am able to read 
>>>>> the same data in non-root cell). I have added shared memory in the root 
>>>>> cell at the end-of mem-region(last-index of mem-region).
>>>>>
>>>>> CASE 2:
>>>>>  But when i add this shared mem-region in the middle of root cell 
>>>>> mem-region, i am not able to communicate between root and non-root 
>>>>> cell(read and write is not happening from root-cell to non-root cell). 
>>>>>
>>>>> Can someone please explain me why CASE 2 is not working, is that 
>>>>> mandatory to add shared memory config at the end-of mem-region(last 
>>>>> index)?  
>>>>>
>>>>> * I am not linked any PCI device to shared mem-region in both the cases.
>>>>>
>>>>> * For reading and writing from shared mem-region we are using our 
>>>>> application.
>>>>>
>>> Thanks for the replay Jan,
>>>
>>>> It's hard to give you any good suggestion without seeing the configs in
>>>> question. 
>>> I am attaching both root and non-root cell configs can you please take look 
>>> at it once.
>>>
>>>> Maybe you didn't split up that larger mem region properly into
>>>> two regions, 
>>>
>>>  My inmate starting address is: 0x404000000, and my inmate high RAM starts 
>>> from 0x404300000, I am adding below region into both root and non-root 
>>> cell(non-root cell i added JAILHOUSE_MEM_ROOTSHARED flag). 
>>>
>>>     /* MemRegion: 404100000 : IVSHMEM :JH-added */
>>>                 {
>>>                         .phys_start = 0x404100000,
>>>                         .virt_start = 0x404100000,
>>>                         .size = 0x100000,
>>>                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
>>>                 },
>>>
>>>
>>>> maybe the reference from the ivshmem device to the share
>>>> memory region by index is not longer correct, 
>>>
>>> i am not linking PCI config to mem-region, index is only matter when we 
>>> link PCI and mem-region is that correct?
>>
>> Your configs do not contain any shared memory device.
> I agreed my config do not contain any shared memory device but my config 
> contain 
> shared memory region. The below region i am sharing both root and non-root 
> cell, but i am not linking any PCI device to these region.
> 
>             /* MemRegion: 404100000 : IVSHMEM :JH-added */
>                 {
>                         .phys_start = 0x404100000,
>                         .virt_start = 0x404100000,
>                         .size = 0x100000,
>                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
>                 },
> 
> 
>> Look at
>> configs/[x86/]qemu-x86.c and .../linux-x86-demo.c to see what is
>> missing. 
> As you suggested i comapred my configs and above mentioned configs(qemu-x86.c 
> and linux-x86-demo.c), In this configs they are using PCI device to link 
> between root and non-root cell.
>                  { /* IVSHMEM (networking) */
>                         .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
>                         .domain = 0x0000,
>                         .bdf = 0x0e << 3,
>                         .bar_mask = {
>                                 0xffffff00, 0xffffffff, 0x00000000,
>                                 0x00000000, 0xffffffe0, 0xffffffff,
>                         },
>                         .num_msix_vectors = 1,
>                         .shmem_region = 14,
>                         .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
>                 },
> 
>  But i don't want to add above PCI configuration to my configs,  Without 
> adding this configuration to my config i can communicate between root and 
> non-root cell, but only problem is i need to add my shared-region at the end 
> of my config(in mem-region). is that mandatory to add the shared-region at 
> the end-of my config(mem-region)?
> 

The configuration of shared memory regions at Jailhouse level is indeed
independent of the shared memory device. They work, irrespective of
their position in the config (if the config is otherwise correct, didn't
check for details in yours).

However, you do not get any information to your guest where these
regions are located, nor will you have event signaling (interrupts).

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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to