qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 2/2] pc: fix QEMU crashing when more than ~50 memo


From: Paolo Bonzini
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


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



reply via email to

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