1. 10 1月, 2014 1 次提交
  2. 11 9月, 2013 1 次提交
  3. 03 9月, 2013 1 次提交
  4. 10 7月, 2013 2 次提交
  5. 02 5月, 2013 1 次提交
    • E
      target-i386: Replace cpuid_*features fields with a feature word array · 0514ef2f
      Eduardo Habkost 提交于
      This replaces the feature-bit fields on both X86CPU and x86_def_t
      structs with an array.
      
      With this, we will be able to simplify code that simply does the same
      operation on all feature words (e.g. kvm_check_features_against_host(),
      filter_features_for_kvm(), add_flagname_to_bitmaps(), CPU feature-bit
      property lookup/registration, and the proposed "feature-words" property)
      
      The following field replacements were made on X86CPU and x86_def_t:
      
        (cpuid_)features         -> features[FEAT_1_EDX]
        (cpuid_)ext_features     -> features[FEAT_1_ECX]
        (cpuid_)ext2_features    -> features[FEAT_8000_0001_EDX]
        (cpuid_)ext3_features    -> features[FEAT_8000_0001_ECX]
        (cpuid_)ext4_features    -> features[FEAT_C000_0001_EDX]
        (cpuid_)kvm_features     -> features[FEAT_KVM]
        (cpuid_)svm_features     -> features[FEAT_SVM]
        (cpuid_)7_0_ebx_features -> features[FEAT_7_0_EBX]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      0514ef2f
  6. 18 4月, 2013 6 次提交
  7. 19 12月, 2012 1 次提交
  8. 05 10月, 2012 1 次提交
  9. 15 8月, 2012 2 次提交
  10. 28 7月, 2012 1 次提交
  11. 07 4月, 2012 2 次提交
    • P
      Userspace ARM BE8 support · d8fd2954
      Paul Brook 提交于
      Add support for ARM BE8 userspace binaries.
      i.e. big-endian data and little-endian code.
      In principle LE8 mode is also possible, but AFAIK has never actually
      been implemented/used.
      
      System emulation doesn't have any useable big-endian board models,
      but should in principle work once you fix that.
      Dynamic endianness switching requires messing with data accesses,
      preferably with TCG cooperation, and is orthogonal to BE8 support.
      Signed-off-by: NPaul Brook <paul@codesourcery.com>
      [PMM: various changes, mostly as per my suggestions in code review:
       * rebase
       * use EF_ defines rather than hardcoded constants
       * make bswap_code a bool for future VMSTATE macro compatibility
       * update comment in cpu.h about TB flags bit field usage
       * factor out load-code-and-swap into arm_ld*_code functions and
         get_user_code* macros
       * fix stray trailing space at end of line
       * added braces in disas.c to satisfy checkpatch
      ]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      d8fd2954
    • B
      arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features. · adf050b1
      Benoit Canet 提交于
      The cpu capabilities passed by the elf loader in AT_HWCAP where
      a constant.
      Make AT_HWCAP reflect the emulated cpu features in order to give
      correct clues to eglibc.
      
      Riku Voipio: fixed to apply to current head
      
      Fix :  [Bug 887516] [NEW] VFP support reported for the PXA270
      Signed-off-by: NBenoit Canet <benoit.canet@gmail.com>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      adf050b1
  12. 15 3月, 2012 2 次提交
  13. 02 2月, 2012 1 次提交
    • A
      linux-user: save auxv length · 125b0f55
      Alexander Graf 提交于
      We create our own AUXV segment on stack and save a pointer to it.
      However we don't save the length of it, so any code that wants to
      do anything useful with it later on has to walk it again.
      
      Instead, let's remember the length of our AUXV segment. This
      simplifies later uses by a lot.
      
      (edited by Riku to apply to qemu HEAD)
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      125b0f55
  14. 11 1月, 2012 1 次提交
  15. 02 12月, 2011 1 次提交
  16. 12 11月, 2011 1 次提交
  17. 27 10月, 2011 1 次提交
  18. 09 9月, 2011 1 次提交
  19. 21 8月, 2011 1 次提交
  20. 15 7月, 2011 1 次提交
  21. 22 6月, 2011 3 次提交
    • L
      linux-user: Define AT_RANDOM to support target stack protection mechanism. · 14322bad
      Laurent ALFONSI 提交于
      The dynamic linker from the GNU C library v2.10+ uses the ELF
      auxiliary vector AT_RANDOM [1] as a pointer to 16 bytes with random
      values to initialize the stack protection mechanism.  Technically the
      emulated GNU dynamic linker crashes due to a NULL pointer
      derefencement if it is built with stack protection enabled and if
      AT_RANDOM is not defined by the QEMU ELF loader.
      
      [1] This ELF auxiliary vector was introduced in Linux v2.6.29.
      
      This patch can be tested with the code above:
      
          #include <elf.h>       /* Elf*_auxv_t, AT_RANDOM, */
          #include <stdio.h>     /* printf(3), */
          #include <stdlib.h>    /* exit(3), EXIT_*, */
          #include <stdint.h>    /* uint8_t, */
          #include <string.h>    /* memcpy(3), */
      
          #if defined(__LP64__) || defined(__ILP64__) || defined(__LLP64__)
          #    define Elf_auxv_t Elf64_auxv_t
          #else
          #    define Elf_auxv_t Elf32_auxv_t
          #endif
      
          main(int argc, char* argv[], char* envp[])
          {
              Elf_auxv_t *auxv;
      
              /* *envp = NULL marks end of envp. */
              while (*envp++ != NULL);
      
              /* auxv->a_type = AT_NULL marks the end of auxv. */
              for (auxv = (Elf_auxv_t *)envp; auxv->a_type != AT_NULL; auxv++) {
                  if (auxv->a_type == AT_RANDOM) {
                      int i;
                      uint8_t rand_bytes[16];
      
                      printf("AT_RANDOM is: 0x%x\n", auxv->a_un.a_val);
                      memcpy(rand_bytes, (const uint8_t *)auxv->a_un.a_val, sizeof(rand_bytes));
                      printf("it points to: ");
                      for (i = 0; i < 16; i++) {
                          printf("0x%02x ", rand_bytes[i]);
                      }
                      printf("\n");
                      exit(EXIT_SUCCESS);
                  }
              }
              exit(EXIT_FAILURE);
          }
      
      Changes introduced in v2 and v3:
      
          * Fix typos + thinko (AT_RANDOM is used for stack canary, not for
            ASLR)
      
          * AT_RANDOM points to 16 random bytes stored inside the user
            stack.
      
          * Add a small test program.
      Signed-off-by: NCédric VINCENT <cedric.vincent@st.com>
      Signed-off-by: NLaurent ALFONSI <laurent.alfonsi@st.com>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      14322bad
    • P
      linux-user: Handle images where lowest vaddr is not page aligned · f3ed1f5d
      Peter Maydell 提交于
      Fix a bug in the linux-user ELF loader code where it was not correctly
      handling images where the lowest vaddr to be loaded was not page aligned.
      The problem was that the code to probe for a suitable guest base address
      was changing the 'loaddr' variable (by rounding it to a page boundary),
      which meant that the load bias would then be incorrectly calculated
      unless loaddr happened to already be page-aligned.
      
      Binaries generated by gcc with the default linker script do start with
      a loadable segment at a page-aligned vaddr, so were unaffected. This
      bug was noticed with a binary created by the Google Go toolchain for ARM.
      
      We fix the bug by refactoring the "probe for guest base" code out into
      its own self-contained function.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      f3ed1f5d
    • C
      linux-user: Fix the load of ELF files that have no "useful" symbol · b9475279
      Cédric VINCENT 提交于
      This patch fixes a "double free()" due to "realloc(syms, 0)" in the
      loader when the ELF file has no "useful" symbol, as with the following
      example (compiled with "sh4-linux-gcc -nostdlib"):
      
          .text
          .align 1
          .global _start
          _start:
              mov     #1, r3
              trapa   #40     // syscall(__NR_exit)
              nop
      
      The bug appears when the log (option "-d") is enabled.
      Signed-off-by: NCédric VINCENT <cedric.vincent@st.com>
      Signed-off-by: NYves JANIN <yves.janin@st.com>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      b9475279
  22. 20 5月, 2011 1 次提交
  23. 13 4月, 2011 1 次提交
  24. 17 2月, 2011 1 次提交
    • L
      linux-user: correct core dump format · 80f5ce75
      Laurent Vivier 提交于
      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: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      80f5ce75
  25. 09 2月, 2011 2 次提交
  26. 30 7月, 2010 1 次提交
  27. 29 7月, 2010 2 次提交