[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC][PATCH 09/15] memory: Introduce address_space_look
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [RFC][PATCH 09/15] memory: Introduce address_space_lookup_region |
Date: |
Mon, 06 May 2013 16:51:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2013-05-06 16:39, Paolo Bonzini wrote:
> Il 06/05/2013 16:26, Jan Kiszka ha scritto:
>> This new service so far only replaces phys_page_find as public API. In a
>> follow-up step, it will return the effective memory region for the
>> specified address, i.e. after resolving what are currently sub-pages.
>> Moreover, it will also once encapsulate locking and reference counting
>> when we introduce BQL-free dispatching.
>
> In my IOMMU rebase I have a similar function:
>
> /* address_space_translate: translate an address range into an address space
> * into a MemoryRegionSection and an address range into that section.
> *
> * @as: #AddressSpace to be accessed
> * @addr: address within that address space
> * @xlat: pointer to address within the returned memory region section's
> * #MemoryRegion.
> * @len: pointer to length
> * @is_write: indicates the transfer direction
> */
> MemoryRegionSection *address_space_translate(AddressSpace *as, hwaddr addr,
> hwaddr *xlat, hwaddr *len,
> bool is_write);
>
> It wraps (actually, replaces) both phys_page_find and
> memory_region_section_addr.
Good, looks like we are heading in similar directions. What is the
purpose of len? When does is_write matter?
In a later step, this should become something like
address_space_get_region_ref (to be paired with memory_region_unref,
once done). So this one also takes care of incrementing the reference
counter or acquiring the BQL, as necessary. Currently, it asks the
caller to specify if the BQL is already held, but that will change.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
- Re: [Qemu-devel] [RFC][PATCH 08/15] isa: implement isa_is_ioport_assigned via memory_region_find, (continued)
[Qemu-devel] [RFC][PATCH 11/15] memory: Allow unaligned address_space_rw, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 09/15] memory: Introduce address_space_lookup_region, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 07/15] Privatize register_ioport_read/write, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 01/15] adlib: replace register_ioport*, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 04/15] i82374: replace register_ioport*, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 15/15] ioport: Move IOPortRead/WriteFunc typedefs to memory.h, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 13/15] ioport: Switch dispatching to memory core layer, Jan Kiszka, 2013/05/06
[Qemu-devel] [RFC][PATCH 05/15] prep: replace register_ioport*, Jan Kiszka, 2013/05/06
Re: [Qemu-devel] [RFC][PATCH 00/15] Refactor portio dispatching, Andreas Färber, 2013/05/06