[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate
From: |
liu ping fan |
Subject: |
Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate |
Date: |
Thu, 23 May 2013 21:06:48 +0800 |
On Thu, May 23, 2013 at 5:59 PM, Paolo Bonzini <address@hidden> wrote:
> Il 23/05/2013 09:09, liu ping fan ha scritto:
>>> > void address_space_rw(AddressSpace *as, hwaddr addr, uint8_t *buf,
>>> > int len, bool is_write)
>>> > {
>>> > - AddressSpaceDispatch *d = as->dispatch;
>>> > - int l;
>>> > + hwaddr l;
>>> > uint8_t *ptr;
>>> > uint32_t val;
>>> > - hwaddr page;
>>> > + hwaddr addr1;
>>> > MemoryRegionSection *section;
>>> >
>>> > while (len > 0) {
>>> > - page = addr & TARGET_PAGE_MASK;
>>> > - l = (page + TARGET_PAGE_SIZE) - addr;
>>> > - if (l > len)
>>> > - l = len;
>>> > - section = phys_page_find(d, page >> TARGET_PAGE_BITS);
>>> > + l = len;
>>> > + section = address_space_translate(as, addr, &addr1, &l,
>>> > is_write);
>>> >
>> Jan's "Rework sub-page handling" patch broke the tlb_set_page
>> (anything else?) But I think we still need a function based on
>> address_space_translate to wrap the subpage logic inside and ease the
>> incoming RCU style.
>
> The idea is that address_space_translate gets a ref to the MemoryRegion,
> and the ref is then released by the caller of address_space_translate.
>
This will require subpage hold a reference to real mr. But I think it
is needless. Maybe when later in your these series, we will see how to
resolve it. BTW, do you target URCU patches to 1.6
Regards,
Pingfan
> That means that the actual memory accesses can run outside the RCU
> critical section.
>
> But I'm not sure how that is related to subpage logic. Subpages are
> simply MemoryRegions that only exist in the phys page map, rather than
> within an AddressSpace. Their destruction will be delayed anyway by
> doing call_rcu on the old phys page map.
>
> Paolo
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, (continued)
[Qemu-devel] [PATCH 16/30] memory: clean up phys_page_find, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 18/30] memory: add return value to address_space_rw/read/write, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/21
Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Peter Maydell, 2013/05/23
Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/25
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/25
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/25
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/25
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/25
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/26
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/26
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/27