qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/29] kvm: accept non-mapped memory in kvm_dirt


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 10/29] kvm: accept non-mapped memory in kvm_dirty_pages_log_change
Date: Tue, 26 May 2015 10:16:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


On 26/05/2015 10:10, Fam Zheng wrote:
> > It is okay if memory is not mapped into the guest but has dirty logging
> > enabled.  When this happens, KVM will not do anything and only accesses
> > from the host will be logged.
> > 
> > Signed-off-by: Paolo Bonzini <address@hidden>
> 
> Could you explain where this change is needed?

I received a report of this error, obtained via iofuzz.

Paolo

> Fam
> 
>> > ---
>> >  kvm-all.c | 8 +++-----
>> >  1 file changed, 3 insertions(+), 5 deletions(-)
>> > 
>> > diff --git a/kvm-all.c b/kvm-all.c
>> > index 989fdd9..616bf04 100644
>> > --- a/kvm-all.c
>> > +++ b/kvm-all.c
>> > @@ -335,12 +335,10 @@ static int kvm_dirty_pages_log_change(hwaddr 
>> > phys_addr,
>> >      KVMSlot *mem = kvm_lookup_matching_slot(s, phys_addr, phys_addr + 
>> > size);
>> >  
>> >      if (mem == NULL)  {
>> > -        fprintf(stderr, "BUG: %s: invalid parameters " TARGET_FMT_plx "-"
>> > -                TARGET_FMT_plx "\n", __func__, phys_addr,
>> > -                (hwaddr)(phys_addr + size - 1));
>> > -        return -EINVAL;
>> > +        return 0;
>> > +    } else {
>> > +        return kvm_slot_dirty_pages_log_change(mem, log_dirty);
>> >      }
>> > -    return kvm_slot_dirty_pages_log_change(mem, log_dirty);
>> >  }



reply via email to

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