qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

REG: Shared Memory mapping issue in QEMU with QNX


From: Gowri Shankar
Subject: REG: Shared Memory mapping issue in QEMU with QNX
Date: Fri, 19 Mar 2021 20:33:14 +0530

Hello Team,

I am facing the below issue while mapping the physical address to process caller address in the QEMU .

Issue: While trying the following APIs we were not able to Map a device's physical memory into a process's address space(Shared memory )
in qemu with the addresses provided in the api.

Description:

We have generated IFS from QNX and are able to boot inside the QNX-OS.

Please find the code snippet of shared memory write and read.

The application running successfully without error(ie, mmap_device_memory returns successful
but doesn't map to a readable or writable location. ),
But, we Need to make sure of the points below.
 1. whether the string "Test! How are you" is copied to "mapped_base" address (shared memory) or not.
 2. whether able to read the string "Test! How are you" from the "mapped_base" address (shared memory).
    (Actually in our case, Able to read the shared memory but the value is empty Hence need to make sure the above points).


NOTE: (0x19B7FFFF -> Dummy address)

Shared Memory write
*******************

    void *mapped_base;
    mapped_base = (char*)mmap_device_memory((void*)0, MAP_SIZE, PROT_READ | PROT_WRITE |PROT_NOCACHE, MAP_TYPE, 0x19B7FFFF);
                                                 (or)
mapped_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE | PROT_NOCACHE, (MAP_TYPE & ~MAP_TYPE) | MAP_PHYS| MAP_ANON | MAP_SHARED , NOFD,  0x19B7FFFF); 

    strcpy(mapped_base, "Test! How are you");


Shared Memory Read
*******************
     void *mapped_base;
char test[256];
     mapped_base = (char*)mmap_device_memory((void*)0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_TYPE, 0x19B7FFFF);
                                                  (or)
mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE | PROT_NOCACHE, (MAP_TYPE & ~MAP_TYPE) | MAP_PHYS| MAP_ANON | MAP_SHARED, NOFD,  0x19B7FFFF);  
strcpy(test, mapped_base);

Query :

1. In general how the hardware configuration is done in Qemu. Somehow Qemu needs to know what sits at which device address, e.g. what is the address space for DRAM, into which we try to map the data.
2. Why the address mapping does not happen as expected when we are using API (mmap_device_memory or mmap) without a file descriptor. Is any configuration or dependency required in QEMU to achieve the shared memory emulation?
   
--
Thanks & Regards,
P. Gowrishankar.
+919944802490




reply via email to

[Prev in Thread] Current Thread [Next in Thread]