]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agoMerge remote-tracking branch 'rth/tcg-ppc-pull' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:14:01 +0000 (17:14 -0500)]
Merge remote-tracking branch 'rth/tcg-ppc-pull' into staging

# By Richard Henderson (19) and Paolo Bonzini (2)
# Via Richard Henderson
* rth/tcg-ppc-pull: (21 commits)
  tcg-ppc64: Implement CONFIG_QEMU_LDST_OPTIMIZATION
  tcg-ppc64: Add _noaddr functions for emitting forward branches
  tcg-ppc64: Streamline tcg_out_tlb_read
  tcg-ppc64: Implement tcg_register_jit
  tcg-ppc64: Handle long offsets better
  tcg-ppc64: Tidy register allocation order
  tcg-ppc64: Look through a constant function descriptor
  tcg-ppc64: Fold constant call address into descriptor load
  tcg-ppc64: Don't load the static chain from TCG
  tcg-ppc64: Avoid code for nop move
  tcg-ppc64: Use tcg_out64
  tcg-ppc64: Use TCG_REG_Rn constants
  tcg-ppc64: More use of TAI and SAI helper macros
  tcg-ppc64: Reformat tcg-target.c
  tcg-ppc: Fix and cleanup tcg_out_tlb_check
  tcg-ppc: Use conditional branch and link to slow path
  tcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path
  tcg-ppc: Avoid code for nop move
  tcg-ppc: use new return-argument ld/st helpers
  tcg-ppc: fix qemu_ld/qemu_st for AIX ABI
  ...

Message-id: 1380126458-3247-1-git-send-email-rth@twiddle.net

10 years agoMerge remote-tracking branch 'quintela/migration.next' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:13:43 +0000 (17:13 -0500)]
Merge remote-tracking branch 'quintela/migration.next' into staging

# By Isaku Yamahata (4) and others
# Via Juan Quintela
* quintela/migration.next:
  migration: ram_handle_compressed
  arch_init: make is_zero_page accept size
  migration: Fix debug print type
  migration: add version supporting macros for struct pointer
  rdma: constify ram_chunk_{index, start, end}
  rdma: clean up of qemu_rdma_cleanup()
  arch_init: right return for ram_save_iterate
  savevm: fix wrong initialization by ram_control_load_hook
  savevm: add comments for qemu_file_get_error()

Message-id: 1380024203-25897-1-git-send-email-quintela@redhat.com

10 years agoMerge remote-tracking branch 'kraxel/audio.1' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:13:32 +0000 (17:13 -0500)]
Merge remote-tracking branch 'kraxel/audio.1' into staging

# By Bandan Das (3) and Gerd Hoffmann (1)
# Via Gerd Hoffmann
* kraxel/audio.1:
  audio: remove CONFIG_MIXEMU configure option
  hda-codec: make mixemu selectable at runtime
  hda-codec: refactor common definitions into a header file
  audio maintainers update

Message-id: 1380011943-15083-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'borntraeger/tags/s390-next-20130924' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:13:18 +0000 (17:13 -0500)]
Merge remote-tracking branch 'borntraeger/tags/s390-next-20130924' into staging

This is a bunch of fixes/changes for the s390 architecture. It also
contains the fixes from the previous pull request, which did not make
it yet.
Overall it contains
- a fix for kexec without kdump (which uses diag308 subcode 0 instead of 1)
- several sclp related fixes
- some initial sclp migration code
- the sclp line mode console
- A fix for a boot problem with the virtio ccw ipl bios
- zeroed out padding bytes for the notes section of dump-guest-memory
- some cleanups

# gpg: Signature made Tue 24 Sep 2013 02:18:44 AM CDT using RSA key ID B5A61C7C
# gpg: Can't check signature: public key not found

# By Christian Borntraeger (6) and others
# Via Christian Borntraeger
* borntraeger/tags/s390-next-20130924:
  s390/sclplmconsole: Add support for SCLP line-mode console
  s390/ebcdic: Move conversion tables to header file
  s390/eventfacility: allow childs to handle more than 1 event type
  s390/eventfacility: remove unused event_type variable
  s390/eventfacility: Fix receive/send masks
  s390/eventfacility: fix multiple Read Event Data sources
  s390/sclp: add reset() functions
  s390/sclpquiesce: Add code to support live migration
  s390/sclpconsole: Add code to support live migration for sclpconsole
  s390/sclpconsole: modify definition of input buffer
  s390/kexec: Implement diag308 subcode 0
  s390/ioinst: Moved the CC setting to the IO instruction handlers
  s390/cpu: Make setcc() function available to other files
  s390/ipl: Update the s390-ccw.img rom
  s390/ipl: Fix waiting for virtio processing
  s390/dump: zero out padding bytes in notes sections
  s390/kvm: Add check for priviledged SCLP handler

Message-id: 1380007671-18976-1-git-send-email-borntraeger@de.ibm.com

10 years agotcg-ppc64: Implement CONFIG_QEMU_LDST_OPTIMIZATION
Richard Henderson [Wed, 31 Jul 2013 23:15:18 +0000 (16:15 -0700)]
tcg-ppc64: Implement CONFIG_QEMU_LDST_OPTIMIZATION

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Add _noaddr functions for emitting forward branches
Richard Henderson [Sat, 31 Aug 2013 00:58:10 +0000 (17:58 -0700)]
tcg-ppc64: Add _noaddr functions for emitting forward branches

... rather than open-coding this stuff through the file.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Streamline tcg_out_tlb_read
Richard Henderson [Wed, 31 Jul 2013 22:11:44 +0000 (15:11 -0700)]
tcg-ppc64: Streamline tcg_out_tlb_read

Less conditional compilation.  Merge an add insn with the indexed
memory load insn.  Load the tlb addend earlier.  Avoid the address
update memory form.

Fix a bug in not allowing large enough tlb offsets for some guests.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Implement tcg_register_jit
Richard Henderson [Sat, 31 Aug 2013 11:44:21 +0000 (04:44 -0700)]
tcg-ppc64: Implement tcg_register_jit

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Handle long offsets better
Richard Henderson [Wed, 31 Jul 2013 18:36:42 +0000 (11:36 -0700)]
tcg-ppc64: Handle long offsets better

Previously we'd only handle 16-bit offsets from memory operand without falling
back to indexed, but it's easy to use ADDIS to handle full 32-bit offsets.

This also lets us unify code that existed inline in tcg_out_op for handling
addition of large constants.

The new R2 temporary was marked reserved for the AIX calling convention, but
the register really is call-clobbered and since tcg generated code has no use
for a TOC, it's available for use.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Tidy register allocation order
Richard Henderson [Wed, 31 Jul 2013 17:18:49 +0000 (10:18 -0700)]
tcg-ppc64: Tidy register allocation order

Remove conditionalization from tcg_target_reg_alloc_order, relying on
reserved_regs to prevent register allocation that shouldn't happen.
So R11 is now present in reg_alloc_order for __APPLE__, but also now
reserved.

Sort reg_alloc_order into call-saved, call-clobbered, and parameters.
This reduces the effect of values getting spilled and reloaded before
function calls.

Whether or not it is reserved, R2 (TOC) is always call-clobbered.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Look through a constant function descriptor
Richard Henderson [Sat, 31 Aug 2013 13:30:45 +0000 (06:30 -0700)]
tcg-ppc64: Look through a constant function descriptor

Especially in the user-only configurations, a direct branch into
the executable may be in range.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Fold constant call address into descriptor load
Richard Henderson [Sat, 31 Aug 2013 13:13:49 +0000 (06:13 -0700)]
tcg-ppc64: Fold constant call address into descriptor load

Eliminates one insn per call:

 :  lis     r2,4165
-:  ori     r2,r2,59616
-:  ld      r0,0(r2)
+:  ld      r0,-5920(r2)
 :  mtctr   r0
-:  ld      r2,8(r2)
+:  ld      r2,-5912(r2)
 :  bctrl

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Don't load the static chain from TCG
Richard Henderson [Wed, 31 Jul 2013 06:14:19 +0000 (23:14 -0700)]
tcg-ppc64: Don't load the static chain from TCG

There are no helpers that require the static chain.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Avoid code for nop move
Richard Henderson [Wed, 31 Jul 2013 04:26:04 +0000 (18:26 -1000)]
tcg-ppc64: Avoid code for nop move

While these are rare from code that's been through the optimizer,
it's not uncommon within the tcg backend.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Use tcg_out64
Richard Henderson [Sat, 31 Aug 2013 12:46:25 +0000 (05:46 -0700)]
tcg-ppc64: Use tcg_out64

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Use TCG_REG_Rn constants
Richard Henderson [Sat, 31 Aug 2013 12:41:45 +0000 (05:41 -0700)]
tcg-ppc64: Use TCG_REG_Rn constants

Instead of bare N, for clarity.  The only (intentional) exception made
is for insns that encode R|0, i.e. when R0 encoded into the insn is
interpreted as zero not the contents of the register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: More use of TAI and SAI helper macros
Richard Henderson [Sat, 31 Aug 2013 12:23:23 +0000 (05:23 -0700)]
tcg-ppc64: More use of TAI and SAI helper macros

Finish conversion of all memory operations.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Reformat tcg-target.c
Richard Henderson [Sat, 31 Aug 2013 12:14:53 +0000 (05:14 -0700)]
tcg-ppc64: Reformat tcg-target.c

Whitespace and brace changes only.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: Fix and cleanup tcg_out_tlb_check
Richard Henderson [Thu, 29 Aug 2013 16:32:20 +0000 (09:32 -0700)]
tcg-ppc: Fix and cleanup tcg_out_tlb_check

The fix is that sparc has so many mmu modes that the last one overflowed
the 16-bit signed offset we assumed would fit.  Handle this, and check
the new assumption at compile time.

Load the tlb addend earlier for the fast path.

Remove the explicit address + addend and make use of index addressing.

Adjust constraints for qemu_ld64 such that we don't clobber the address
register or tlb addend before loading both values.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: Use conditional branch and link to slow path
Richard Henderson [Mon, 9 Sep 2013 23:49:36 +0000 (16:49 -0700)]
tcg-ppc: Use conditional branch and link to slow path

Saves one insn per slow path.  Note that we can no longer use
a tail call into the store helper.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path
Richard Henderson [Thu, 29 Aug 2013 17:07:24 +0000 (10:07 -0700)]
tcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path

Coding style fixes.  Use TCGReg enumeration values instead of raw
numbers.  Don't needlessly pull the whole TCGLabelQemuLdst struct
into local variables.  Less conditional compilation.

No functional changes.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: Avoid code for nop move
Richard Henderson [Wed, 28 Aug 2013 22:51:08 +0000 (15:51 -0700)]
tcg-ppc: Avoid code for nop move

While these are rare from code that's been through the optimizer,
it's not uncommon within the tcg backend.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: use new return-argument ld/st helpers
Paolo Bonzini [Thu, 5 Sep 2013 08:22:09 +0000 (10:22 +0200)]
tcg-ppc: use new return-argument ld/st helpers

These use a 32-bit load-of-immediate to save a mflr+addi+mtlr sequence.
Tested with a Windows 98 guest (pretty much the most recent thing I
could run on my PPC machine) and kvm-unit-tests's sieve.flat.  The
speed up for sieve.flat is as high as 10% for qemu-system-i386, 25%
(no kidding) for qemu-system-x86_64 on my PowerBook G4.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: fix qemu_ld/qemu_st for AIX ABI
Paolo Bonzini [Thu, 5 Sep 2013 08:22:08 +0000 (10:22 +0200)]
tcg-ppc: fix qemu_ld/qemu_st for AIX ABI

For the AIX ABI, the function pointer and small area pointer need
to be loaded in the trampoline.  The trampoline instead is called
with a normal BL instruction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoconfigure: Allow command-line configure for ppc32
Richard Henderson [Wed, 28 Aug 2013 22:48:21 +0000 (15:48 -0700)]
configure: Allow command-line configure for ppc32

Similar to manually selecting i386 for an x86_64 host.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agomigration: ram_handle_compressed
Isaku Yamahata [Fri, 20 Sep 2013 16:23:37 +0000 (01:23 +0900)]
migration: ram_handle_compressed

ram_handle_compressed() should be aware of size > TARGET_PAGE_SIZE.
migration-rdma can call it with larger size.

Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoarch_init: make is_zero_page accept size
Isaku Yamahata [Fri, 20 Sep 2013 16:23:36 +0000 (01:23 +0900)]
arch_init: make is_zero_page accept size

Later is_zero_page will be used for non TARGET_PAGE_SIZE
range.
And rename it to is_zero_range as it isn't page size any more.

Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agomigration: Fix debug print type
Christoffer Dall [Fri, 23 Aug 2013 17:34:16 +0000 (10:34 -0700)]
migration: Fix debug print type

The printf args are uint64_t and with -Werr QEMU doesn't compile with
migration debugging turned on unless this is fixed.  Fix it.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agomigration: add version supporting macros for struct pointer
Alexey Kardashevskiy [Wed, 4 Sep 2013 04:35:26 +0000 (14:35 +1000)]
migration: add version supporting macros for struct pointer

This adds version supporting macros VMSTATE_STRUCT_POINTER_TEST_V
and VMSTATE_STRUCT_POINTER_V in addition to the already existing
VMSTATE_STRUCT_POINTER and VMSTATE_STRUCT_POINTER_TEST macros.

Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agordma: constify ram_chunk_{index, start, end}
Isaku Yamahata [Wed, 4 Sep 2013 02:32:19 +0000 (11:32 +0900)]
rdma: constify ram_chunk_{index, start, end}

Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agordma: clean up of qemu_rdma_cleanup()
Isaku Yamahata [Tue, 13 Aug 2013 02:12:43 +0000 (11:12 +0900)]
rdma: clean up of qemu_rdma_cleanup()

- It can't be determined by RDMAContext::cm_id != NULL if the connection
  is established or not.
- RDMAContext::cm_id is leaked and not destroyed because it is set to NULL
  too early.
- RDMAContext::qp is created by rdma_create_qp() so that it should be destroyed
  by rdma_destroy_qp(). not ibv_destroy_qp()

Cc: Michael R. Hines <mrhines@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoarch_init: right return for ram_save_iterate
Lei Li [Wed, 4 Sep 2013 09:02:36 +0000 (17:02 +0800)]
arch_init: right return for ram_save_iterate

qemu_file_rate_limit() never return negative value since the refactor
by Commit 1964a39, this patch gets rid of the negative check for it,
adjust bytes_transferred and return value correspondingly in
ram_save_iterate().

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agosavevm: fix wrong initialization by ram_control_load_hook
Lei Li [Wed, 4 Sep 2013 09:02:35 +0000 (17:02 +0800)]
savevm: fix wrong initialization by ram_control_load_hook

It should set negative error value rather than 0 in QEMUFile
if there has been an error.

Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agosavevm: add comments for qemu_file_get_error()
Lei Li [Wed, 4 Sep 2013 09:02:34 +0000 (17:02 +0800)]
savevm: add comments for qemu_file_get_error()

Add comments for qemu_file_get_error(), as its return value
is not very clear.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoaudio: remove CONFIG_MIXEMU configure option
Bandan Das [Sat, 7 Sep 2013 04:54:00 +0000 (00:54 -0400)]
audio: remove CONFIG_MIXEMU configure option

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agohda-codec: make mixemu selectable at runtime
Bandan Das [Sat, 7 Sep 2013 04:53:59 +0000 (00:53 -0400)]
hda-codec: make mixemu selectable at runtime

Define PARAM so that we have two versions of the "desc_codec
and family" structs. Add a property called "mixer" whose default
value depends on whether CONFIG_MIXEMU is defined or not which
will help us call the appropriate instance init functions.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agohda-codec: refactor common definitions into a header file
Bandan Das [Sat, 7 Sep 2013 04:53:58 +0000 (00:53 -0400)]
hda-codec: refactor common definitions into a header file

Move common defines and structs to a header file.
The next commit will include it twice, once for a device with a
mixer, and once for device without a mixer.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoaudio maintainers update
Gerd Hoffmann [Tue, 24 Sep 2013 08:26:24 +0000 (10:26 +0200)]
audio maintainers update

av1474@comtv.ru bounces, and I havn't seen malc @ qemu-devel for quite a
while (anyone knows what is up?).  Adding myself as audio maintainer, so
audio patches don't fall through the cracks that easily.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolinux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host
Edgar E. Iglesias [Mon, 23 Sep 2013 12:11:53 +0000 (14:11 +0200)]
linux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host

If the host lacks SOCK_CLOEXEC, bail out with -EINVAL.
If the host lacks SOCK_ONONBLOCK, try to emulate it with fcntl()
and O_NONBLOCK.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years ago[v2] linux-user: implement m68k atomic syscalls
Riku Voipio [Wed, 24 Jul 2013 06:44:26 +0000 (09:44 +0300)]
[v2] linux-user: implement m68k atomic syscalls

With nptl enabled, atomic_cmpxchg_32 and atomic_barrier
system calls are needed. This patch enabled really dummy
versions of the system calls, modeled after the m68k
kernel code.

With this patch I am able to execute m68k binaries
with qemu linux-user (busybox compiled for coldfire).

[v2] que an segfault instead of returning a EFAULT
to keep in line with kernel code.

Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Check type of microMIPS break instruction
Kwok Cheung Yeung [Tue, 10 Sep 2013 00:36:40 +0000 (17:36 -0700)]
linux-user: Check type of microMIPS break instruction

microMIPS instructions that cause breakpoint exceptions come in
16-bit and 32-bit variants.  When handling exceptions caused by
such instructions, the instruction type needs to be taken into
account when extracting the break code.

The code has also been restructured for better clarity.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: correct how SOL_SOCKET is converted from target to host and back
Petar Jovanovic [Fri, 13 Sep 2013 17:27:29 +0000 (19:27 +0200)]
linux-user: correct how SOL_SOCKET is converted from target to host and back

Previous implementation does not take into account that SOL_SOCKET constant
can be arch specific. This change fixes some issues with sendmsg/recvmsg.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: add support of binfmt_misc 'O' flag
Laurent Vivier [Thu, 29 Aug 2013 23:46:44 +0000 (01:46 +0200)]
linux-user: add support of binfmt_misc 'O' flag

The binfmt_misc module can calculate the credentials and security
token according to the binary instead of to the interpreter if the
'C' flag is enabled.

To be able to execute non-readable binaries, this flag implies 'O'
flag. When 'O' flag is enabled, bintfmt_misc opens the file for
reading and pass the file descriptor to the interpreter.

References:
linux/Documentation/binfmt_misc.txt          ['O' and 'C' description]
linux/fs/binfmt_misc.c linux/fs/binfmt_elf.c [ AT_EXECFD usage ]

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: add some IPV6 commands in setsockop()
Laurent Vivier [Thu, 29 Aug 2013 23:46:43 +0000 (01:46 +0200)]
linux-user: add some IPV6 commands in setsockop()

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: allow use of TIOCGSID
Laurent Vivier [Thu, 29 Aug 2013 23:46:42 +0000 (01:46 +0200)]
linux-user: allow use of TIOCGSID

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Add setsockopt(SO_ATTACH_FILTER)
Laurent Vivier [Thu, 29 Aug 2013 23:46:41 +0000 (01:46 +0200)]
linux-user: Add setsockopt(SO_ATTACH_FILTER)

This is needed to be able to run dhclient.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: convert /proc/net/route when endianess differs
Laurent Vivier [Thu, 29 Aug 2013 23:46:40 +0000 (01:46 +0200)]
linux-user: convert /proc/net/route when endianess differs

This patch allows to have IP addresses in correct order
in the case of "netstat -nr" when the endianess of the
guest differs from one of the host.

For instance, an m68k guest on an x86_64 host:

WITHOUT this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         1.3.0.10        0.0.0.0         UG        0 0          0 eth0
0.3.0.10        0.0.0.0         0.255.255.255   U         0 0          0 eth0
$ cat /proc/net/route
Iface Destination Gateway  Flags RefCnt Use Metric Mask MTU Window IRTT

eth0 00000000 0103000A 0003 0 0 0 000000000 0 0
eth0 0003000A 00000000 0001 0 0 0 00FFFFFF0 0 0

WITH this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.3.1        0.0.0.0         UG        0 0          0 eth0
10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
$ cat /proc/net/route
Iface Destination Gateway  Flags RefCnt Use Metric Mask MTU Window IRTT
eth0 00000000 0a000301 0003 0 0 0 000000000 0 0
eth0 0a000300 00000000 0001 0 0 0 ffffff000 0 0

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agomips-linux-user: Adjust names in mips_syscall_args
Richard Henderson [Wed, 24 Jul 2013 19:50:01 +0000 (09:50 -1000)]
mips-linux-user: Adjust names in mips_syscall_args

The name field of MIPS_SYS isn't actually used; it's just documentation.
But adjust the umount entries to match mips/syscall_nr.h anyway.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agoalpha-linux-user: Fix umount syscall numbers
Richard Henderson [Wed, 24 Jul 2013 19:50:00 +0000 (09:50 -1000)]
alpha-linux-user: Fix umount syscall numbers

It has been pointed out on LKML that the alpha umount syscall numbers
are named wrong, and a patch to rectify that has been posted for 3.11.

Glibc works around this by treating NR_umount as NR_umount2 if
NR_oldumount exists.  That's more complicated than we need in QEMU,
given that we control linux-user/*/syscall_nr.h.

This is the last instance of TARGET_NR_oldumount, so delete that from
the strace.list.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:22 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

# By Alexey Kardashevskiy
# Via Stefan Hajnoczi
* stefanha/tracing:
  kvm: fix traces to use %x instead of %d

Message-id: 1379699931-5837-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:11 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging

# By Aurelien Jarno (1) and Vincenzo Maffione (1)
# Via Stefan Hajnoczi
* stefanha/net:
  e1000: NetClientInfo.receive_iov implemented
  pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN

Message-id: 1379699613-5338-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:05 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Stefan Hajnoczi (4) and others
# Via Stefan Hajnoczi
* stefanha/block:
  virtio-blk: do not relay a previous driver's WCE configuration to the current
  blockdev: do not default cache.no-flush to true
  block: don't lose data from last incomplete sector
  qcow2: Correct snapshots size for overlap check
  coroutine: fix /perf/nesting coroutine benchmark
  coroutine: add qemu_coroutine_yield benchmark
  qemu-timer: do not take the lock in timer_pending
  qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe
  qemu-timer: drop outdated signal safety comments
  osdep: warn if open(O_DIRECT) on fails with EINVAL
  libcacard: link against qemu-error.o for error_report()

Message-id: 1379698931-946-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:55 +0000 (11:52 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Stefan Weil (8) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  tests/.gitignore: ignore test-throttle
  exec: Fix broken build for MinGW (regression)
  kvm: Fix compiler warning (clang)
  tcg-sparc: Fix parenthesis warning
  Makefile: Remove some more files when cleaning
  target-i386: Fix segment cache dump
  iov: avoid "orig_len may be used unitialized" warning
  vscclient: remove unnecessary use of uninitialized variable
  trace-events: Clean up with scripts/cleanup-trace-events.pl again
  tci: Fix qemu-alpha on 32 bit hosts (wrong assertions)
  *-user: Improve documentation for lock_user function
  MAINTAINERS: Add missing entry to filelist for TCI target
  translate-all: Fix formatting of dump output
  *-user: Fix typo in comment (ulocking -> unlocking)
  docs: Fix IO port number for CPU present bitmap.
  q35: Fix typo in constant DEFUALT -> DEFAULT.
  configure: Undefine _FORTIFY_SOURCE prior using it

Message-id: 1379696296-32105-1-git-send-email-mjt@msgid.tls.msk.ru

10 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:49 +0000 (11:52 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

# By Alexey Kardashevskiy (3) and others
# Via Paolo Bonzini
* qemu-kvm/uq/master:
  target-i386: add feature kvm_pv_unhalt
  linux-headers: update to 3.12-rc1
  target-i386: forward CPUID cache leaves when -cpu host is used
  linux-headers: update to 3.11
  kvm: fix traces to use %x instead of %d
  kvmvapic: Clear also physical ROM address when entering INACTIVE state
  kvmvapic: Enter inactive state on hardware reset
  kvmvapic: Catch invalid ROM size
  kvm irqfd: support direct msimessage to irq translation
  fix steal time MSR vmsd callback to proper opaque type
  kvm: warn if num cpus is greater than num recommended
  cpu: Move cpu state syncs up into cpu_dump_state()
  exec: always use MADV_DONTFORK

Message-id: 1379694292-1601-1-git-send-email-pbonzini@redhat.com

10 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:32 +0000 (11:52 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

# By Hervé Poussineau (5) and Stefan Weil (1)
# Via Paolo Bonzini
* bonzini/scsi-next:
  block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi
  lsi: add 53C810 variant
  lsi: remove todo
  lsi: ignore write accesses to CTEST0 registers
  lsi: check ssid versus sdid only if ssid is valid
  lsi: use constant name instead of its value

10 years agokvm: fix traces to use %x instead of %d
Alexey Kardashevskiy [Wed, 4 Sep 2013 10:26:25 +0000 (20:26 +1000)]
kvm: fix traces to use %x instead of %d

KVM request types are normally defined using hex constants but QEMU traces
print decimal values instead, which is not very convenient.

This changes the request type format from %d to %x.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoe1000: NetClientInfo.receive_iov implemented
Vincenzo Maffione [Thu, 12 Sep 2013 08:47:37 +0000 (10:47 +0200)]
e1000: NetClientInfo.receive_iov implemented

This patch implements the NetClientInfo.receive_iov method for the
e1000 device emulation. In this way a network backend that uses
qemu_sendv_packet() can deliver the fragmented packet without
requiring an additional copy in the frontend/backend network code
(nc_sendv_compat() function).

The existing method NetClientInfo.receive has been reimplemented
using the new method.

Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agopcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN
Aurelien Jarno [Wed, 28 Aug 2013 12:17:39 +0000 (14:17 +0200)]
pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN

Now that the memory subsystem is propagating the endianness correctly,
the pcnet-pci device should have its I/O ports and MMIO memory marked
as LITTLE_ENDIAN, as PCI devices are little endian.

This makes the pcnet-pci NIC to work again on big endian MIPS Malta
(default NIC).

Cc: qemu-stable@nongnu.org
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovirtio-blk: do not relay a previous driver's WCE configuration to the current
Paolo Bonzini [Fri, 20 Sep 2013 15:31:55 +0000 (17:31 +0200)]
virtio-blk: do not relay a previous driver's WCE configuration to the current

The following sequence happens:
- the SeaBIOS virtio-blk driver does not support the WCE feature, which
causes QEMU to disable writeback caching

- the Linux virtio-blk driver resets the device, finds WCE is available
but writeback caching is disabled; tells block layer to not send cache
flush commands

- the Linux virtio-blk driver sets the DRIVER_OK bit, which causes
writeback caching to be re-enabled, but the Linux virtio-blk driver does
not know of this side effect and cache flushes remain disabled

The bug is at the third step.  If the guest does know about CONFIG_WCE,
QEMU should ignore the WCE feature's state.  The guest will control the
cache mode solely using configuration space.  This change makes Linux
do flushes correctly, but Linux will keep SeaBIOS's writethrough mode.

Hence, whenever the guest is reset, the cache mode of the disk should
be reset to whatever was specified in the "-drive" option.  With this
change, the Linux virtio-blk driver finds that writeback caching is
enabled, and tells the block layer to send cache flush commands
appropriately.

Reported-by: Rusty Russell <rusty@au1.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblockdev: do not default cache.no-flush to true
Paolo Bonzini [Thu, 19 Sep 2013 16:48:53 +0000 (18:48 +0200)]
blockdev: do not default cache.no-flush to true

That's why all my VMs were so fast lately. :)

This changed in 1.6.0 by mistake in patch 29c4e2b (blockdev: Split up
'cache' option, 2013-07-18).

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: don't lose data from last incomplete sector
Fam Zheng [Wed, 18 Sep 2013 11:14:14 +0000 (19:14 +0800)]
block: don't lose data from last incomplete sector

To read the last sector that is not aligned to sector boundary, current
code for growable backends, since commit 893a8f6 "block: Produce zeros
when protocols reading beyond end of file", drops the data and directly
returns zeroes. That is incorrect.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotests/.gitignore: ignore test-throttle
Fam Zheng [Mon, 16 Sep 2013 07:20:40 +0000 (15:20 +0800)]
tests/.gitignore: ignore test-throttle

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoexec: Fix broken build for MinGW (regression)
Stefan Weil [Wed, 18 Sep 2013 05:48:15 +0000 (07:48 +0200)]
exec: Fix broken build for MinGW (regression)

Commit 3435f39513a104294b5e3bbf3612047028d25cfc reduced the ifdeffery with
this result for MinGW:

exec.c: In function ‘qemu_ram_free’:
exec.c:1239:17: warning:
 implicit declaration of function ‘munmap’ [-Wimplicit-function-declaration]
exec.c:1239:17: warning:
 nested extern declaration of ‘munmap’ [-Wnested-externs]
exec.c:1239: undefined reference to `munmap'

Add some ifdeffery again to fix this.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agokvm: Fix compiler warning (clang)
Stefan Weil [Tue, 17 Sep 2013 20:39:55 +0000 (22:39 +0200)]
kvm: Fix compiler warning (clang)

Report from clang analyzer:

clock.c:42:15: warning:
Value stored to 'cpu' during its initialization is never read

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotcg-sparc: Fix parenthesis warning
Richard Henderson [Fri, 6 Sep 2013 20:24:11 +0000 (13:24 -0700)]
tcg-sparc: Fix parenthesis warning

error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMakefile: Remove some more files when cleaning
Stefan Weil [Thu, 25 Jul 2013 16:24:58 +0000 (18:24 +0200)]
Makefile: Remove some more files when cleaning

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotarget-i386: Fix segment cache dump
Tobias Markus [Sun, 25 Aug 2013 10:20:06 +0000 (12:20 +0200)]
target-i386: Fix segment cache dump

When in Long Mode, cpu_x86_seg_cache() logs "DS16" because the Default
operation size bit (D/B bit) is not set for Long Mode Data Segments since
there are only Data Segments in Long Mode and no explicit 16/32/64-bit
Descriptors.
This patch fixes this by checking the Long Mode Active bit of the hidden
flags variable and logging "DS" if it is set. (I.e. in Long Mode all Data
Segments are logged as "DS")

Signed-off-by: Tobias Markus <tobias@markus-regensburg.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoiov: avoid "orig_len may be used unitialized" warning
Michael Tokarev [Sat, 14 Sep 2013 09:11:36 +0000 (13:11 +0400)]
iov: avoid "orig_len may be used unitialized" warning

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agovscclient: remove unnecessary use of uninitialized variable
Michael Tokarev [Sat, 14 Sep 2013 09:10:16 +0000 (13:10 +0400)]
vscclient: remove unnecessary use of uninitialized variable

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotrace-events: Clean up with scripts/cleanup-trace-events.pl again
Markus Armbruster [Fri, 13 Sep 2013 08:49:51 +0000 (10:49 +0200)]
trace-events: Clean up with scripts/cleanup-trace-events.pl again

Event qxl_render_blit_guest_primary_initialized is unused since commit
c58c7b9, drop it.

Commit 42e5b4c moved hw/ppc/xics.c to hw/intc/xics.c without updating
the comment in trace-events.

"scripts/cleanup-trace-events.pl trace-events | diff trace-events" is
now clean again.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotci: Fix qemu-alpha on 32 bit hosts (wrong assertions)
Stefan Weil [Thu, 12 Sep 2013 18:17:50 +0000 (20:17 +0200)]
tci: Fix qemu-alpha on 32 bit hosts (wrong assertions)

Debian busybox-static for alpha has a load address of 0x0000000120000000
which is mapped to 0x0000000020000000 for 32 bit hosts.

qemu-alpha uses the TCG opcodes qemu_ld32, qemu_ld64, qemu_st32 and
qemu_st64 which all raise the assertion (taddr == host_addr).

Remove all assertions of this type because they are either wrong or
unnecessary (when sizeof(tcg_target_ulong) >= sizeof(target_ulong)).

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago*-user: Improve documentation for lock_user function
Stefan Weil [Thu, 12 Sep 2013 17:57:15 +0000 (19:57 +0200)]
*-user: Improve documentation for lock_user function

Add a missing "function" and replace "and" by "any".
BSD and Linux use the same documentation here, so fix both.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMAINTAINERS: Add missing entry to filelist for TCI target
Stefan Weil [Thu, 12 Sep 2013 18:24:31 +0000 (20:24 +0200)]
MAINTAINERS: Add missing entry to filelist for TCI target

tci.c is also a maintained part of the TCI implementation.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotranslate-all: Fix formatting of dump output
Stefan Weil [Thu, 12 Sep 2013 18:09:06 +0000 (20:09 +0200)]
translate-all: Fix formatting of dump output

The page dump writes a table with 3 abi_ulong values in each row.
These values take 8 or 16 characters (depending on sizeof abi_ulong).

Fix the table headings to be aligned with the table columns.

old:
start    end      size     prot
0000000120000000-000000012021e000 000000000021e000 rwx
0000004000000000-0000004000002000 0000000000002000 ---
0000004000002000-0000004000802000 0000000000800000 rw-

new:
start            end              size             prot
0000000120000000-000000012021e000 000000000021e000 rwx
0000004000000000-0000004000002000 0000000000002000 ---
0000004000002000-0000004000802000 0000000000800000 rw-

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago*-user: Fix typo in comment (ulocking -> unlocking)
Stefan Weil [Thu, 12 Sep 2013 17:57:41 +0000 (19:57 +0200)]
*-user: Fix typo in comment (ulocking -> unlocking)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agodocs: Fix IO port number for CPU present bitmap.
Anthony PERARD [Tue, 10 Sep 2013 16:36:18 +0000 (17:36 +0100)]
docs: Fix IO port number for CPU present bitmap.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewd-By: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoq35: Fix typo in constant DEFUALT -> DEFAULT.
Richard W.M. Jones [Mon, 2 Sep 2013 13:43:36 +0000 (14:43 +0100)]
q35: Fix typo in constant DEFUALT -> DEFAULT.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoconfigure: Undefine _FORTIFY_SOURCE prior using it
Michal Privoznik [Thu, 5 Sep 2013 10:54:49 +0000 (12:54 +0200)]
configure: Undefine _FORTIFY_SOURCE prior using it

Currently, we are enforcing the _FORTIFY_SOURCE=2 without any
previous detection if the macro has been already defined, e.g.
by environment, or is just enabled by compiler by default.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMerge remote-tracking branch 'spice/spice.v74' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:08:18 +0000 (08:08 -0500)]
Merge remote-tracking branch 'spice/spice.v74' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* spice/spice.v74:
  qxl: compile only once
  qxl: simplify page dirtying
  qxl: simplify qxl_rom_size
  qxl: define qxl operating on 4k pages

Message-id: 1379583534-7831-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'kraxel/usb.90' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:08:08 +0000 (08:08 -0500)]
Merge remote-tracking branch 'kraxel/usb.90' into staging

# By Hans de Goede (6) and Gerd Hoffmann (1)
# Via Gerd Hoffmann
* kraxel/usb.90:
  usb: Fix iovec memleak on combined-packet free
  usb: Also reset max_packet_size on ep_reset
  xhci: Fix memory leak on xhci_disable_ep
  xhci: Add xhci_epid_to_usbep helper function
  xhci: Init a transfers xhci, slotid and epid member on epctx alloc
  xhci: Fix number of streams allocated when using streams
  usb: remove old usb-host code

Message-id: 1379583298-7524-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:06:38 +0000 (08:06 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Luiz Capitulino
# Via Luiz Capitulino
* luiz/queue/qmp:
  QMP: qmp-events.txt: alphabetical order fix and other minor changes
  QMP: Update qmp-spec.txt
  QMP: Update README file
  QMP: QMP/ -> docs/qmp/
  QMP: fix qmp-commands.txt generation path
  QMP: add scripts/qmp

Message-id: 1379509422-29115-1-git-send-email-lcapitulino@redhat.com

10 years agos390/sclplmconsole: Add support for SCLP line-mode console
Heinz Graalfs [Wed, 22 May 2013 12:11:36 +0000 (14:11 +0200)]
s390/sclplmconsole: Add support for SCLP line-mode console

Add simple support for SCLP line-mode also known as operating
system messages. This can be added in addition to or instead of
the SCLP full screen console with -device sclplmconsole.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ebcdic: Move conversion tables to header file
Heinz Graalfs [Tue, 21 May 2013 15:04:58 +0000 (17:04 +0200)]
s390/ebcdic: Move conversion tables to header file

Move conversion tables to header file.
   - In SCLP line mode processing EBCDIC/ASCII conversion is needed.
   - An additional EBCDIC to ASCII conversion function is added.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/eventfacility: allow childs to handle more than 1 event type
Christian Borntraeger [Tue, 17 Sep 2013 11:07:30 +0000 (13:07 +0200)]
s390/eventfacility: allow childs to handle more than 1 event type

Currently all handlers (quiesce, console) only handle one event type.
Some drivers will handle multiple (compatible) event types. Rework the
code accordingly.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: remove unused event_type variable
Christian Borntraeger [Tue, 17 Sep 2013 11:01:31 +0000 (13:01 +0200)]
s390/eventfacility: remove unused event_type variable

The event_type variable is never used. Get rid of it.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: Fix receive/send masks
Christian Borntraeger [Tue, 17 Sep 2013 08:32:54 +0000 (10:32 +0200)]
s390/eventfacility: Fix receive/send masks

Currently we announce interchanged receive/send masks. This did not
trigger a bug, since the sclp console has the same masks for
send/receive and the Linux guest does not check the sclp mask for simple
events like quiesce. With other event users like the sclp line mode
console, we will have different send/receive bits. Fix it.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: fix multiple Read Event Data sources
Ralf Hoppe [Mon, 19 Aug 2013 07:41:24 +0000 (09:41 +0200)]
s390/eventfacility: fix multiple Read Event Data sources

Make the handler for SCLP Read Event Data deal with notifications
for multiple sources correctly.

Signed-off-by: Ralf Hoppe <rhoppe@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[split bigger patch into smaller independent chunks]
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/sclp: add reset() functions
Heinz Graalfs [Wed, 4 Sep 2013 10:55:45 +0000 (12:55 +0200)]
s390/sclp: add reset() functions

Add reset() functions for event-facility, sclpconsole, and sclpquiesce.
The reset() functions perform variable initialization
at IPL and e.g. when monitor system_reset is called.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpquiesce: Add code to support live migration
Heinz Graalfs [Tue, 11 Sep 2012 11:41:26 +0000 (13:41 +0200)]
s390/sclpquiesce: Add code to support live migration

This patch adds the necessary life migration pieces to sclpquiesce
by using the vmstate_register.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpconsole: Add code to support live migration for sclpconsole
Heinz Graalfs [Tue, 11 Sep 2012 11:41:26 +0000 (13:41 +0200)]
s390/sclpconsole: Add code to support live migration for sclpconsole

This patch adds the necessary life migration pieces to the sclp code
by using vmstate_register.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpconsole: modify definition of input buffer
Heinz Graalfs [Wed, 28 Aug 2013 14:30:28 +0000 (16:30 +0200)]
s390/sclpconsole: modify definition of input buffer

To use VMState for migration, we need to adapt some sclp code:
   - allocate console buffer as part of the console
   - change semantic of sclpconsole offset fields

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/kexec: Implement diag308 subcode 0
Christian Borntraeger [Thu, 19 Sep 2013 07:32:03 +0000 (09:32 +0200)]
s390/kexec: Implement diag308 subcode 0

This patch implements subcode 0 of diag 308. This is necessary for kexec
(without kdump). The main difference to subcode 1 is that all CPUs get
a full reset, instead of the architectured CPU reset (which leaves all
registers untouched).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agoqcow2: Correct snapshots size for overlap check
Max Reitz [Thu, 19 Sep 2013 10:29:15 +0000 (12:29 +0200)]
qcow2: Correct snapshots size for overlap check

Using s->snapshots_size instead of snapshots_size for the metadata
overlap check in qcow2_write_snapshots leads to the detection of an
overlap with the main qcow2 image header when deleting the last
snapshot, since s->snapshots_size has not yet been updated and is
therefore non-zero. However, the offset returned by qcow2_alloc_clusters
will be zero since snapshots_size is zero. Therefore, an overlap is
detected albeit no such will occur.

This patch fixes this by replacing s->snapshots_size by snapshots_size
when calling qcow2_pre_write_overlap_check.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agos390/ioinst: Moved the CC setting to the IO instruction handlers
Thomas Huth [Mon, 1 Jul 2013 13:44:18 +0000 (15:44 +0200)]
s390/ioinst: Moved the CC setting to the IO instruction handlers

The IO instruction handlers now take care of setting the CC value on
their own, so that the confusing return code magic in kvm_handle_css_inst()
is not needed anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/cpu: Make setcc() function available to other files
Thomas Huth [Tue, 2 Jul 2013 11:43:38 +0000 (13:43 +0200)]
s390/cpu: Make setcc() function available to other files

Moved the setcc() function to cpu.h so that it can be used by other
files, too. It now also does not modify the kvm state anymore since
this gets updated during kvm_arch_put_registers() anyway.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ipl: Update the s390-ccw.img rom
Christian Borntraeger [Mon, 2 Sep 2013 09:05:43 +0000 (11:05 +0200)]
s390/ipl: Update the s390-ccw.img rom

Rebuild of the virtio-ccw rom containing these patches:
1. s390/ipl: Fix waiting for virtio processing

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ipl: Fix waiting for virtio processing
Cornelia Huck [Thu, 29 Aug 2013 15:52:43 +0000 (17:52 +0200)]
s390/ipl: Fix waiting for virtio processing

The guest side must not manipulate the index for the used buffers. Instead,
remember the state of the used buffer locally and wait until it has moved.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/dump: zero out padding bytes in notes sections
Christian Borntraeger [Thu, 29 Aug 2013 10:40:25 +0000 (12:40 +0200)]
s390/dump: zero out padding bytes in notes sections

The prstatus of an s390x dump contains several padding areas. Zero out
these bytes to make reading the notes section easier with a hexdump.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/kvm: Add check for priviledged SCLP handler
Thomas Huth [Mon, 29 Jul 2013 13:49:16 +0000 (15:49 +0200)]
s390/kvm: Add check for priviledged SCLP handler

The SCLP instruction is priviledged, so we should make sure that
we generate an exception when it is called from the problem state.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agotarget-i386: add feature kvm_pv_unhalt
Andrew Jones [Wed, 18 Sep 2013 14:41:45 +0000 (16:41 +0200)]
target-i386: add feature kvm_pv_unhalt

I don't know yet if want this feature on by default, so for now I'm
just adding support for "-cpu ...,+kvm_pv_unhalt".

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>