qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qemu git (f03d07d46) / e100 / sending large packets cau


From: Paolo Bonzini
Subject: Re: [Qemu-devel] qemu git (f03d07d46) / e100 / sending large packets causes SIGABRT
Date: Mon, 29 Jul 2013 12:53:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 29/07/2013 10:50, Stefan Hajnoczi ha scritto:
> There are only a few bytes remaining: len=0x3.  The abort(3) comes from 
> address_space_rw():
> 
> if (!memory_access_is_direct(mr, is_write)) {
>     /* I/O case */
>     l = memory_access_size(mr, l, addr1);
>     switch (l) {
>     case 8:
>         ...
>     case 4:
>         ...
>     case 2:
>         ...
>     case 1:
>         ...
>     default:
>         abort();  <-- we abort here
> }
> 
> Paolo: Do you know how the memory API is supposed to work here?

The problem is introduced by commit 2332616 (exec: Support 64-bit
operations in address_space_rw, 2013-07-08).  Before that commit,
memory_access_size would only return 1/2/4.  The following should help:

diff --git a/exec.c b/exec.c
index 7997002..7686c15 100644
--- a/exec.c
+++ b/exec.c
@@ -1922,6 +1922,9 @@ static int memory_access_size(MemoryRegion *mr,
unsigned l, hwaddr addr)
     if (l > access_size_max) {
         l = access_size_max;
     }
+    if (l & (l - 1)) {
+        l = 1 << (qemu_fls(l) - 1);
+    }

     return l;
 }


Paolo



reply via email to

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