[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid |
Date: |
Fri, 24 May 2013 08:13:32 +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-23 20:04, Peter Maydell wrote:
> On 21 May 2013 11:57, Paolo Bonzini <address@hidden> wrote:
>> +bool address_space_valid(AddressSpace *as, hwaddr addr, int len, bool
>> is_write)
>> +{
>> + AddressSpaceDispatch *d = as->dispatch;
>> + MemoryRegionSection *section;
>> + int l;
>> + hwaddr page;
>> +
>> + while (len > 0) {
>> + page = addr & TARGET_PAGE_MASK;
>> + l = (page + TARGET_PAGE_SIZE) - addr;
>> + if (l > len) {
>> + l = len;
>> + }
>> + section = phys_page_find(d, addr >> TARGET_PAGE_BITS);
>> + if (section->mr == &io_mem_unassigned ||
>> + (is_write && section->mr->readonly)) {
>
> It's kind of bogus that io_mem_unassigned is the only MemoryRegion
> that can be unreadable. Why is 'readonly' a MemoryRegion attribute
> and 'writeonly' not? Shouldn't we be calling the MemoryRegionOps
> accepts() callback here? What about access alignment constraints
> and access size restrictions? What if the validity of the range
> changes between the time you asked and when you actually do the
> access?
>
> The whole API is kind of unconvincing really, especially since
> the only thing we seem to use it for is some parameter checking
> in spapr_llan.c (via a huge pile of intermediate wrappers).
I'll also have a use for it: replace isa_is_ioport_assigned.
Jan
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 12/30] s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62, (continued)
- [Qemu-devel] [PATCH 12/30] s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62, Paolo Bonzini, 2013/05/21
- [Qemu-devel] [PATCH 13/30] memory: limit sections in the radix tree to the actual address space size, Paolo Bonzini, 2013/05/21
- [Qemu-devel] [PATCH 14/30] memory: create FlatView for new address spaces, Paolo Bonzini, 2013/05/21
- [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Paolo Bonzini, 2013/05/21
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Peter Maydell, 2013/05/23
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Paolo Bonzini, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Peter Maydell, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Paolo Bonzini, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Peter Maydell, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Paolo Bonzini, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, Peter Maydell, 2013/05/24
- Re: [Qemu-devel] [PATCH 15/30] memory: add address_space_valid, David Gibson, 2013/05/24