sdk/emulator/qemu.git
10 years agotarget-cris/translate.c: Remove _t_gen_mov_TN_env and _t_gen_mov_env_TN
Peter Maydell [Sat, 7 Jun 2014 17:03:02 +0000 (18:03 +0100)]
target-cris/translate.c: Remove _t_gen_mov_TN_env and _t_gen_mov_env_TN

The wrapper functions _t_gen_mov_TN_env and _t_gen_mov_env_TN are only
used via their accompanying non-underscore macros. The check they add
on offset is thus pointless, since the compiler will complain if the
struct field passed to the macro is not part of the struct. Remove the
functions and make the macros directly expand to the appropriate
tcg_gen_{ld,st}_tl calls.

This conveniently avoids a warning due to _t_gen_mov_TN_env() being
unused.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agotarget-cris/translate.c: Remove t_gen_mov_TN_reg and t_gen_mov_reg_TN
Peter Maydell [Sat, 7 Jun 2014 17:03:01 +0000 (18:03 +0100)]
target-cris/translate.c: Remove t_gen_mov_TN_reg and t_gen_mov_reg_TN

Remove the t_gen_mov_TN_reg and t_gen_mov_reg_TN wrappers: the
latter is completely unused, and the former only used in a few
places (which are thus inconsistent with the rest of the decoder
which directly accesses cpu_R[]).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agointc: xilinx_uartlite: Convert SBD::init -> instance_init
Peter Crosthwaite [Thu, 29 May 2014 09:26:12 +0000 (02:26 -0700)]
intc: xilinx_uartlite: Convert SBD::init -> instance_init

SysBusDevice::init is depracated. Convert to Object::init
as prescribed by QOM conventions.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agochar: xilinx_uartlite: Convert to realize()
Peter Crosthwaite [Thu, 29 May 2014 09:25:37 +0000 (02:25 -0700)]
char: xilinx_uartlite: Convert to realize()

SysBusDevice::init is depracated. Convert to Object::init and
Device::realize as prescribed by QOM conventions.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agochar: xilinx_uartlite: Don't reset from init
Peter Crosthwaite [Thu, 29 May 2014 09:25:03 +0000 (02:25 -0700)]
char: xilinx_uartlite: Don't reset from init

This refresh of the device state is intended to be a reset side
effect. Move it to a proper reset handler rather than do it at
init time.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agonet: xilinx_ethlite: Convert to realize()
Peter Crosthwaite [Thu, 29 May 2014 09:24:29 +0000 (02:24 -0700)]
net: xilinx_ethlite: Convert to realize()

SysBusDevice::init is depracated. Convert to Object::init and
Device::realize as prescribed by QOM conventions.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agonet: xilinx_ethlite: Don't reset from init
Peter Crosthwaite [Thu, 29 May 2014 09:23:54 +0000 (02:23 -0700)]
net: xilinx_ethlite: Don't reset from init

This zeroing-out of the rxbuf variable (ping pong state) is a reset
side effect. Extract into a proper reset.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agotimer: xilinx_timer: Convert to realize()
Peter Crosthwaite [Thu, 29 May 2014 09:23:20 +0000 (02:23 -0700)]
timer: xilinx_timer: Convert to realize()

SysBusDevice::init is depracated. Convert to Object::init and
Device::realize as prescribed by QOM conventions.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agoMerge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging
Peter Maydell [Thu, 5 Jun 2014 22:05:07 +0000 (23:05 +0100)]
Merge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging

* remotes/mcayland/qemu-sparc:
  apb: implement IOMMU translation for PCI host bridge
  apb: handle reading/writing of IOMMU control registers
  apb: fix IOMMU register sizes
  apb: Move IOMMU registers into a separate IOMMUState struct
  tcx: move initialisation from realizefn to initfn
  tcx: move initialisation from SysBusDevice class to TCX class realizefn
  cg3: add extra check to prevent CG3 register array overflow
  cg3: move initialisation from realizefn to initfn

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mdroth/qga-pull-2014-06-05' into staging
Peter Maydell [Thu, 5 Jun 2014 21:40:44 +0000 (22:40 +0100)]
Merge remote-tracking branch 'remotes/mdroth/qga-pull-2014-06-05' into staging

* remotes/mdroth/qga-pull-2014-06-05:
  qga: Fix handle fd leak in acquire_privilege()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Thu, 5 Jun 2014 20:52:37 +0000 (21:52 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc,pci,virtio,qdev fixes, tests

new tests for SMBIOS
SMBIOS fixes
pc, pci fixes
qdev patches stayed on list for a month with no review,
as I told people on KVM forum I'm merging stuch patches
if they look fine.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* remotes/mst/tags/for_upstream:
  qdev: Add test of qdev_prop_check_global
  qdev: Display warning about unused -global
  tests: add smbios testing
  tests: rename acpi-test to bios-tables-test
  virtio-balloon: return empty data when no stats are available
  pcie_host: Turn pcie_host_init() into an instance_init
  SMBIOS: Fix type 17 field sizes
  SMBIOS: Update Type 0 struct generator for machines >= 2.1
  SMBIOS: Fix endian-ness when populating multi-byte fields
  serial-pci: Set prog interface field of pci config to 16550 compatible

Conflicts:
include/hw/i386/pc.h
[PMM: fixed trivial conflict in pc.h]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/bonzini/softmmu-smap' into staging
Peter Maydell [Thu, 5 Jun 2014 20:06:13 +0000 (21:06 +0100)]
Merge remote-tracking branch 'remotes/bonzini/softmmu-smap' into staging

* remotes/bonzini/softmmu-smap: (33 commits)
  target-i386: cleanup x86_cpu_get_phys_page_debug
  target-i386: fix protection bits in the TLB for SMEP
  target-i386: support long addresses for 4MB pages (PSE-36)
  target-i386: raise page fault for reserved bits in large pages
  target-i386: unify reserved bits and NX bit check
  target-i386: simplify pte/vaddr calculation
  target-i386: raise page fault for reserved physical address bits
  target-i386: test reserved PS bit on PML4Es
  target-i386: set correct error code for reserved bit access
  target-i386: introduce support for 1 GB pages
  target-i386: introduce do_check_protect label
  target-i386: tweak handling of PG_NX_MASK
  target-i386: commonize checks for PAE and non-PAE
  target-i386: commonize checks for 4MB and 4KB pages
  target-i386: commonize checks for 2MB and 4KB pages
  target-i386: fix coding standards in x86_cpu_handle_mmu_fault
  target-i386: simplify SMAP handling in MMU_KSMAP_IDX
  target-i386: fix kernel accesses with SMAP and CPL = 3
  target-i386: move check_io helpers to seg_helper.c
  target-i386: rename KSMAP to KNOSMAP
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoapb: implement IOMMU translation for PCI host bridge
Mark Cave-Ayland [Wed, 28 May 2014 07:28:22 +0000 (08:28 +0100)]
apb: implement IOMMU translation for PCI host bridge

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
10 years agoapb: handle reading/writing of IOMMU control registers
Mark Cave-Ayland [Wed, 28 May 2014 07:28:22 +0000 (08:28 +0100)]
apb: handle reading/writing of IOMMU control registers

While the registers are documented as being 64-bit, Linux seems to access
them in two halves as 2 x 32-bit accesses. Make sure that we can correctly
handle this case.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
10 years agoapb: fix IOMMU register sizes
Mark Cave-Ayland [Wed, 28 May 2014 07:28:21 +0000 (08:28 +0100)]
apb: fix IOMMU register sizes

According to the referenced documentation, the IOMMU has 3 64-bit registers
consisting of a control register, base register and flush register.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
10 years agoapb: Move IOMMU registers into a separate IOMMUState struct
Mark Cave-Ayland [Wed, 28 May 2014 07:28:21 +0000 (08:28 +0100)]
apb: Move IOMMU registers into a separate IOMMUState struct

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
10 years agotcx: move initialisation from realizefn to initfn
Mark Cave-Ayland [Sat, 24 May 2014 11:44:53 +0000 (12:44 +0100)]
tcx: move initialisation from realizefn to initfn

Initialisation cleanup as suggested by Andreas.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Andreas Färber <afaerber@suse.de>
10 years agotcx: move initialisation from SysBusDevice class to TCX class realizefn
Mark Cave-Ayland [Sat, 24 May 2014 11:19:44 +0000 (12:19 +0100)]
tcx: move initialisation from SysBusDevice class to TCX class realizefn

This is an intermediate step to bring TCX in line with CG3.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Andreas Färber <afaerber@suse.de>
10 years agocg3: add extra check to prevent CG3 register array overflow
Mark Cave-Ayland [Sat, 24 May 2014 10:51:50 +0000 (11:51 +0100)]
cg3: add extra check to prevent CG3 register array overflow

The case statements in the CG3 read and write register routines have a maximum
value of CG3_REG_SIZE, so if a value were written to this offset then it
would overflow the register array.

Currently this cannot be exploited since the MemoryRegion restricts accesses
to the range 0 ... CG3_REG_SIZE - 1, but it seems worth clarifying this for
future review and/or static analysis.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Paolo Bonzini <pbonzini@redhat.com>
10 years agocg3: move initialisation from realizefn to initfn
Mark Cave-Ayland [Sat, 24 May 2014 10:42:36 +0000 (11:42 +0100)]
cg3: move initialisation from realizefn to initfn

Initialisation cleanup as suggested by Andreas.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Andreas Färber <afaerber@suse.de>
10 years agoMerge remote-tracking branch 'remotes/rth/tcg-next' into staging
Peter Maydell [Thu, 5 Jun 2014 19:11:50 +0000 (20:11 +0100)]
Merge remote-tracking branch 'remotes/rth/tcg-next' into staging

* remotes/rth/tcg-next:
  TCG: Fix tcg_gen_extr_i64_tl for 32bit
  tcg: Remove TCG_TARGET_HAS_new_ldst
  tci: Convert to new ldst opcodes
  tcg-i386: Fix win64 qemu store

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kvm/uq/master' into staging
Peter Maydell [Thu, 5 Jun 2014 18:16:28 +0000 (19:16 +0100)]
Merge remote-tracking branch 'remotes/kvm/uq/master' into staging

* remotes/kvm/uq/master:
  kvm: Fix eax for cpuid leaf 0x40000000
  kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
  kvm: Enable -cpu option to hide KVM
  kvm: Ensure negative return value on kvm_init() error handling path
  target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags
  target-i386: get CPL from SS.DPL
  target-i386: rework CPL checks during task switch, preparing for next patch
  target-i386: fix segment flags for SMM and VM86 mode
  target-i386: Fix vm86 mode regression introduced in fd460606fd6f.
  kvm_stat: allow choosing between tracepoints and old stats
  kvmclock: Ensure time in migration never goes backward

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-input-10' into staging
Peter Maydell [Thu, 5 Jun 2014 17:58:53 +0000 (18:58 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-10' into staging

updates for docs/multiseat.txt
input: add support for kbd delays

# gpg: Signature made Wed 04 Jun 2014 08:22:39 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-input-10:
  docs/multiseat.txt: add note about spice
  docs/multiseat.txt: gtk joined the party
  docs/multiseat.txt: use autoseat
  input/vnc: use kbd delays in press_key
  input/curses: add kbd delay between keydown and keyup events
  input: use kbd delays for send_key monitor command
  input: add support for kbd delays

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoqdev: Add test of qdev_prop_check_global
Don Slutz [Mon, 5 May 2014 18:03:07 +0000 (14:03 -0400)]
qdev: Add test of qdev_prop_check_global

This will generate a warning from "make check":

...
GTESTER tests/test-qdev-global-props
Warning: "-global dynamic-prop-type-bad.prop3=103" not used
GTESTER tests/check-qom-interface
...

If the warning is not generated, the test will fail.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoqdev: Display warning about unused -global
Don Slutz [Mon, 5 May 2014 18:03:06 +0000 (14:03 -0400)]
qdev: Display warning about unused -global

This can help a user understand why -global was ignored.

For example: with "-vga cirrus"; "-global vga.vgamem_mb=16" is just
ignored when "-global cirrus-vga.vgamem_mb=16" is not.

This is currently clear when the wrong property is provided:

out/x86_64-softmmu/qemu-system-x86_64 -global cirrus-vga.vram_size_mb=16 -monitor pty -vga cirrus
char device redirected to /dev/pts/20 (label compat_monitor0)
qemu-system-x86_64: Property '.vram_size_mb' not found
Aborted (core dumped)

vs

out/x86_64-softmmu/qemu-system-x86_64 -global vga.vram_size_mb=16 -monitor pty -vga cirrus
char device redirected to /dev/pts/20 (label compat_monitor0)
VNC server running on `::1:5900'
^Cqemu: terminating on signal 2

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
10 years agotarget-i386: cleanup x86_cpu_get_phys_page_debug
Paolo Bonzini [Tue, 27 May 2014 12:58:47 +0000 (14:58 +0200)]
target-i386: cleanup x86_cpu_get_phys_page_debug

Make the code a bit more similar to x86_cpu_handle_mmu_fault.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: fix protection bits in the TLB for SMEP
Paolo Bonzini [Tue, 27 May 2014 11:24:54 +0000 (13:24 +0200)]
target-i386: fix protection bits in the TLB for SMEP

User pages must be marked as non-executable when running under SMEP;
otherwise, fetching the page first and then calling it will fail.

With this patch, all SMEP testcases in kvm-unit-tests now pass.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: support long addresses for 4MB pages (PSE-36)
Paolo Bonzini [Tue, 27 May 2014 10:31:28 +0000 (12:31 +0200)]
target-i386: support long addresses for 4MB pages (PSE-36)

4MB pages can use 40-bit addresses by putting the higher 8 bits in bits
20-13 of the PDE.  Bit 21 is reserved.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: raise page fault for reserved bits in large pages
Paolo Bonzini [Tue, 27 May 2014 11:03:17 +0000 (13:03 +0200)]
target-i386: raise page fault for reserved bits in large pages

In large pages, bit 12 is for PAT, but bits starting at 13 are reserved.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: unify reserved bits and NX bit check
Paolo Bonzini [Tue, 27 May 2014 11:58:46 +0000 (13:58 +0200)]
target-i386: unify reserved bits and NX bit check

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: simplify pte/vaddr calculation
Paolo Bonzini [Tue, 27 May 2014 12:44:49 +0000 (14:44 +0200)]
target-i386: simplify pte/vaddr calculation

They can moved to after the dirty bit processing, and unified between
CR0.PG=1 and CR0.PG=0.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: raise page fault for reserved physical address bits
Paolo Bonzini [Tue, 27 May 2014 10:58:36 +0000 (12:58 +0200)]
target-i386: raise page fault for reserved physical address bits

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: test reserved PS bit on PML4Es
Paolo Bonzini [Tue, 27 May 2014 10:39:23 +0000 (12:39 +0200)]
target-i386: test reserved PS bit on PML4Es

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: set correct error code for reserved bit access
Paolo Bonzini [Tue, 27 May 2014 10:16:08 +0000 (12:16 +0200)]
target-i386: set correct error code for reserved bit access

The correct error code is 9 (present, reserved), not 8.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: introduce support for 1 GB pages
Paolo Bonzini [Fri, 4 Apr 2014 06:12:28 +0000 (08:12 +0200)]
target-i386: introduce support for 1 GB pages

Given the simplifications to the code in the previous patches, this
is now very simple to do.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: introduce do_check_protect label
Paolo Bonzini [Fri, 4 Apr 2014 06:11:48 +0000 (08:11 +0200)]
target-i386: introduce do_check_protect label

This will help adding 1GB page support in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: tweak handling of PG_NX_MASK
Paolo Bonzini [Fri, 4 Apr 2014 06:04:18 +0000 (08:04 +0200)]
target-i386: tweak handling of PG_NX_MASK

Remove the tail of the PAE case, so that we can use "goto" in the
next patch to jump to the protection checks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: commonize checks for PAE and non-PAE
Paolo Bonzini [Fri, 4 Apr 2014 06:00:40 +0000 (08:00 +0200)]
target-i386: commonize checks for PAE and non-PAE

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: commonize checks for 4MB and 4KB pages
Paolo Bonzini [Fri, 4 Apr 2014 05:57:02 +0000 (07:57 +0200)]
target-i386: commonize checks for 4MB and 4KB pages

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: commonize checks for 2MB and 4KB pages
Paolo Bonzini [Fri, 4 Apr 2014 05:51:29 +0000 (07:51 +0200)]
target-i386: commonize checks for 2MB and 4KB pages

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: fix coding standards in x86_cpu_handle_mmu_fault
Paolo Bonzini [Fri, 4 Apr 2014 06:19:55 +0000 (08:19 +0200)]
target-i386: fix coding standards in x86_cpu_handle_mmu_fault

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: simplify SMAP handling in MMU_KSMAP_IDX
Paolo Bonzini [Fri, 28 Mar 2014 10:49:20 +0000 (11:49 +0100)]
target-i386: simplify SMAP handling in MMU_KSMAP_IDX

Do not use this MMU index at all if CR4.SMAP is false, and drop
the SMAP check from x86_cpu_handle_mmu_fault.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: fix kernel accesses with SMAP and CPL = 3
Paolo Bonzini [Fri, 28 Mar 2014 10:43:45 +0000 (11:43 +0100)]
target-i386: fix kernel accesses with SMAP and CPL = 3

With SMAP, implicit kernel accesses from user mode always behave as
if AC=0.  To do this, kernel mode is not anymore a separate MMU mode.
Instead, KERNEL_IDX is renamed to KSMAP_IDX and the kernel mode accessors
wrap KSMAP_IDX and KNOSMAP_IDX.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: move check_io helpers to seg_helper.c
Paolo Bonzini [Fri, 28 Mar 2014 17:47:57 +0000 (18:47 +0100)]
target-i386: move check_io helpers to seg_helper.c

Prepare for adding _kernel accessors there in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: rename KSMAP to KNOSMAP
Paolo Bonzini [Fri, 28 Mar 2014 10:28:38 +0000 (11:28 +0100)]
target-i386: rename KSMAP to KNOSMAP

This is the mode where SMAP is overridden, put "NO" in its name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: move all load/store functions to cpu_ldst.h
Paolo Bonzini [Fri, 28 Mar 2014 18:11:26 +0000 (19:11 +0100)]
softmmu: move all load/store functions to cpu_ldst.h

Unify pieces of cpu-all.h, exec-all.h, softmmu_exec.h and tcg/tcg.h
into a single new header file with all helpers.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: introduce cpu_ldst.h
Paolo Bonzini [Fri, 28 Mar 2014 18:42:10 +0000 (19:42 +0100)]
softmmu: introduce cpu_ldst.h

This will collect all load and store helpers soon.  For now
it is just a replacement for softmmu_exec.h, which this patch
stops including directly, but we also include it where this will
be necessary in order to simplify the next patch.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-arm: move arm_*_code to a separate file
Paolo Bonzini [Fri, 28 Mar 2014 18:09:49 +0000 (19:09 +0100)]
target-arm: move arm_*_code to a separate file

These will soon require cpu_ldst.h, so move them out of cpu.h.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: move softmmu_template.h out of include/
Paolo Bonzini [Fri, 28 Mar 2014 17:00:25 +0000 (18:00 +0100)]
softmmu: move softmmu_template.h out of include/

It is only included in cputlb.c now.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: commonize helper definitions
Paolo Bonzini [Fri, 28 Mar 2014 16:55:24 +0000 (17:55 +0100)]
softmmu: commonize helper definitions

They do not need to be in op_helper.c.  Because cputlb.c now includes
softmmu_template.h twice for each size, io_readX must be elided the
second time through.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: move ALIGNED_ONLY to cpu.h
Paolo Bonzini [Fri, 28 Mar 2014 16:48:12 +0000 (17:48 +0100)]
softmmu: move ALIGNED_ONLY to cpu.h

Prepare for moving softmmu_header.h inclusion out of .c files

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: make do_unaligned_access a method of CPU
Paolo Bonzini [Fri, 28 Mar 2014 17:14:58 +0000 (18:14 +0100)]
softmmu: make do_unaligned_access a method of CPU

We will reference it from more files in the next patch.  To avoid
ruining the small steps we're making towards multi-target, make
it a method of CPU rather than just a global.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: move definition of CPU_MMU_INDEX to inclusion site, drop ACCESS_TYPE
Paolo Bonzini [Fri, 28 Mar 2014 10:19:35 +0000 (11:19 +0100)]
softmmu: move definition of CPU_MMU_INDEX to inclusion site, drop ACCESS_TYPE

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: move MMUSUFFIX under SOFTMMU_CODE_ACCESS
Paolo Bonzini [Fri, 28 Mar 2014 10:18:14 +0000 (11:18 +0100)]
softmmu: move MMUSUFFIX under SOFTMMU_CODE_ACCESS

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agosoftmmu: start introducing SOFTMMU_CODE_ACCESS in softmmu_header.h
Paolo Bonzini [Fri, 28 Mar 2014 10:15:30 +0000 (11:15 +0100)]
softmmu: start introducing SOFTMMU_CODE_ACCESS in softmmu_header.h

This preprocessor symbol is already used in softmmu_template.h.  We
will use it to distinguish the two "fake" ACCESS_TYPEs
NB_MMU_MODES and NB_MMU_MODES + 1.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agohw: use ld_p/st_p instead of ld_raw/st_raw
Paolo Bonzini [Fri, 28 Mar 2014 17:43:14 +0000 (18:43 +0100)]
hw: use ld_p/st_p instead of ld_raw/st_raw

The ld_raw and st_raw definitions are only needed in code that
must compile for both user-mode and softmmu emulation.  Device
models can use the equivalent ld_p/st_p which are simple
pointer accessors.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agonseries: clean up coding style
Paolo Bonzini [Mon, 12 May 2014 08:03:05 +0000 (10:03 +0200)]
nseries: clean up coding style

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agocputlb: Fix regression with TCG interpreter (bug 1310324)
Stefan Weil [Mon, 28 Apr 2014 17:20:00 +0000 (19:20 +0200)]
cputlb: Fix regression with TCG interpreter (bug 1310324)

Commit 0f842f8a246f2b5b51a11c13f933bf7a90ae8e96 replaced GETPC_EXT() which
was derived from GETPC() by GETRA_EXT() without fixing cputlb.c. A later
patch replaced GETRA_EXT() by GETRA() in exec/softmmu_template.h which
is included in cputlb.c.

The TCG interpreter failed because the values returned by GETRA() were no
longer explicitly set to 0. The redefinition of GETRA() introduced here
fixes this.

In addition, GETPC_ADJ which is also used in exec/softmmu_template.h is
set to 0. Both changes reduce the compiled code size for cputlb.c by more
than 100 bytes, so the normal TCG without interpreter also profits from
the reduced code size and slightly faster code.

Cc: qemu-stable@nongnu.org
Reported-by: Giovanni Mascellani <gio@debian.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoTCG: Fix tcg_gen_extr_i64_tl for 32bit
Alexander Graf [Wed, 4 Jun 2014 21:09:11 +0000 (23:09 +0200)]
TCG: Fix tcg_gen_extr_i64_tl for 32bit

We expose a generic helper "tcg_gen_extr_i64_tl" for 64bit targets, but the
same function for 32bit targets is a misnomer and refers to an invalid function
name.

Fix up the definition to point to the correct internal helper names instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Remove TCG_TARGET_HAS_new_ldst
Richard Henderson [Thu, 29 May 2014 20:57:57 +0000 (13:57 -0700)]
tcg: Remove TCG_TARGET_HAS_new_ldst

Since all backends have been converted, remove the compatibility code.

Acked-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotci: Convert to new ldst opcodes
Richard Henderson [Tue, 27 May 2014 03:59:16 +0000 (20:59 -0700)]
tci: Convert to new ldst opcodes

Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-i386: Fix win64 qemu store
Richard Henderson [Wed, 28 May 2014 21:01:44 +0000 (14:01 -0700)]
tcg-i386: Fix win64 qemu store

The first non-register argument isn't placed at offset 0.

Cc: qemu-stable@nongnu.org
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agokvm: Fix eax for cpuid leaf 0x40000000
Jidong Xiao [Wed, 4 Jun 2014 01:10:06 +0000 (21:10 -0400)]
kvm: Fix eax for cpuid leaf 0x40000000

Since Linux kernel 3.5, KVM has documented eax for leaf 0x40000000
to be KVM_CPUID_FEATURES:

https://github.com/torvalds/linux/commit/57c22e5f35aa4b9b2fe11f73f3e62bbf9ef36190

But qemu still tries to set it to 0. It would be better to make qemu
and kvm consistent. This patch just fixes this issue.

Signed-off-by: Jidong Xiao <jidong.xiao@gmail.com>
[Include kvm_base in the value. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agodocs/multiseat.txt: add note about spice
Gerd Hoffmann [Mon, 2 Jun 2014 13:48:41 +0000 (15:48 +0200)]
docs/multiseat.txt: add note about spice

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agodocs/multiseat.txt: gtk joined the party
Gerd Hoffmann [Mon, 2 Jun 2014 13:39:54 +0000 (15:39 +0200)]
docs/multiseat.txt: gtk joined the party

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agodocs/multiseat.txt: use autoseat
Gerd Hoffmann [Mon, 26 May 2014 07:52:48 +0000 (09:52 +0200)]
docs/multiseat.txt: use autoseat

When using the autoseat feature of systemd/logind we'll only need
a single udev rule for the pci bridge, which simplifies the guest
setup a bit.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput/vnc: use kbd delays in press_key
Gerd Hoffmann [Mon, 2 Jun 2014 11:15:05 +0000 (13:15 +0200)]
input/vnc: use kbd delays in press_key

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput/curses: add kbd delay between keydown and keyup events
Gerd Hoffmann [Wed, 28 May 2014 11:05:04 +0000 (13:05 +0200)]
input/curses: add kbd delay between keydown and keyup events

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: use kbd delays for send_key monitor command
Gerd Hoffmann [Wed, 28 May 2014 11:03:37 +0000 (13:03 +0200)]
input: use kbd delays for send_key monitor command

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add support for kbd delays
Gerd Hoffmann [Wed, 28 May 2014 11:02:40 +0000 (13:02 +0200)]
input: add support for kbd delays

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqga: Fix handle fd leak in acquire_privilege()
Gonglei [Mon, 19 May 2014 07:26:03 +0000 (15:26 +0800)]
qga: Fix handle fd leak in acquire_privilege()

token should be closed in all conditions.
So move CloseHandle(token) to "out" branch.

Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
10 years agokvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
Marcelo Tosatti [Tue, 3 Jun 2014 16:34:48 +0000 (13:34 -0300)]
kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation

Ensure proper env->tsc value for kvmclock_current_nsec calculation.

Reported-by: Marcin Gibuła <m.gibula@beyond.pl>
Cc: qemu-stable@nongnu.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: Enable -cpu option to hide KVM
Alex Williamson [Mon, 2 Jun 2014 17:28:50 +0000 (11:28 -0600)]
kvm: Enable -cpu option to hide KVM

The latest Nvidia driver (337.88) specifically checks for KVM as the
hypervisor and reports Code 43 for the driver in a Windows guest when
found.  Removing or changing the KVM signature is sufficient for the
driver to load and work.  This patch adds an option to easily allow
the KVM hypervisor signature to be hidden using '-cpu kvm=off'.  We
continue to expose KVM via the cpuid value by default.  The state of
this option does not supercede or replace -enable-kvm or the accel=kvm
machine option.  This only changes the visibility of KVM to the guest
and paravirtual features specifically tied to the KVM cpuid.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0...
Peter Maydell [Tue, 3 Jun 2014 13:37:43 +0000 (14:37 +0100)]
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging

VFIO patches: realtek NIC quirk + SPAPR IOMMU AddressSpace support

# gpg: Signature made Mon 02 Jun 2014 22:44:42 BST using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

* remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0:
  vfio: Add guest side IOMMU support
  vfio: Create VFIOAddressSpace objects as needed
  vfio: Introduce VFIO address spaces
  vfio: Rework to have error paths
  vfio: Fix 128 bit handling
  int128: Add int128_exts64()
  memory: Sanity check that no listeners remain on a destroyed AddressSpace
  vfio-pci: Quirk RTL8168 NIC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-roms-3' into staging
Peter Maydell [Tue, 3 Jun 2014 10:59:48 +0000 (11:59 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-3' into staging

seabios: update to 1.7.5 final

# gpg: Signature made Mon 02 Jun 2014 15:49:59 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-roms-3:
  seabios: update to 1.7.5 final

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-8' into staging
Peter Maydell [Mon, 2 Jun 2014 16:07:21 +0000 (17:07 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-8' into staging

qtest: improve ehci/uhci test
usb: misc fixes, mostly for usb3/xhci

# gpg: Signature made Mon 02 Jun 2014 15:40:34 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-usb-8:
  xhci: order superspeed ports first
  xhci: make port reset trace point more verbose
  usb: add usb_pick_speed
  usb-host: add HAVE_STREAMS define
  usb-host: allow attaching usb3 devices to ehci
  usb: improve ehci/uhci test
  usb: move ehci register defines to header file
  usb: add uhci port status reserved bit
  usb: move uhci register defines to header file
  qtest: fix qpci_config_writel

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into staging
Peter Maydell [Mon, 2 Jun 2014 15:10:12 +0000 (16:10 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-3' into staging

sdl2: add support for text consoles

# gpg: Signature made Mon 02 Jun 2014 15:35:20 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-sdl-3:
  sdl2: textinput + terminal
  sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
  console: add kbd_put_string_console
  console: add kbd_put_qcode_console

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoseabios: update to 1.7.5 final
Gerd Hoffmann [Mon, 2 Jun 2014 14:49:00 +0000 (16:49 +0200)]
seabios: update to 1.7.5 final

git shortlog since -rc1:

Gerd Hoffmann (2):
      acpi: remove PORT_ACPI_PM_BASE constant
      Allow using full io region on q35.

Kevin O'Connor (2):
      vgabios: Add debug message if x86emu leal check triggers.
      python3 fixes for vgabios and csm builds.

Paolo Bonzini (1):
      smm: remove code to handle ACPI disable/enable

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-3' into staging
Peter Maydell [Mon, 2 Jun 2014 14:47:40 +0000 (15:47 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-3' into staging

misc minor vnc patches

# gpg: Signature made Mon 02 Jun 2014 15:31:53 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vnc-3:
  vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}
  vnc: add trace events for key events
  vnc: refuse to set a password with VNC_AUTH_NONE

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoxhci: order superspeed ports first
Gerd Hoffmann [Thu, 15 May 2014 10:42:16 +0000 (12:42 +0200)]
xhci: order superspeed ports first

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}
Gonglei [Wed, 28 May 2014 13:21:35 +0000 (21:21 +0800)]
vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16,24,32}

Spotted by Coverity:

(1) Event assignment:  Assigning: "pixels" = "0".
(2) Event cond_true:  Condition "y < h", taking true branch
(3) Event cond_false:  Condition "x < w", taking false branch
(4) Event loop_end:  Reached end of loop
(5) Event divide_by_zero:  In expression "(stats[0] + stats[1]) * 100U / pixels",
division by expression "pixels" which may be zero has undefined behavior.

290     DEFINE_DETECT_FUNCTION(16)
291     DEFINE_DETECT_FUNCTION(32)

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc: add trace events for key events
Gerd Hoffmann [Wed, 21 May 2014 11:18:20 +0000 (13:18 +0200)]
vnc: add trace events for key events

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agovnc: refuse to set a password with VNC_AUTH_NONE
Gerd Hoffmann [Wed, 11 Dec 2013 12:15:37 +0000 (13:15 +0100)]
vnc: refuse to set a password with VNC_AUTH_NONE

Current code silently changes the authentication settings
in case you try to set a password without password authentication
turned on.  This is bad.  Return an error instead.

If we want allow changing auth settings at runtime this should
be done explicitly using a separate monitor command, not as
side effect of set_passwd.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: make port reset trace point more verbose
Gerd Hoffmann [Fri, 23 May 2014 13:44:42 +0000 (15:44 +0200)]
xhci: make port reset trace point more verbose

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add usb_pick_speed
Gerd Hoffmann [Fri, 23 May 2014 14:20:54 +0000 (16:20 +0200)]
usb: add usb_pick_speed

We can pick the usb port speed in generic code, by looking at the port
and device speed masks and looking for the fastest match.  So add a
function to do exactly that, and drop the speed setting code from
usb_desc_attach as it isn't needed any more.

This way we can set the device speed before calling port->ops->attach,
which fixes some xhci hotplug issues.

https://bugzilla.redhat.com/show_bug.cgi?id=1046873

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb-host: add HAVE_STREAMS define
Gerd Hoffmann [Fri, 23 May 2014 09:26:52 +0000 (11:26 +0200)]
usb-host: add HAVE_STREAMS define

10 years agousb-host: allow attaching usb3 devices to ehci
Gerd Hoffmann [Fri, 23 May 2014 08:27:00 +0000 (10:27 +0200)]
usb-host: allow attaching usb3 devices to ehci

Extend compatibility test function to also figure whenever usb3
devices can be supported on ehci.  Tweak ep0 maxpacketsize field
due to usb2 <-> usb3 difference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: improve ehci/uhci test
Gerd Hoffmann [Wed, 7 May 2014 14:39:11 +0000 (16:39 +0200)]
usb: improve ehci/uhci test

 * Attach usb devices to the bus.
 * Check initial port status register state.
 * Flip ehci initialization bit.
 * Check port status register state again to
   see whenever device handover to ehci worked.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move ehci register defines to header file
Gerd Hoffmann [Thu, 8 May 2014 10:15:23 +0000 (12:15 +0200)]
usb: move ehci register defines to header file

So we can easily use them in tests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add uhci port status reserved bit
Gerd Hoffmann [Thu, 8 May 2014 09:42:53 +0000 (11:42 +0200)]
usb: add uhci port status reserved bit

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move uhci register defines to header file
Gerd Hoffmann [Thu, 8 May 2014 08:58:44 +0000 (10:58 +0200)]
usb: move uhci register defines to header file

So we can easily use them in tests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqtest: fix qpci_config_writel
Gerd Hoffmann [Thu, 8 May 2014 08:54:33 +0000 (10:54 +0200)]
qtest: fix qpci_config_writel

Found by Paolo.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl2: textinput + terminal
Gerd Hoffmann [Mon, 26 May 2014 12:05:51 +0000 (14:05 +0200)]
sdl2: textinput + terminal

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows
Gerd Hoffmann [Tue, 27 May 2014 07:44:39 +0000 (09:44 +0200)]
sdl2: make Ctrl-Alt-<nr> hotkeys show and hide windows

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoconsole: add kbd_put_string_console
Gerd Hoffmann [Tue, 27 May 2014 07:32:36 +0000 (09:32 +0200)]
console: add kbd_put_string_console

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoconsole: add kbd_put_qcode_console
Gerd Hoffmann [Tue, 27 May 2014 07:28:38 +0000 (09:28 +0200)]
console: add kbd_put_qcode_console

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Mon, 2 Jun 2014 14:27:18 +0000 (15:27 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches

# gpg: Signature made Mon 02 Jun 2014 14:56:00 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  qemu-img: Report error even with --oformat=json
  vmdk: Fix local_err in vmdk_create
  block/raw-posix.c: Avoid nonstandard LONG_LONG_MAX
  qemu-img: Plug memory leak in convert command
  block/sheepdog: Plug memory leak in sd_snapshot_create()
  block/vvfat: Plug memory leak in read_directory()
  block/vvfat: Plug memory leak in check_directory_consistency()
  block/qapi: Plug memory leak in dump_qobject() case QTYPE_QERROR
  blockdev: Plug memory leak in drive_init()
  blockdev: Plug memory leak in blockdev_init()
  qemu-io: Don't print NULL when open without non-option arg fails
  qemu-io: Plug memory leak in open command
  qemu-io: Support multiple -o in open command
  block: Plug memory leak on brv_open_image() error path
  qcow2: Plug memory leak on qcow2_invalidate_cache() error paths
  block/vvfat: Plug memory leak in enable_write_target()
  qemu-img: Plug memory leak on block option help error path

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoRevert "bsd-user: replace fprintf(stderr, ...) with error_report()"
Peter Maydell [Mon, 2 Jun 2014 12:24:37 +0000 (13:24 +0100)]
Revert "bsd-user: replace fprintf(stderr, ...) with error_report()"

This reverts commit 1fba509527beb74bdcf50bc07ad3cd8244ad9c61.

That commit converted various fprintf(stderr, ...) calls to
use error_report(); however none of these bsd-user files include
a header which gives a prototype for error_report, so this
causes compiler warnings. Since these are just straightforward
reporting of command line errors, we should handle these in the
obvious way by printing to stderr, as we do for linux-user.
There's no need to drag in the error-handling framework for this,
especially since user-mode doesn't have the "maybe we need to
send this to the monitor" issues system emulation does.

Acked-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoqemu-img: Report error even with --oformat=json
Max Reitz [Sat, 31 May 2014 19:33:30 +0000 (21:33 +0200)]
qemu-img: Report error even with --oformat=json

img_check() should report that the format of the given image does not
support checks even if JSON output is desired. JSON data is output to
stdout, as opposed to error messages, which are (in the case of
qemu-img) printed to stderr. Therefore, it is easy to distinguish
between the two.

Also, img_info() does already use error_report() for human-readable
messages even though JSON output is desired (through
collect_image_info_list()).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agokvm: Ensure negative return value on kvm_init() error handling path
Eduardo Habkost [Fri, 30 May 2014 20:26:22 +0000 (17:26 -0300)]
kvm: Ensure negative return value on kvm_init() error handling path

We need to ensure ret < 0 when going through the error path, or QEMU may
try to run the half-initialized VM and crash.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>