From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
qemu-devel@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 10/21] memory: make section size a 128-bit integer
Date: Fri, 07 Jun 2013 11:23:49 +1000 [thread overview]
Message-ID: <51B13625.1070309@ozlabs.ru> (raw)
In-Reply-To: <51B132C1.8010406@redhat.com>
On 06/07/2013 11:09 AM, Paolo Bonzini wrote:
> Il 06/06/2013 04:36, Alexey Kardashevskiy ha scritto:
>>>> diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
>>>> index 693a9ff..c89676b 100644
>>>> --- a/hw/misc/vfio.c
>>>> +++ b/hw/misc/vfio.c
>>>> @@ -1953,7 +1953,7 @@ static void vfio_listener_region_add(MemoryListener *listener,
>>>> }
>>>>
>>>> iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
>>>> - end = (section->offset_within_address_space + section->size) &
>>>> + end = (section->offset_within_address_space + int128_get64(section->size)) &
>>>> TARGET_PAGE_MASK;
>>
>>
>> Another problem with this patch. Here is some more context (***):
>
> By the time you get here, this should have already crashed at this
> code that patch 13 adds:
>
> diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
> index c89676b..52fb036 100644
> --- a/hw/misc/vfio.c
> +++ b/hw/misc/vfio.c
> @@ -1939,6 +1939,8 @@ static void vfio_listener_region_add(MemoryListener *listener,
> void *vaddr;
> int ret;
>
> + assert(!memory_region_is_iommu(section->mr));
> +
>
> so it seems like a bug in your VFIO patches.
No, I have David's patches which fix all of this, I'm planning to post them
soon.
My question is rather what is the whole point of calling
memory_region_init_iommu with size==UINT64_MAX?
mem_add() tries to do register_subpage() when size is not aligned
(UINT64_MAX is not) and fails.
So if we want to init memory region with the size as big as possible on
64bit systems, we either have to replace all 64bit sizes with 64bit end
addresses (and then use 0-ffffffffffffffff) or support int128 sizes
everywhere (even if it is just hi=1, lo=0) or stop initializing memory
regions with sizes way bigger than we really need in next 5 years.
Am I missing a bigger picture?
--
Alexey
next prev parent reply other threads:[~2013-06-07 1:23 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 21:16 [Qemu-devel] [PATCH 00/21] Memory/IOMMU patches, part 3: IOMMU implementation Paolo Bonzini
2013-05-30 21:16 ` [Qemu-devel] [PATCH 01/21] memory: Introduce address_space_lookup_region Paolo Bonzini
2013-05-31 21:56 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 02/21] memory: move private types to exec.c Paolo Bonzini
2013-05-31 21:57 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 03/21] exec: Allow unaligned address_space_rw Paolo Bonzini
2013-05-31 21:57 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 04/21] exec: Resolve subpages in one step except for IOTLB fills Paolo Bonzini
2013-05-31 21:58 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 05/21] exec: Implement subpage_read/write via address_space_rw Paolo Bonzini
2013-05-31 21:59 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 06/21] exec: return MemoryRegion from address_space_translate Paolo Bonzini
2013-05-31 22:00 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 07/21] Revert "memory: limit sections in the radix tree to the actual address space size" Paolo Bonzini
2013-05-31 22:04 ` Richard Henderson
2013-06-01 6:29 ` Paolo Bonzini
2013-05-30 21:16 ` [Qemu-devel] [PATCH 08/21] Revert "s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62" Paolo Bonzini
2013-05-30 21:16 ` [Qemu-devel] [PATCH 09/21] exec: reorganize mem_add to match Int128 version Paolo Bonzini
2013-05-31 22:42 ` Richard Henderson
2013-05-30 21:16 ` [Qemu-devel] [PATCH 10/21] memory: make section size a 128-bit integer Paolo Bonzini
2013-05-31 6:56 ` Alexey Kardashevskiy
2013-05-31 7:12 ` Paolo Bonzini
2013-05-31 22:18 ` Richard Henderson
2013-06-02 14:03 ` Paolo Bonzini
2013-06-02 14:18 ` Peter Maydell
2013-06-02 14:36 ` Paolo Bonzini
2013-06-02 14:50 ` Peter Maydell
2013-06-02 19:52 ` Paolo Bonzini
2013-06-06 8:36 ` Alexey Kardashevskiy
2013-06-07 1:09 ` Paolo Bonzini
2013-06-07 1:23 ` Alexey Kardashevskiy [this message]
2013-06-07 2:39 ` Paolo Bonzini
2013-05-30 21:16 ` [Qemu-devel] [PATCH 11/21] memory: iommu support Paolo Bonzini
2013-05-31 22:54 ` Richard Henderson
2013-05-30 21:17 ` [Qemu-devel] [PATCH 12/21] memory: Add iommu map/unmap notifiers Paolo Bonzini
2013-05-31 22:56 ` Richard Henderson
2013-05-30 21:17 ` [Qemu-devel] [PATCH 13/21] vfio: abort if an emulated iommu is used Paolo Bonzini
2013-05-31 22:57 ` Richard Henderson
2013-05-30 21:17 ` [Qemu-devel] [PATCH 14/21] spapr: convert TCE API to use an opaque type Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 15/21] spapr: make IOMMU translation go through IOMMUTLBEntry Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 16/21] spapr: use memory core for iommu support Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 17/21] dma: eliminate old-style IOMMU support Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 18/21] pci: use memory core for iommu support Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 19/21] spapr_vio: take care of creating our own AddressSpace/DMAContext Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 20/21] dma: eliminate DMAContext Paolo Bonzini
2013-05-30 21:17 ` [Qemu-devel] [PATCH 21/21] memory: give name to every AddressSpace Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B13625.1070309@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).