mem: fix ivshmem freeing
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Fri, 7 Aug 2015 15:27:33 +0000 (16:27 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 9 Aug 2015 17:45:25 +0000 (19:45 +0200)
commitcd10c42eb5bcdc9b8d6f91db5929ed0e54132181
treed7ec3e480c1d6987504aa4a47875a9ee71df957c
parentd1668c9762ad5f2e9e6ad8436e6a23bac64473c9
mem: fix ivshmem freeing

There is no sync between host and guest to allow removal of memzones,
and freeing them result in undefined behavior.

In the guest, we identify IVSHMEM memsegs/memzones by having
ioremap_addr != 0. In the host, nothing is done to the memzone, meaning
ioremap_addr == 0.

As a solution, mark memzones being added to IVSHMEM in the host, by
setting ioremap_addr, then return an error whenever we try to free an
IVSHMEM memzone.

Fixes: ff909fe21f0 ("mem: introduce memzone freeing")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/common/eal_common_memzone.c
lib/librte_eal/common/include/rte_memzone.h
lib/librte_ivshmem/rte_ivshmem.c