1. 06 12月, 2011 1 次提交
  2. 10 11月, 2011 1 次提交
  3. 27 10月, 2011 3 次提交
  4. 16 9月, 2011 1 次提交
  5. 09 9月, 2011 3 次提交
  6. 21 8月, 2011 1 次提交
  7. 25 7月, 2011 1 次提交
    • B
      Wrap recv to avoid warnings · 00aa0040
      Blue Swirl 提交于
      Avoid warnings like these by wrapping recv():
        CC    slirp/ip_icmp.o
      /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
      /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
      /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'
      
      Remove also casts used to avoid warnings.
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      00aa0040
  8. 13 7月, 2011 1 次提交
  9. 12 7月, 2011 2 次提交
  10. 11 7月, 2011 2 次提交
  11. 22 6月, 2011 7 次提交
    • R
      linux-user: Fix sync_file_range on 32bit mips · bfcedc57
      Riku Voipio 提交于
      As noticed while looking at "Bump do_syscall() up to 8 syscall arguments"
      patch, sync_file_range uses a pad argument on 32bit mips. Deal with it
      by reading the correct arguments when on mips.
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      bfcedc57
    • P
      linux-user: Bump do_syscall() up to 8 syscall arguments · 5945cfcb
      Peter Maydell 提交于
      On 32 bit MIPS a few syscalls have 7 arguments, and so to call
      them via NR_syscall the guest needs to be able to pass 8 arguments
      to do_syscall(). Raise the number of arguments do_syscall() takes
      accordingly.
      
      This fixes some gcc 4.6 compiler warnings about arg7 and arg8
      variables being set and never used.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      5945cfcb
    • J
      linux-user: syscall should use sanitized arg1 · bc088ba1
      Juan Quintela 提交于
      Looking at the other architectures, we should be using "how" not "arg1".
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      [peter.maydell@linaro.org: remove unnecessary initialisation of how]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      bc088ba1
    • J
      syscall: really return ret code · 1add8698
      Juan Quintela 提交于
      We assign ret with the error code, but then return 0 unconditionally.
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      1add8698
    • M
      linux-user: add pselect6 syscall support · 055e0906
      Mike Frysinger 提交于
      Some architectures (like Blackfin) only implement pselect6 (and skip
      select/newselect).  So add support for it.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      055e0906
    • V
      linux-user: Fix the computation of the requested heap size · 4d1de87c
      vincent 提交于
      There were several remaining bugs in the previous implementation of
      do_brk():
      
          1. the value of "new_alloc_size" was one page too large when the
             requested brk was aligned on a host page boundary.
      
          2. no new pages should be (re-)allocated when the requested brk is
             in the range of the pages that were already allocated
             previsouly (for the same purpose).  Technically these pages are
             never unmapped in the current implementation.
      
      The problem/fix can be reproduced/validated with the test-suite above:
      
          #include <unistd.h>       /* syscall(2),      */
          #include <sys/syscall.h>  /* SYS_brk,         */
          #include <stdio.h>        /* puts(3),         */
          #include <stdlib.h>       /* exit(3), EXIT_*, */
          #include <stdint.h>       /* uint*_t,         */
          #include <sys/mman.h>     /* mmap(2), MAP_*,  */
          #include <string.h>       /* memset(3), */
      
          int main()
          {
              int exit_status = EXIT_SUCCESS;
              uint8_t *current_brk = 0;
              uint8_t *initial_brk;
              uint8_t *new_brk;
              uint8_t *old_brk;
              int failure = 0;
              int i;
      
              void test_brk(int increment, int expected_result) {
                  new_brk = (uint8_t *)syscall(SYS_brk, current_brk + increment);
                  if ((new_brk == current_brk) == expected_result)
                      failure = 1;
                  current_brk = (uint8_t *)syscall(SYS_brk, 0);
              }
      
              void test_result() {
                  if (!failure)
                      puts("OK");
                  else {
                      puts("failure");
                      exit_status = EXIT_FAILURE;
                  }
              }
      
              void test_title(const char *title) {
                  failure = 0;
                  printf("%-45s : ", title);
                  fflush(stdout);
              }
      
              test_title("Initialization");
              test_brk(0, 1);
              initial_brk = current_brk;
              test_result();
      
              test_title("Don't overlap \"brk\" pages");
              test_brk(HOST_PAGE_SIZE, 1);
              test_brk(HOST_PAGE_SIZE, 1);
              test_result();
      
              /* Preparation for the test "Re-allocated heap is initialized".  */
              old_brk = current_brk - HOST_PAGE_SIZE;
              memset(old_brk, 0xFF, HOST_PAGE_SIZE);
      
              test_title("Don't allocate the same \"brk\" page twice");
              test_brk(-HOST_PAGE_SIZE, 1);
              test_brk(HOST_PAGE_SIZE, 1);
              test_result();
      
              test_title("Re-allocated \"brk\" pages are initialized");
              for (i = 0; i < HOST_PAGE_SIZE; i++) {
                  if (old_brk[i] != 0) {
                      printf("(index = %d, value = 0x%x) ", i, old_brk[i]);
                      failure = 1;
                      break;
                  }
              }
              test_result();
      
              test_title("Don't allocate \"brk\" pages over \"mmap\" pages");
              new_brk = mmap(current_brk, HOST_PAGE_SIZE / 2, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
              if (new_brk == (void *) -1)
                  puts("unknown");
              else {
                  test_brk(HOST_PAGE_SIZE, 0);
                  test_result();
              }
      
              test_title("All \"brk\" pages are writable (please wait)");
              if (munmap(current_brk, HOST_PAGE_SIZE / 2) != 0)
                  puts("unknown");
              else {
                  while (current_brk - initial_brk < 2*1024*1024*1024UL) {
                      old_brk = current_brk;
      
                      test_brk(HOST_PAGE_SIZE, -1);
                      if (old_brk == current_brk)
                          break;
      
                      for (i = 0; i < HOST_PAGE_SIZE; i++)
                          old_brk[i] = 0xAA;
                  }
                  puts("OK");
              }
      
              test_title("Maximum size of the heap > 16MB");
              failure = (current_brk - initial_brk) < 16*1024*1024;
              test_result();
      
              exit(exit_status);
          }
      
      Changes introduced in patch v2:
      
          * extend the "brk" test-suite embedded within the commit message;
      
          * heap contents have to be initialized to zero, this bug was
            exposed by "tst-calloc.c" from the GNU C library;
      
          * don't [try to] allocate a new host page if the new "brk" is
            equal to the latest allocated host page ("brk_page"); and
      
          * print some debug information when DEBUGF_BRK is defined.
      Signed-off-by: NCédric VINCENT <cedric.vincent@st.com>
      Reviewed-by: NChristophe Guillon <christophe.guillon@st.com>
      Cc: Riku Voipio <riku.voipio@iki.fi>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      4d1de87c
    • P
      linux-user: Don't use MAP_FIXED in do_brk() · 00faf08c
      Peter Maydell 提交于
      Since mmap() with MAP_FIXED will map over the top of existing mappings,
      it's a bad idea to use it to implement brk(), because brk() with a
      large size is likely to overwrite important things like qemu itself
      or the host libc. So we drop MAP_FIXED and handle "mapped but at
      different address" as an error case instead.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      00faf08c
  12. 20 5月, 2011 1 次提交
  13. 08 5月, 2011 1 次提交
  14. 02 5月, 2011 2 次提交
  15. 26 4月, 2011 5 次提交
    • R
      linux-user: untie syscalls from UID16 · 0c866a7e
      Riku Voipio 提交于
      Quite a number of uid/gid related syscalls are only defined on systems
      with USE_UID16 defined. This is apperently based on the idea that these
      system calls would never be called on non-UID16 systems. Make these
      syscalls available for all architectures that define them.
      
      drop alpha hack to support selected UID16 syscalls. MIPS and PowerPC
      were also defined as UID16, to get uid/gid syscalls available, drop
      this error as well.
      
      Change QEMU to reflect this.
      
      Cc: Ulrich Hecht <uli@suse.de>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Alexander Graf <agraf@suse.de>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      0c866a7e
    • A
      linux-user: add s390x to llseek list · 42a39fbe
      Alexander Graf 提交于
      We keep a list of host architectures that do llseek with the same
      syscall as lseek. S390x is one of them, so let's add it to the list.
      Original-patch-by: NUlrich Hecht <uli@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      42a39fbe
    • L
      linux-user: add ioctl(SIOCGIWNAME, ...) support. · 86fcd946
      Laurent Vivier 提交于
      Allow to run properly following program from linux-user:
      
      /* cc -o wifi wifi.c */
      
       #include <stdio.h>
       #include <sys/ioctl.h>
       #include <sys/types.h>
       #include <sys/socket.h>
       #include <linux/wireless.h>
       #include <netinet/in.h>
       #include <arpa/inet.h>
       #include <string.h>
      
      int main(int argc, char **argv)
      {
          int ret;
          struct ifreq req;
          struct sockaddr_in *addr;
          int s;
      
          if (argc != 2) {
              fprintf(stderr, "Need an interface name (like wlan0)\n");
      	return 1;
          }
      
          s = socket( AF_INET, SOCK_DGRAM, 0 );
          if (s < 0) {
              perror("Cannot open socket");
              return 1;
          }
          strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name));
          ret = ioctl( s, SIOCGIWNAME, &req );
          if (ret < 0) {
      	fprintf(stderr, "No wireless extension\n");
              return 1;
          }
      
          printf("%s\n", req.ifr_name);
          printf("%s\n", req.ifr_newname);
          return 0;
      }
      
      $ ./wifi eth0
      No wireless extension
      
      $ ./wifi wlan0
      wlan0
      IEEE 802.11bg
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      86fcd946
    • L
      linux-user: convert ioctl(SIOCGIFCONF, ...) result. · 059c2f2c
      Laurent Vivier 提交于
      The result needs to be converted as it is stored in an array of struct
      ifreq and sizeof(struct ifreq) differs according to target and host
      alignment rules.
      
      This patch allows to execute correctly the following program on arm
      and m68k:
      
       #include <stdio.h>
       #include <sys/ioctl.h>
       #include <net/if.h>
       #include <alloca.h>
       #include <string.h>
       #include <sys/socket.h>
       #include <netinet/in.h>
       #include <arpa/inet.h>
      
      int main(void)
      {
          int s, ret;
          struct ifconf ifc;
          int i;
      
          memset( &ifc, 0, sizeof( struct ifconf ) );
          ifc.ifc_len = 8 * sizeof(struct ifreq);
          ifc.ifc_buf = alloca(ifc.ifc_len);
      
          s = socket( AF_INET, SOCK_DGRAM, 0 );
          if (s < 0) {
              perror("Cannot open socket");
              return 1;
          }
          ret = ioctl( s, SIOCGIFCONF, &ifc );
          if (s < 0) {
              perror("ioctl() failed");
              return 1;
          }
      
          for (i = 0; i < ifc.ifc_len / sizeof(struct ifreq) ; i ++) {
              struct sockaddr_in *s;
              s = (struct sockaddr_in*)&ifc.ifc_req[i].ifr_addr;
              printf("%s\n", ifc.ifc_req[i].ifr_name);
              printf("%s\n", inet_ntoa(s->sin_addr));
          }
      }
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      059c2f2c
    • R
      [v2] linux-user: bigger default stack · 05098a93
      Riku Voipio 提交于
      PTHREAD_STACK_MIN (16KB) is somewhat inadequate for a new stack for new
      QEMU threads. Set new limit to 256K which should be enough, yet doesn't
      increase memory pressure significantly.
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      Reviewed-by: NNathan Froyd <froydnj@codesourcery.com>
      05098a93
  16. 22 3月, 2011 1 次提交
  17. 07 3月, 2011 1 次提交
  18. 17 2月, 2011 1 次提交
  19. 09 2月, 2011 3 次提交
  20. 12 1月, 2011 1 次提交
  21. 07 1月, 2011 1 次提交