1. 17 8月, 2012 11 次提交
    • E
      Adding seccomp calls to vl.c (v8) · 452dfbef
      Eduardo Otubo 提交于
      Signed-off-by: NEduardo Otubo <otubo@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ---
      v1:
       - Full seccomp calls and data included in vl.c
      
      v1 -> v2:
       - Full seccomp calls and data removed from vl.c and put into separate
         qemu-seccomp.[ch] file.
      452dfbef
    • E
      Adding qemu-seccomp.[ch] (v8) · 2f668be7
      Eduardo Otubo 提交于
      Signed-off-by: NEduardo Otubo <otubo@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ---
      v1:
       - I added a syscall struct using priority levels as described in the
         libseccomp man page. The priority numbers are based to the frequency
         they appear in a sample strace from a regular qemu guest run under
         libvirt.
      
         Libseccomp generates linear BPF code to filter system calls, those rules
         are read one after another. The priority system places the most common
         rules first in order to reduce the overhead when processing them.
      
      v1 -> v2:
       - Fixed some style issues
       - Removed code from vl.c and created qemu-seccomp.[ch]
       - Now using ARRAY_SIZE macro
       - Added more syscalls without priority/frequency set yet
      
      v2 -> v3:
       - Adding copyright and license information
       - Replacing seccomp_whitelist_count just by ARRAY_SIZE
       - Adding header protection to qemu-seccomp.h
       - Moving QemuSeccompSyscall definition to qemu-seccomp.c
       - Negative return from seccomp_start is fatal now.
       - Adding open() and execve() to the whitelis
      
      v3 -> v4:
       - Tests revealed a bigger set of syscalls.
       - seccomp_start() now has an argument to set the mode according to the
         configure option trap or kill.
      
      v4 -> v5:
       - Tests on x86_64 required a new specific set of system calls.
       - libseccomp release 1.0.0: part of the API have changed in this last
         release, had to adapt to the new function signatures.
      2f668be7
    • E
      Adding support for libseccomp in configure and Makefile (v8) · f794573e
      Eduardo Otubo 提交于
      Adding basic options to the configure script to use libseccomp or not.
      The default is set to 'no'. If the flag --enable-libseccomp is used, the
      script will check for its existence using pkg-config.
      Signed-off-by: NEduardo Otubo <otubo@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ---
      v1 -> v2:
       - As I removed all the code related to seccomp from vl.c, I created
         qemu-seccomp.[ch].
       - Also making the configure script to add the specific line to
         Makefile.obj in order to compile with appropriate support to seccomp.
      
      v2 -> v3:
       - Removing the line from Makefile.obj and adding it to Makefile.objs.
       - Marking libseccomp default option to 'yes' in the configure script.
      
      v3 -> v8:
       - fix configure probe if libseccomp isn't available (aliguori)
      f794573e
    • B
      dma: Fix stupid typo/thinko · bc9b78de
      Benjamin Herrenschmidt 提交于
      Hi hard a brain fart when coding that function, it will
      fail to "set" the memory beyond the first 512 bytes. This
      is in turn causing guest crashes in ibmveth (spapr_llan.c
      on the qemu side) due to the receive queue not being
      properly initialized.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      bc9b78de
    • J
      memory: add -machine dump-guest-core=on|off · ddb97f1d
      Jason Baron 提交于
      Add a new '[,dump-guest-core=on|off]' option to the '-machine' option. When
      'dump-guest-core=off' is specified, guest memory is omitted from the core dump.
      The default behavior continues to be to include guest memory when a core dump is
      triggered. In my testing, this brought the core dump size down from 384MB to 6MB
      on a 2GB guest.
      
      Is anything additional required to preserve this setting for migration or
      savevm? I don't believe so.
      
      Changelog:
      v3:
          Eliminate globals as per Anthony's suggestion
          set no dump from qemu_ram_remap() as well
      v2:
          move the option from -m to -machine, rename option dump -> dump-guest-core
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ddb97f1d
    • P
      Support using a different compiler for Objective-C files · 3c4a4d0d
      Peter Maydell 提交于
      MacOSX 10.8 ("Mountain Lion") requires us to compile our one
      Objective-C source file with clang even if the rest of QEMU
      requires a real gcc, because the system headers we use make
      use of Apple's "Blocks" extension to C/ObjC, and mainline
      gcc doesn't support that. Since we only need to use a true
      gcc for the parts of QEMU that use the fixed-register
      env variable, we can simply use clang to build the ObjC
      file: it will link to the gcc-built objects with no problems.
      
      Add the necessary support for an OBJCC variable in the
      makefile and configure machinery; we default to clang
      if we have it, otherwise whatever CC is (since gcc
      might be the Apple gcc which does support Blocks).
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      3c4a4d0d
    • P
      configure: Define OS_OBJECT_USE_OBJC=0 for MacOSX builds · a0b7cf6b
      Peter Maydell 提交于
      MacOSX 10.8 ("Mountain Lion") defaults to trying to use automated
      reference counting on certain objects.  This means that the system
      header files will use some Objective C syntax constructs even when
      compiling pure C, which confuses mainline gcc. Suppress this by
      setting OS_OBJECT_USE_OBJC=0. This avoids a compile error like this:
      
      In file included from
      /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:5:0,
                       from /usr/include/os/object.h:74,
                       from /usr/include/dispatch/dispatch.h:48,
                       from /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:56,
                       from block/raw-posix.c:35:
      /System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:409:1: error: stray ‘@’ in program
      [with a large number of further run-on errors]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a0b7cf6b
    • P
      configure: Don't override user's --cpu on MacOS and Solaris · bbea4050
      Peter Maydell 提交于
      Both MacOS and Solaris have special case handling for the CPU
      type, because the check_define probes will return i386 even if
      the hardware is 64 bit and x86_64 would be preferable. Move
      these checks earlier in the configure probing so that we can
      do them only if the user didn't specify a CPU with --cpu. This
      fixes a bug where the user's command line argument was being
      ignored.
      Reviewed-by: NAndreas F=E4rber <afaerber@suse.de>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      bbea4050
    • M
      7109edfe
    • M
      json-parser: don't replicate tokens at each level of recursion · 65c0f1e9
      Michael Roth 提交于
      Currently, when parsing a stream of tokens we make a copy of the token
      list at the beginning of each level of recursion so that we do not
      modify the original list in cases where we need to fall back to an
      earlier state.
      
      In the worst case, we will only read 1 or 2 tokens off the list before
      recursing again, which means an upper bound of roughly N^2 token allocations.
      
      For a "reasonably" sized QMP request (in this a QMP representation of
      cirrus_vga's device state, generated via QIDL, being passed in via
      qom-set), this caused my 16GB's of memory to be exhausted before any
      noticeable progress was made by the parser.
      
      This patch works around the issue by using single copy of the token list
      in the form of an indexable array so that we can save/restore state by
      manipulating indices.
      
      A subsequent commit adds a "large_dict" test case which exhibits the
      same behavior as above. With this patch applied the test case successfully
      completes in under a second.
      
      Tested with valgrind, make check, and QMP.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      65c0f1e9
    • M
      qlist: add qlist_size() · a86a4c2f
      Michael Roth 提交于
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a86a4c2f
  2. 16 8月, 2012 29 次提交