qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 17/21] introduce memory_region_get_address() and


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 17/21] introduce memory_region_get_address() and use it in kvm/ioapic
Date: Tue, 23 Apr 2013 23:46:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 23/04/2013 23:39, Peter Maydell ha scritto:
>> >
>> > Hmm, good point.  address_space_get_region_addr()?
> Maybe we should make this parallel-ish to memory_region_find()
> (which finds an MR within an AS by addr/size)?
> 
> Actually, I think I'd favour cleaning up some of the existing
> API which has parameters named "address_space" which are
> MemoryRegion*s. I think these probably predate the AddressSpace
> type and should be updated to use it (and be renamed to fit too).
> 
> So how about:
>  MemoryRegionSection memory_region_find(MemoryRegion *address_space,
>                                        hwaddr addr, uint64_t size);
> becomes
>  MemoryRegionSection address_space_find_region_by_addr(
>                                        AddressSpace *address_space,
>                                        hwaddr addr, uint64_t size);
> (bit of a mouthful, but never mind)
> 
>  void memory_global_sync_dirty_bitmap(MemoryRegion *address_space);
> becomes
>  void address_space_sync_dirty_bitmap(AddressSpace *address_space);
> 
> (in both cases the first thing the implementation does is call
> memory_region_to_address_space() to get the AddressSpace* anyway.)
> 
> and our new function is
>  MemoryRegionSection address_space_find_region(AddressSpace *as,
>                                                MemoryRegion *mr);
> 
> ?
> 
> (we don't have to do the tidyup first, but the new function
> signature makes more sense viewed in the light of the others)

I can look at it for 1.6, since I've already forward ported Avi's IOMMU
patches and added s/DMAContext/AddressSpace/ on top.

What about 1.5 though?

Paolo



reply via email to

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