From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [RFC 2/2] pc: fix QEMU crashing when more than ~50 memory hotplugged
Date: Wed, 03 Jun 2015 17:08:00 +0200 [thread overview]
Message-ID: <556F1850.7090903@redhat.com> (raw)
In-Reply-To: <20150603160526.7727e4e4@nial.brq.redhat.com>
On 03/06/2015 16:05, Igor Mammedov wrote:
>>> > > + rsvd_hva = memory_region_find_rsvd_hva(section->mr);
>>> > > + if (rsvd_hva.mr) {
>>> > > + start_addr = rsvd_hva.offset_within_address_space;
>>> > > + size = int128_get64(rsvd_hva.size);
>>> > > + ram = memory_region_get_ram_ptr(rsvd_hva.mr);
>>> > > + } else {
>>> > > + ram = memory_region_get_ram_ptr(section->mr) + section->offset_within_region;
>>> > > + }
>> >
>> > I don't think this is needed.
>> >
>> > What _could_ be useful is to merge adjacent ranges even if they are
>> > partly unmapped, but your patch doesn't do that.
> merging/splitting for adjacent regions is done at following
> vhost_dev_(un)assign_memory() but it doesn't cover cases with
> gaps in between.
>
> Trying to make merging/splitting work with gaps might be more
> complicated (I haven't tried though), than just passing known
> in advance whole rsvd_hva range.
>
> More over if/when initial memory also converted to rsvd_hva
> (aliasing stopped me there for now), we could throw away all
> this merging and just keep a single rsvd_hva range for all RAM here.
Understood now. This still should be a separate patch. I'm much more
confident with the other two (e.g. what happens if a malicious guest
writes to memory that is still MAP_NORESERVE), so feel free to post
those without RFC tag. But the vhost one really needs mst's eyes.
Paolo
next prev parent reply other threads:[~2015-06-03 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 12:22 [Qemu-devel] [RFC 0/2] Fix QEMU crash during memory hotplug with vhost=on Igor Mammedov
2015-06-03 12:22 ` [Qemu-devel] [RFC 1/2] memory: introduce MemoryRegion container with reserved HVA range Igor Mammedov
2015-06-03 12:45 ` Paolo Bonzini
2015-06-03 13:43 ` Igor Mammedov
2015-06-03 12:22 ` [Qemu-devel] [RFC 2/2] pc: fix QEMU crashing when more than ~50 memory hotplugged Igor Mammedov
2015-06-03 12:48 ` Paolo Bonzini
2015-06-03 14:05 ` Igor Mammedov
2015-06-03 15:08 ` Paolo Bonzini [this message]
2015-06-03 15:23 ` Igor Mammedov
2015-06-03 16:11 ` Paolo Bonzini
2015-06-03 16:30 ` Michael S. Tsirkin
2015-06-03 15:05 ` [Qemu-devel] [RFC 0/2] Fix QEMU crash during memory hotplug with vhost=on Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=556F1850.7090903@redhat.com \
--to=pbonzini@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.