qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] vhost: fix a migration failed because of vhost


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH] vhost: fix a migration failed because of vhost region merge
Date: Mon, 24 Jul 2017 15:01:28 +0200

Michael,

You once advocated idea of using MAP_NORESERVE to reserve continuous
HVA upto maxmmem in QEMU and then 'allocating' guest's RAM from that range
so that translation map for vhost could consist only from
that single pre-reserved HVA range and and if guest access
page outside of actually present memory it would be ok
to let guest misbehave.

Reason we get so many fragments is holes pocked in
initial RAM by device memory/MMIO ranges. Maybe we can reuse
'would be ok to let guest misbehave' part in vhost_set_memory()
which tracks flat memory map represented by sections.

Idea here is that each section has reference to a MemoryRegion it belongs to,
for vhost mem map we could reuse that MemoryRegion range instead
of set of sections that belong to it. Well behaved guest will continue
working as it uses accessible RAM pages and malicious guest will
misbehave if it will ask for translation of the page outside of
accessible RAM.
This way vhost mem map will typically have 1/2 entries for
low/high mem ranges + an entry per each dimm. This way we
can keep the same or less number of entries in vhost map
without merging (as in practice it works only for fragmented
initial memory and by chanse may work for dimm device)
and at the same time number of entries will be constant
(number of RAM memory regions) depending on initial RAM amount
and amount of used dimm devices regardless of the order they were created
or the runtime point they are created at.



reply via email to

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