1. 20 Feb, 2011 35 commits
  2. 17 Feb, 2011 5 commits
    • Marcelo Tosatti's avatar
      Fix vmport segfault (v2) · e14da0af
      Marcelo Tosatti authored
      
      
      Fix regression caused by qdev conversion.
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      e14da0af
    • Laurent Vivier's avatar
      linux-user: correct core dump format · 80f5ce75
      Laurent Vivier authored
      
      
      This patch allows to really use the core dumped by qemu with guest
      architecture tools.
      
      - it adds a missing bswap_phdr() for the program headers
        of memory regions.
      
        "objdump -x" sample:
      
      BEFORE:
      
      0x1000000 off    0x00200000 vaddr 0x00000400 paddr 0x00000000 align 2**21
               filesz 0x00000000 memsz 0x00100000 flags ---
      0x1000000 off    0x00200000 vaddr 0x00100400 paddr 0x00000000 align 2**21
               filesz 0x00000000 memsz 0x00080000 flags --- 6000000
      
      AFTER:
      
          LOAD off    0x00002000 vaddr 0x00040000 paddr 0x00000000 align 2**13
               filesz 0x00000000 memsz 0x00001000 flags ---
          LOAD off    0x00002000 vaddr 0x00041000 paddr 0x00000000 align 2**13
               filesz 0x00000000 memsz 0x00000800 flags rw-
      
      - it doesn't pad the note size to sizeof(int32_t).
        On m68k the NT_PRSTATUS note size is 154 and
        must not be rounded up to 156, because this value is checked by
        objdump and gdb.
      
        "gdb" symptoms:
      
            "warning: Couldn't find general-purpose registers in core file."
      
        "objdump -x" sample:
      
      BEFORE:
      
      Sections:
      Idx Name          Size      VMA       LMA       File off  Algn
        0 note0         000001c4  00000000  00000000  000003b4  2**0
                        CONTENTS, READONLY
        1 .auxv         00000070  00000000  00000000  00000508  2**2
                        CONTENTS
        2 proc1         00100000  00000400  00000000  00200000  2**10
                        READONLY
      
      AFTER:
      
      Sections:
      Idx Name          Size      VMA       LMA       File off  Algn
        0 note0         000001c4  00000000  00000000  000003b4  2**0
                        CONTENTS, READONLY
        1 .reg/19022    00000050  00000000  00000000  0000040e  2**2
                        CONTENTS
        2 .reg          00000050  00000000  00000000  0000040e  2**2
                        CONTENTS
        3 .auxv         00000070  00000000  00000000  00000508  2**2
                        CONTENTS
        4 load1         00000000  00040000  00000000  00002000  2**13
                        ALLOC, READONLY
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: default avatarRiku Voipio <riku.voipio@nokia.com>
      80f5ce75
    • Laurent Vivier's avatar
      linux-user: Define target alignment size · c2e3dee6
      Laurent Vivier authored
      
      
      Datatype alignment can be found using following application:
      
      int main(void)
      {
      	printf("alignof(short) %ld\n", __alignof__(short));
      	printf("alignof(int) %ld\n", __alignof__(int));
      	printf("alignof(long) %ld\n", __alignof__(long));
      	printf("alignof(long long) %ld\n", __alignof__(long long));
      }
      
      This patch includes following alignments:
      
      i386
      
         alignof(short) 2
         alignof(int) 4
         alignof(long) 4
         alignof(long long) 8
      
       x86_64
      
         alignof(short) 2
         alignof(int) 4
         alignof(long) 8
         alignof(long long) 8
      
       arm
      
         alignof(short) 2
         alignof(int) 4
         alignof(long) 4
         alignof(long long) 4
      
       m68k (680x0)
      
         alignof(short) 2
         alignof(int) 2
         alignof(long) 2
         alignof(long long) 2
      
       mips
      
         alignof(short) 2
         alignof(int) 4
         alignof(long) 4
         alignof(long long) 8
      
       ppc
      
         alignof(short) 2
         alignof(int) 4
         alignof(long) 4
         alignof(long long) 8
      
      for other targets, use by default (2,4,4,8).
      
      Please, update for your favorite target...
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: default avatarRiku Voipio <riku.voipio@nokia.com>
      c2e3dee6
    • Peter Maydell's avatar
      linux-user: Support the epoll syscalls · 3b6edd16
      Peter Maydell authored
      
      
      Support the epoll family of syscalls: epoll_create(), epoll_create1(),
      epoll_ctl(), epoll_wait() and epoll_pwait(). Note that epoll_create1()
      and epoll_pwait() are later additions, so we have to test separately
      in configure for their presence.
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarRiku Voipio <riku.voipio@nokia.com>
      3b6edd16
    • Laurent Vivier's avatar
      linux-user: in linux-user/strace.c, tswap() is useless · d2ee72a5
      Laurent Vivier authored
      
      
      Syscall parameters are already swapped by the caller.
      
      This patch removes useless tswap() from strace.c
      
      $ QEMU_STRACE=1 chroot /m68k mknod myramdisk b 1 1
      with tswap()
      ...
      29944 mknod("myramdisk",026630200000) = 0
      ...
      
      without tswap()
      
      ...
      30042 mknod("myramdisk",S_IFBLK|0666,makedev(1,1)) = 0
      ...
      
      natively:
      
      $ strace touch mytouch
      ...
      open("mytouch", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
      ...
      
      $ QEMU_STRACE=1 chroot /m68k touch mytouch
      with tswap()
      ...
      30368 open("/usr/share/locale/locale.alias",O_RDONLY) = 3
      30368 fstat64(50331648,0x4080032c) = 0
      ...
      30368 open("mytouch",O_RDONLY|O_CREAT|O_LARGEFILE|O_NOCTTY|O_NONBLOCK|0x1) = 0
      ...
      without tswap()
      ...
      30572 open("/usr/share/locale/locale.alias",O_RDONLY) = 3
      30572 fstat64(3,0x4080032c) = 0
      ...
      30572 open("mytouch",O_WRONLY|O_CREAT|O_LARGEFILE|O_NOCTTY|O_NONBLOCK,0666) = 0
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      
      Fixes by Riku Voipio: add casts
      Signed-off-by: default avatarRiku Voipio <riku.voipio@nokia.com>
      d2ee72a5