]> Git Repo - qemu.git/log
qemu.git
5 years agoqmp: forbid qmp_cont in RUN_STATE_FINISH_MIGRATE
Vladimir Sementsov-Ogievskiy [Thu, 24 Jan 2019 12:25:24 +0000 (15:25 +0300)]
qmp: forbid qmp_cont in RUN_STATE_FINISH_MIGRATE

qmp_cont in RUN_STATE_FINISH_MIGRATE may lead to moving vm to
RUN_STATE_RUNNING, before actual migration finish. So, when migration
thread will try to go to RUN_STATE_POSTMIGRATE, assuming transition
RUN_STATE_FINISH_MIGRATE->RUN_STATE_POSTMIGRATE, it will crash, as
current state is RUN_STATE_RUNNING, and transition
RUN_STATE_RUNNING->RUN_STATE_POSTMIGRATE is forbidden.

Reported-by: Max Reitz <[email protected]>
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Use BDRV_REQUEST_MAX_BYTES instead of BDRV_REQUEST_MAX_SECTORS
Alberto Garcia [Tue, 14 May 2019 13:57:35 +0000 (16:57 +0300)]
block: Use BDRV_REQUEST_MAX_BYTES instead of BDRV_REQUEST_MAX_SECTORS

There are a few places in which we turn a number of bytes into sectors
in order to compare the result against BDRV_REQUEST_MAX_SECTORS
instead of using BDRV_REQUEST_MAX_BYTES directly.

Signed-off-by: Alberto Garcia <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoqcow2: Define and use QCOW2_COMPRESSED_SECTOR_SIZE
Alberto Garcia [Fri, 10 May 2019 16:22:54 +0000 (19:22 +0300)]
qcow2: Define and use QCOW2_COMPRESSED_SECTOR_SIZE

When an L2 table entry points to a compressed cluster the space used
by the data is specified in 512-byte sectors. This size is independent
from BDRV_SECTOR_SIZE and is specific to the qcow2 file format.

The QCOW2_COMPRESSED_SECTOR_SIZE constant defined in this patch makes
this explicit.

Signed-off-by: Alberto Garcia <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock/file-posix: Truncate in xfs_write_zeroes()
Max Reitz [Fri, 10 May 2019 21:12:44 +0000 (23:12 +0200)]
block/file-posix: Truncate in xfs_write_zeroes()

XFS_IOC_ZERO_RANGE does not increase the file length:
$ touch foo
$ xfs_io -c 'zero 0 65536' foo
$ stat -c "size=%s, blocks=%b" foo
size=0, blocks=128

We do want writes beyond the EOF to automatically increase the file
length, however.  This is evidenced by the fact that iotest 061 is
broken on XFS since qcow2's check implementation checks for blocks
beyond the EOF.

Reported-by: Kevin Wolf <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-axp-20190519' into staging
Peter Maydell [Mon, 20 May 2019 10:38:36 +0000 (11:38 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20190519' into staging

Fix https://bugs.launchpad.net/bugs/1701835

# gpg: Signature made Sun 19 May 2019 15:31:37 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Richard Henderson <[email protected]>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-axp-20190519:
  target/alpha: Fix user-only floating-point exceptions
  target/alpha: Clean up alpha_cpu_dump_state

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
Peter Maydell [Mon, 20 May 2019 09:51:42 +0000 (10:51 +0100)]
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

This fixes the virtfs documentation (LP 1581976), deprecates the
-virtfs_synth command line option, along with some assorted cleanups.

# gpg: Signature made Fri 17 May 2019 19:29:40 BST
# gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <[email protected]>" [full]
# gpg:                 aka "Gregory Kurz <[email protected]>" [full]
# gpg:                 aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz/tags/for-upstream:
  virtfs: Fix documentation of -fsdev and -virtfs
  vl: Deprecate -virtfs_synth
  fsdev: Error out when unsupported option is passed
  fsdev: Move some types definition to qemu-fsdev.c
  fsdev: Drop unused opaque field
  fsdev: Drop unused extern declaration

Signed-off-by: Peter Maydell <[email protected]>
# Conflicts:
# qemu-deprecated.texi

5 years agotarget/alpha: Fix user-only floating-point exceptions
Richard Henderson [Fri, 26 Apr 2019 22:20:51 +0000 (15:20 -0700)]
target/alpha: Fix user-only floating-point exceptions

Record the software fp control register, as set by the
osf_setsysinfo syscall.  Add those masked exceptions
to fpcr_exc_enable.  Do not raise a signal for masked
fp exceptions.

Fixes: https://bugs.launchpad.net/bugs/1701835
Signed-off-by: Richard Henderson <[email protected]>
5 years agotarget/alpha: Clean up alpha_cpu_dump_state
Richard Henderson [Fri, 26 Apr 2019 20:33:13 +0000 (13:33 -0700)]
target/alpha: Clean up alpha_cpu_dump_state

Drop the "RI" and "FIR" prefixes; use only the normal linux names.
Add the FPCR to the dump.

Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into...
Peter Maydell [Fri, 17 May 2019 16:25:19 +0000 (17:25 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into staging

ui: bugfixes for curses, opengl console and kbd state tracker.

# gpg: Signature made Fri 17 May 2019 17:12:30 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20190517-pull-request:
  kbd-state: fix autorepeat handling
  ui/console: Precautionary glBindTexture and surface->texture validation in surface_gl_update_texture
  ui/curses: manipulate cchar_t with standard curses functions
  ui/curses: do not assume wchar_t contains unicode

Signed-off-by: Peter Maydell <[email protected]>
5 years agovirtfs: Fix documentation of -fsdev and -virtfs
Greg Kurz [Fri, 17 May 2019 15:34:49 +0000 (17:34 +0200)]
virtfs: Fix documentation of -fsdev and -virtfs

This fixes several things:
- add "id" description to -virtfs documentation
- split the description into several lines in both usage and documentation
  for accurateness and clarity
- add documentation and usage of the synth fsdriver
- add "throttling.*" description to -fsdev local
- add some missing periods
- add proper reference to the virtfs-proxy-helper(1) manual page
- document that the virtio device may be either virtio-9p-pci, virtio-9p-ccw
  or virtio-9p-device, depending on the machine type

Buglink: https://bugs.launchpad.net/qemu/+bug/1581976
Signed-off-by: Greg Kurz <[email protected]>
Acked-by: Thomas Huth <[email protected]>
5 years agovl: Deprecate -virtfs_synth
Greg Kurz [Fri, 17 May 2019 15:34:48 +0000 (17:34 +0200)]
vl: Deprecate -virtfs_synth

The synth fsdriver never got used for anything else but the QTest
testcase for VirtIO 9P. And even there, QTest uses -fsdev synth and
-device virtio-9p-... directly.

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
5 years agofsdev: Error out when unsupported option is passed
Greg Kurz [Fri, 17 May 2019 15:34:48 +0000 (17:34 +0200)]
fsdev: Error out when unsupported option is passed

Each fsdriver only supports a subset of the options that can be passed
to -fsdev. Unsupported options are simply ignored. This could cause the
user to erroneously think QEMU has a bug.

Enforce strict checking of supported options for all fsdrivers. This
shouldn't impact libvirt, since it doesn't know about the synth and
proxy fsdrivers.

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
5 years agofsdev: Move some types definition to qemu-fsdev.c
Greg Kurz [Fri, 17 May 2019 15:34:48 +0000 (17:34 +0200)]
fsdev: Move some types definition to qemu-fsdev.c

It would make sense for these types to be defined in a header file if
we had an API for fsdrivers to register themselves. In practice, we
only have three of them and it is very unlikely we add new ones since
the future of file sharing between host and guest is the upcoming
virtio-fs.

Move the types to qemu-fsdev.c instead since they are only used there.

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
5 years agofsdev: Drop unused opaque field
Greg Kurz [Fri, 17 May 2019 15:34:48 +0000 (17:34 +0200)]
fsdev: Drop unused opaque field

This was introduced along with -fsdev but it never got used.

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
5 years agofsdev: Drop unused extern declaration
Greg Kurz [Fri, 17 May 2019 15:34:48 +0000 (17:34 +0200)]
fsdev: Drop unused extern declaration

This is a leftover of the handle backend, removed in QEMU 4.0.

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Fri, 17 May 2019 15:17:34 +0000 (16:17 +0100)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

Mostly bugfixes and cleanups, the most important being
"megasas: fix mapped frame size" from Peter Lieven.
In addition, -realtime is marked as deprecated.

# gpg: Signature made Fri 17 May 2019 14:25:11 BST
# gpg:                using RSA key BFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <[email protected]>" [full]
# gpg:                 aka "Paolo Bonzini <[email protected]>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (21 commits)
  hw/net/ne2000: Extract the PCI device from the chipset common code
  hw/char: Move multi-serial devices into separate file
  ioapic: allow buggy guests mishandling level-triggered interrupts to make progress
  build: don't build hardware objects with linux-user
  build: chardev is only needed for softmmu targets
  configure: qemu-ga is only needed with softmmu targets
  build: replace GENERATED_FILES by generated-files-y
  trace: only include trace-event-subdirs when they are needed
  sun4m: obey -vga none
  mips-fulong2e: obey -vga none
  hw/i386/acpi: Assert a pointer is not null BEFORE using it
  hw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity
  hw/acpi/piix4: Move TYPE_PIIX4_PM to a public header
  memory: correct the comment to DIRTY_MEMORY_MIGRATION
  vl: fix -sandbox parsing crash when seccomp support is disabled
  hvf: Add missing break statement
  megasas: fix mapped frame size
  vl: Add missing descriptions to the VGA adapters list
  Declare -realtime as deprecated
  roms: assert if max rom size is less than the used size
  ...

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20190517' into staging
Peter Maydell [Fri, 17 May 2019 14:46:37 +0000 (15:46 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20190517' into staging

qemu-sparc queue

# gpg: Signature made Fri 17 May 2019 10:30:54 BST
# gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Mark Cave-Ayland <[email protected]>" [full]
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-20190517:
  MAINTAINERS: add myself for leon3
  leon3: introduce the plug and play mechanism
  leon3: add a little bootloader
  grlib, apbuart: get rid of the old-style create function
  grlib, gptimer: get rid of the old-style create function
  grlib, irqmp: get rid of the old-style create function
  leon3: fix the error message when no bios are provided
  hw/char/escc: Lower irq when transmit buffer is filled

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge tag 's390x-tcg-2019-05-17-2' into s390-next-staging
Cornelia Huck [Fri, 17 May 2019 13:40:06 +0000 (15:40 +0200)]
Merge tag 's390x-tcg-2019-05-17-2' into s390-next-staging

Implement all Vector Integer Instructions introduced with the
"Vector Facility" for s390x TCG.

# gpg: Signature made Fri 17 May 2019 01:37:40 PM CEST
# gpg:                using RSA key 4DDE10F700FF835A
# gpg: Good signature from "David Hildenbrand <[email protected]>" [full]
# gpg:                 aka "David Hildenbrand <[email protected]>" [full]

* tag 's390x-tcg-2019-05-17-2': (40 commits)
  s390x/tcg: Implement VECTOR TEST UNDER MASK
  s390x/tcg: Implement VECTOR SUM ACROSS WORD
  s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD
  s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD
  s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION
  s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION
  s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION
  s390x/tcg: Implement VECTOR SUBTRACT
  s390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *
  s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC
  s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE
  s390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE)
  s390x/tcg: Implement VECTOR ELEMENT SHIFT
  s390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK
  s390x/tcg: Implement VECTOR ELEMENT ROTATE LEFT LOGICAL
  s390x/tcg: Implement VECTOR POPULATION COUNT
  s390x/tcg: Implement VECTOR OR WITH COMPLEMENT
  s390x/tcg: Implement VECTOR OR
  s390x/tcg: Implement VECTOR NOT EXCLUSIVE OR
  s390x/tcg: Implement VECTOR NOR
  ...

Signed-off-by: Cornelia Huck <[email protected]>
5 years agohw/net/ne2000: Extract the PCI device from the chipset common code
Philippe Mathieu-Daudé [Sat, 4 May 2019 12:35:38 +0000 (14:35 +0200)]
hw/net/ne2000: Extract the PCI device from the chipset common code

The ne2000.c file contains functions common the the ISA and PCI
devices. To allow to build with one or another, extract the PCI
specific part into a new file.

This fix an issue where the NE2000_ISA Kconfig had to pull the
full PCI core objects.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190504123538[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agohw/char: Move multi-serial devices into separate file
Thomas Huth [Sun, 31 Mar 2019 12:40:28 +0000 (14:40 +0200)]
hw/char: Move multi-serial devices into separate file

In our downstream distribution of QEMU, we'd like to ship the binary
without the multi-serial PCI devices. To make this disablement easier,
let's move the devices into a separate file and add a proper Kconfig-
switch for these devices.

Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1554036028[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agoioapic: allow buggy guests mishandling level-triggered interrupts to make progress
Vitaly Kuznetsov [Tue, 2 Apr 2019 08:02:15 +0000 (10:02 +0200)]
ioapic: allow buggy guests mishandling level-triggered interrupts to make progress

It was found that Hyper-V 2016 on KVM in some configurations (q35 machine +
piix4-usb-uhci) hangs on boot. Root-cause was that one of Hyper-V
level-triggered interrupt handler performs EOI before fixing the cause of
the interrupt. This results in IOAPIC keep re-raising the level-triggered
interrupt after EOI because irq-line remains asserted.

Gory details: https://www.spinics.net/lists/kvm/msg184484.html
(the whole thread).

Turns out we were dealing with similar issues before; in-kernel IOAPIC
implementation has commit 184564efae4d ("kvm: ioapic: conditionally delay
irq delivery duringeoi broadcast") which describes a very similar issue.

Steal the idea from the above mentioned commit for IOAPIC implementation in
QEMU. SUCCESSIVE_IRQ_MAX_COUNT, delay and the comment are borrowed as well.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20190402080215[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agobuild: don't build hardware objects with linux-user
Laurent Vivier [Mon, 1 Apr 2019 14:12:22 +0000 (16:12 +0200)]
build: don't build hardware objects with linux-user

Some objects are only needed for system emulation and tools.
We can ignore them for the user mode case

Update tests to run accordingly: conditionally build some tests
on CONFIG_BLOCK.

Some tests use components that are only built when softmmu or
block tools are enabled, not for linux-user. So, if these components
are not available, disable the tests.

Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20190401141222[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agobuild: chardev is only needed for softmmu targets
Laurent Vivier [Mon, 1 Apr 2019 14:12:21 +0000 (16:12 +0200)]
build: chardev is only needed for softmmu targets

Move the dependency from SUBDIR_RULES to SOFTMMU_SUBDIR_RULES

Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20190401141222[email protected]>

5 years agoconfigure: qemu-ga is only needed with softmmu targets
Laurent Vivier [Mon, 1 Apr 2019 14:12:20 +0000 (16:12 +0200)]
configure: qemu-ga is only needed with softmmu targets

Remove it from the list of tools if --disable-system
and --disable-tools are used as we don't need it for
linux-user targets.

Suggested-by: Paolo Bonzini <[email protected]>
[lv: I also disable it with disable-tools, not only with disable-system]
Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20190401141222[email protected]>

5 years agobuild: replace GENERATED_FILES by generated-files-y
Laurent Vivier [Mon, 1 Apr 2019 14:12:19 +0000 (16:12 +0200)]
build: replace GENERATED_FILES by generated-files-y

When possible use generated-files-$(FLAG) to disable
some targets (like KEYCODEMAP_FILES).

Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
Message-Id: <20190401141222[email protected]>

5 years agotrace: only include trace-event-subdirs when they are needed
Laurent Vivier [Mon, 1 Apr 2019 14:12:18 +0000 (16:12 +0200)]
trace: only include trace-event-subdirs when they are needed

Some directories are built only for softmmu targets,
and the related trace-event-subdirs must do the same

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-Id: <20190401141222[email protected]>

5 years agosun4m: obey -vga none
Paolo Bonzini [Tue, 19 Mar 2019 14:37:47 +0000 (15:37 +0100)]
sun4m: obey -vga none

Do not create a TCX if "-vga none" was passed on the command line.
Remove some dead code along the way to avoid big reindentation.

Signed-off-by: Paolo Bonzini <[email protected]>
5 years agomips-fulong2e: obey -vga none
Paolo Bonzini [Tue, 19 Mar 2019 14:37:19 +0000 (15:37 +0100)]
mips-fulong2e: obey -vga none

Do not create an ATI VGA if "-vga none" was passed on the command line.

Cc: BALATON Zoltan <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agohw/i386/acpi: Assert a pointer is not null BEFORE using it
Philippe Mathieu-Daudé [Sat, 27 Apr 2019 14:40:25 +0000 (16:40 +0200)]
hw/i386/acpi: Assert a pointer is not null BEFORE using it

Commit 72c194f7e75c added a non-null check on the 'obj' pointer.
Later, commit 500b11ea5095 added code which uses the 'obj'
pointer _before_ the assertion check. Move the assertion
_before_ the pointer use.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190427144025[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agohw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity
Philippe Mathieu-Daudé [Sat, 27 Apr 2019 14:40:24 +0000 (16:40 +0200)]
hw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity

When building with CONFIG_Q35=n, we get:

    LINK    x86_64-softmmu/qemu-system-x86_64
  /usr/bin/ld: hw/i386/acpi-build.o: in function `acpi_get_misc_info':
  /source/qemu/hw/i386/acpi-build.c:243: undefined reference to `ich9_lpc_find'
  collect2: error: ld returned 1 exit status
  make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1

This is due to a dependency in acpi-build.c on the ICH9_LPC
(via ich9_lpc_find) and PIIX4_PM (via piix4_pm_find) devices.

To allow better modularity (compile acpi-build.c with only
Q35/ICH9 or ISAPC/PIIX4), refactor the similar helper as
object_resolve_type_unambiguous(). This way we relax the
linker dependencies and can build the x86 targets with a
selection of machines (instead of all of them).

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190427144025[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agohw/acpi/piix4: Move TYPE_PIIX4_PM to a public header
Philippe Mathieu-Daudé [Sat, 27 Apr 2019 14:40:23 +0000 (16:40 +0200)]
hw/acpi/piix4: Move TYPE_PIIX4_PM to a public header

Move the TYPE_PIIX4_PM definition to the corresponding header,
so other files can use it.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190427144025[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agokbd-state: fix autorepeat handling
Gerd Hoffmann [Tue, 14 May 2019 04:24:43 +0000 (06:24 +0200)]
kbd-state: fix autorepeat handling

When allowing multiple down-events in a row (key autorepeat) we can't
use change_bit() any more to update the state, because autorepeat events
don't change the key state.  We have to explicitly use set_bit() and
clear_bit() instead.

Cc: [email protected]
Fixes: 35921860156e kbd-state: don't block auto-repeat events
Buglink: https://bugs.launchpad.net/qemu/+bug/1828272
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20190514042443[email protected]

5 years agoui/console: Precautionary glBindTexture and surface->texture validation in surface_gl...
HOU Qiming [Tue, 7 May 2019 08:05:01 +0000 (11:05 +0300)]
ui/console: Precautionary glBindTexture and surface->texture validation in surface_gl_update_texture

In a GVT-g setup with dmabuf and GTK GUI, the current 2D texture at
surface_gl_update_texture is not necessarily
surface->texture. Adding a glBindTexture fixes related crashes and
artifacts, and is generally more secure.

Signed-off-by: HOU Qiming <[email protected]>
Tested-by: Marcel Apfelbaum<[email protected]>
Signed-off-by: Marcel Apfelbaum <[email protected]>
Message-id: 20190507080501[email protected]
[fixed malformed patch, rebase to master]
Signed-off-by: Marcel Apfelbaum <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
5 years agoui/curses: manipulate cchar_t with standard curses functions
Samuel Thibault [Sat, 27 Apr 2019 18:33:07 +0000 (20:33 +0200)]
ui/curses: manipulate cchar_t with standard curses functions

The chars/attr fields are curses internals, setcchar and getcchar have
to be used instead.

Signed-off-by: Samuel Thibault <[email protected]>
Tested-by: Kamil Rytarowski <[email protected]>
Message-Id: <20190427183307[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
5 years agoui/curses: do not assume wchar_t contains unicode
Samuel Thibault [Sat, 27 Apr 2019 18:33:06 +0000 (20:33 +0200)]
ui/curses: do not assume wchar_t contains unicode

E.g. BSD and Solaris even use locale-specific encoding there.

We thus have to go through the native multibyte representation and use
mbrtowc/wcrtomb to make a proper conversion.

Signed-off-by: Samuel Thibault <[email protected]>
Tested-by: Kamil Rytarowski <[email protected]>
Message-Id: <20190427183307[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Peter Maydell [Fri, 17 May 2019 10:40:23 +0000 (11:40 +0100)]
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Fri 17 May 2019 10:01:18 BST
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <[email protected]>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net/colo-compare.c: Fix a crash in COLO Primary.
  net/slirp: fix the IPv6 prefix length error message
  e1000: Never increment the RX undersize count register
  vhost_net: don't set backend for the uninitialized virtqueue

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/vivier/tags/m68k-staging-pull-request' into...
Peter Maydell [Fri, 17 May 2019 09:28:23 +0000 (10:28 +0100)]
Merge remote-tracking branch 'remotes/vivier/tags/m68k-staging-pull-request' into staging

code cleanup, switch to transaction_failed hook

# gpg: Signature made Thu 16 May 2019 23:33:00 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/m68k-staging-pull-request:
  target/m68k: Optimize rotate_x() using extract_i32()
  target/m68k: Fix a tcg_temp leak
  target/m68k: Reduce the l1 TCGLabel scope
  target/m68k: Switch to transaction_failed hook
  target/m68k: In get_physical_address() check for memory access failures
  target/m68k: In dump_address_map() check for memory access failures

Signed-off-by: Peter Maydell <[email protected]>
# Conflicts:
# target/m68k/cpu.h

5 years agonet/colo-compare.c: Fix a crash in COLO Primary.
Lukas Straub [Sat, 20 Apr 2019 17:14:25 +0000 (19:14 +0200)]
net/colo-compare.c: Fix a crash in COLO Primary.

Because event_unhandled_count may be accessed concurrently, it needs
to be protected by taking the lock. However the assert is outside the
lock, probably causing it to read garbage and aborting Qemu erroneously.

The Bug only happens when running Qemu in COLO mode.

This Patch fixes the following bug: https://bugs.launchpad.net/qemu/+bug/1824622

Signed-off-by: Lukas Straub <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Zhang Chen <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
5 years agonet/slirp: fix the IPv6 prefix length error message
Stefano Garzarella [Wed, 15 May 2019 09:08:05 +0000 (11:08 +0200)]
net/slirp: fix the IPv6 prefix length error message

Reword and add a missing parentheses at the end of the
error message.

Signed-off-by: Stefano Garzarella <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
5 years agoe1000: Never increment the RX undersize count register
Chris Kenna [Thu, 4 Apr 2019 15:21:26 +0000 (10:21 -0500)]
e1000: Never increment the RX undersize count register

In situations where e1000 receives an undersized Ethernet frame,
QEMU increments the emulated "Receive Undersize Count (RUC)"
register when padding the frame.

This is incorrect because this an expected scenario (e.g. with
VLAN tag stripping) and not an error. As such, QEMU should not
increment the emulated RUC.

Fixes: 3b2743017749 ("e1000: Implementing various counters")
Reviewed-by: Mark Kanda <[email protected]>
Reviewed-by: Bhavesh Davda <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Signed-off-by: Chris Kenna <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
5 years agovhost_net: don't set backend for the uninitialized virtqueue
Jason Wang [Mon, 25 Mar 2019 03:40:36 +0000 (11:40 +0800)]
vhost_net: don't set backend for the uninitialized virtqueue

We used to set backend unconditionally, this won't work for some
guests (e.g windows driver) who may not initialize all virtqueues. For
kernel backend, this will fail since it may try to validate the rings
during setting backend.

Fixing this by simply skipping the backend set when we find desc is
not ready.

Reviewed-by: Michael S. Tsirkin<[email protected]>
Signed-off-by: Jason Wang <[email protected]>
5 years agos390x/tcg: Implement VECTOR TEST UNDER MASK
David Hildenbrand [Wed, 10 Apr 2019 20:55:16 +0000 (22:55 +0200)]
s390x/tcg: Implement VECTOR TEST UNDER MASK

Let's return the cc value directly via cpu_env. Unfortunately there
isn't a simple way to calculate the value lazily - one would have to
calculate and store e.g. the population count of the mask and the
result so it can be evaluated in a cc helper.

But as VTM only sets the cc, we can assume the value will be needed soon
either way.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUM ACROSS WORD
David Hildenbrand [Wed, 10 Apr 2019 20:45:35 +0000 (22:45 +0200)]
s390x/tcg: Implement VECTOR SUM ACROSS WORD

Similar to VECTOR SUM ACROSS DOUBLEWORD.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUM ACROSS QUADWORD
David Hildenbrand [Wed, 10 Apr 2019 20:40:01 +0000 (22:40 +0200)]
s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD

Similar to VECTOR SUM ACROSS DOUBLEWORD, however without a loop and
using 128-bit calculations.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD
David Hildenbrand [Wed, 10 Apr 2019 20:48:25 +0000 (22:48 +0200)]
s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD

Perform the calculations without a helper. Only 16 bit or 32 bit values
have to be added.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION
David Hildenbrand [Tue, 9 Apr 2019 21:26:47 +0000 (23:26 +0200)]
s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION

Mostly courtesy of Richard H.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION
David Hildenbrand [Wed, 10 Apr 2019 20:15:07 +0000 (22:15 +0200)]
s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION

Fairly easy as only 128-bit handling is required. Simply perform the
subtraction and then subtract the borrow.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION
David Hildenbrand [Wed, 10 Apr 2019 20:22:36 +0000 (22:22 +0200)]
s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION

Let's keep it simple for now and handle 8/16 bit elements via helpers.
Especially for 8/16, we could come up with some bit tricks.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SUBTRACT
David Hildenbrand [Wed, 10 Apr 2019 19:37:24 +0000 (21:37 +0200)]
s390x/tcg: Implement VECTOR SUBTRACT

We can use tcg_gen_sub2_i64() to do 128-bit subtraction and otherwise
existing gvec helpers.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *
David Hildenbrand [Thu, 11 Apr 2019 09:42:34 +0000 (11:42 +0200)]
s390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *

Similar to VECTOR SHIFT RIGHT ARITHMETICAL.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC
David Hildenbrand [Thu, 11 Apr 2019 09:41:47 +0000 (11:41 +0200)]
s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC

Similar to VECTOR SHIFT LEFT ARITHMETIC. Add s390_vec_sar() similar to
s390_vec_shr().

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE
David Hildenbrand [Thu, 11 Apr 2019 09:39:23 +0000 (11:39 +0200)]
s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE

Inline expansion courtesy of Richard H.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE)
David Hildenbrand [Mon, 8 Apr 2019 20:50:06 +0000 (22:50 +0200)]
s390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE)

We can reuse the existing 128-bit shift utility function.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ELEMENT SHIFT
David Hildenbrand [Thu, 11 Apr 2019 09:59:30 +0000 (11:59 +0200)]
s390x/tcg: Implement VECTOR ELEMENT SHIFT

We can use all the fancy new vector helpers implemented by Richard.

One important thing to take care of is always to properly mask of
unused bits from the shift count.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK
David Hildenbrand [Thu, 11 Apr 2019 09:27:29 +0000 (11:27 +0200)]
s390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK

Use the new vector expansion for GVecGen3i.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ELEMENT ROTATE LEFT LOGICAL
David Hildenbrand [Thu, 11 Apr 2019 09:19:38 +0000 (11:19 +0200)]
s390x/tcg: Implement VECTOR ELEMENT ROTATE LEFT LOGICAL

Take care of properly taking the modulo of the count. We might later
want to come back and create a variant of VERLL where the base register
is 0, resulting in an immediate.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR POPULATION COUNT
David Hildenbrand [Thu, 11 Apr 2019 09:14:49 +0000 (11:14 +0200)]
s390x/tcg: Implement VECTOR POPULATION COUNT

Similar to VECTOR COUNT TRAILING ZEROES.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR OR WITH COMPLEMENT
David Hildenbrand [Thu, 11 Apr 2019 09:14:29 +0000 (11:14 +0200)]
s390x/tcg: Implement VECTOR OR WITH COMPLEMENT

Again, vector enhancements facility 1 material.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR OR
David Hildenbrand [Thu, 11 Apr 2019 09:12:42 +0000 (11:12 +0200)]
s390x/tcg: Implement VECTOR OR

Reuse a gvec helper.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR NOT EXCLUSIVE OR
David Hildenbrand [Thu, 11 Apr 2019 09:12:17 +0000 (11:12 +0200)]
s390x/tcg: Implement VECTOR NOT EXCLUSIVE OR

Again, part of vector enhancement facility 1. The operation corresponds
to an bitwise equality check.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR NOR
David Hildenbrand [Fri, 5 Apr 2019 13:52:09 +0000 (15:52 +0200)]
s390x/tcg: Implement VECTOR NOR

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR NAND
David Hildenbrand [Thu, 11 Apr 2019 09:00:30 +0000 (11:00 +0200)]
s390x/tcg: Implement VECTOR NAND

Part of vector enhancements facility 1, but easy to implement.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR MULTIPLY *
David Hildenbrand [Thu, 11 Apr 2019 09:58:46 +0000 (11:58 +0200)]
s390x/tcg: Implement VECTOR MULTIPLY *

Yet another set of variants. Implement it similar to VECTOR MULTIPLY AND
ADD *. At least for one variant we have a gvec helper we can reuse.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR MULTIPLY AND ADD *
David Hildenbrand [Thu, 11 Apr 2019 09:56:49 +0000 (11:56 +0200)]
s390x/tcg: Implement VECTOR MULTIPLY AND ADD *

Quite some variants to handle. At least handle some 32-bit element
variants via gvec expansion (we could also handle 16/32-bit variants
for ODD and EVEN easily via gvec expansion, but let's keep it simple
for now).

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR (MAXIMUM|MINIMUM) (LOGICAL)
David Hildenbrand [Thu, 11 Apr 2019 09:49:12 +0000 (11:49 +0200)]
s390x/tcg: Implement VECTOR (MAXIMUM|MINIMUM) (LOGICAL)

Luckily, we already have gvec helpers for all four cases.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR LOAD POSITIVE
David Hildenbrand [Thu, 11 Apr 2019 08:43:39 +0000 (10:43 +0200)]
s390x/tcg: Implement VECTOR LOAD POSITIVE

Similar to VECTOR LOAD COMPLEMENT.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR LOAD COMPLEMENT
David Hildenbrand [Thu, 11 Apr 2019 08:41:48 +0000 (10:41 +0200)]
s390x/tcg: Implement VECTOR LOAD COMPLEMENT

We can reuse an existing gvec helper for negating the values.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR GALOIS FIELD MULTIPLY SUM (AND ACCUMULATE)
David Hildenbrand [Thu, 11 Apr 2019 09:54:53 +0000 (11:54 +0200)]
s390x/tcg: Implement VECTOR GALOIS FIELD MULTIPLY SUM (AND ACCUMULATE)

A galois field multiplication in field 2 is like binary multiplication,
however instead of doing ordinary binary additions, xor's are performed.
So no carries are considered.

Implement all variants via helpers. s390_vec_sar() and s390_vec_shr()
will be reused later on.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR EXCLUSIVE OR
David Hildenbrand [Thu, 11 Apr 2019 08:07:35 +0000 (10:07 +0200)]
s390x/tcg: Implement VECTOR EXCLUSIVE OR

Easy, we can reuse an existing gvec helper.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR COUNT TRAILING ZEROS
David Hildenbrand [Thu, 21 Mar 2019 09:36:26 +0000 (10:36 +0100)]
s390x/tcg: Implement VECTOR COUNT TRAILING ZEROS

Implement it similar to VECTOR COUNT LEADING ZEROS.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR COUNT LEADING ZEROS
David Hildenbrand [Thu, 4 Apr 2019 12:37:17 +0000 (14:37 +0200)]
s390x/tcg: Implement VECTOR COUNT LEADING ZEROS

For 8/16, use the 32 bit variant and properly subtract the added
leading zero bits.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR COMPARE *
David Hildenbrand [Thu, 11 Apr 2019 08:00:25 +0000 (10:00 +0200)]
s390x/tcg: Implement VECTOR COMPARE *

To carry out the comparison, we can reuse the existing gvec comparison
function. In case the CC is to be computed, save the result vector
and compute the CC lazily. The result is a vector consisting of all 1's
for elements that matched and 0's for elements that didn't match.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ELEMENT COMPARE *
David Hildenbrand [Thu, 11 Apr 2019 07:50:42 +0000 (09:50 +0200)]
s390x/tcg: Implement VECTOR ELEMENT COMPARE *

Fairly easy to implement, we can make use of the existing CC helpers
cmps64 and cmpu64 - we siply have to sign extend the elements.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR CHECKSUM
David Hildenbrand [Wed, 20 Mar 2019 22:18:59 +0000 (23:18 +0100)]
s390x/tcg: Implement VECTOR CHECKSUM

Time to introduce read_vec_element_i32 and write_vec_element_i32.
Take proper care of properly adding the carry. We can perform both
additions including the carry via tcg_gen_add2_i32().

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR AVERAGE LOGICAL
David Hildenbrand [Thu, 11 Apr 2019 07:41:29 +0000 (09:41 +0200)]
s390x/tcg: Implement VECTOR AVERAGE LOGICAL

Similar to VECTOR AVERAGE but without sign extension.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR AVERAGE
David Hildenbrand [Thu, 11 Apr 2019 07:31:04 +0000 (09:31 +0200)]
s390x/tcg: Implement VECTOR AVERAGE

Handle 32/64-bit elements via gvec expansion and the 8/16 bits via
ool helpers.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR AND (WITH COMPLEMENT)
David Hildenbrand [Sun, 17 Mar 2019 23:04:51 +0000 (00:04 +0100)]
s390x/tcg: Implement VECTOR AND (WITH COMPLEMENT)

Easy, as we can reuse existing gvec helpers.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ADD WITH CARRY COMPUTE CARRY
David Hildenbrand [Wed, 10 Apr 2019 21:25:46 +0000 (23:25 +0200)]
s390x/tcg: Implement VECTOR ADD WITH CARRY COMPUTE CARRY

Similar to VECTOR ADD COMPUTE CARRY, however 128-bit handling only.
Courtesy of Richard H.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ADD WITH CARRY
David Hildenbrand [Wed, 10 Apr 2019 21:22:57 +0000 (23:22 +0200)]
s390x/tcg: Implement VECTOR ADD WITH CARRY

Only slightly ugly, perform two additions. At least it is only supported
for 128 bit elements.

Introduce gen_gvec128_4_i64() similar to gen_gvec128_3_i64().

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ADD COMPUTE CARRY
David Hildenbrand [Wed, 10 Apr 2019 21:15:30 +0000 (23:15 +0200)]
s390x/tcg: Implement VECTOR ADD COMPUTE CARRY

128-bit handling courtesy of Richard H.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agos390x/tcg: Implement VECTOR ADD
David Hildenbrand [Wed, 10 Apr 2019 21:08:40 +0000 (23:08 +0200)]
s390x/tcg: Implement VECTOR ADD

Introduce two types of fancy new helpers that will be reused a couple of
times

1. gen_gvec_fn_3: Call an existing tcg_gen_gvec_X function with 3
   parameters, simplifying parameter passing
2. gen_gvec128_3_i64: Call a function that performs 128 bit calculations
   using two 64 bit values per vector.

Luckily, for VECTOR ADD we already have everything we need.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
5 years agoMAINTAINERS: add myself for leon3
KONRAD Frederic [Wed, 15 May 2019 12:31:33 +0000 (14:31 +0200)]
MAINTAINERS: add myself for leon3

Reviewed-by: Fabien Chouteau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agoleon3: introduce the plug and play mechanism
KONRAD Frederic [Wed, 15 May 2019 12:31:32 +0000 (14:31 +0200)]
leon3: introduce the plug and play mechanism

This adds the AHB and APB plug and play devices.
They are scanned during the linux boot to discover the various peripheral.

Reviewed-by: Fabien Chouteau <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agoleon3: add a little bootloader
KONRAD Frederic [Wed, 15 May 2019 12:31:31 +0000 (14:31 +0200)]
leon3: add a little bootloader

This adds a little bootloader to the leon3_machine when a ram image is
given through the kernel parameter and no bios are provided:
  * The UART transmiter is enabled.
  * The TIMER is initialized.

Reviewed-by: Fabien Chouteau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agogrlib, apbuart: get rid of the old-style create function
KONRAD Frederic [Wed, 15 May 2019 12:31:30 +0000 (14:31 +0200)]
grlib, apbuart: get rid of the old-style create function

Suggested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agogrlib, gptimer: get rid of the old-style create function
KONRAD Frederic [Wed, 15 May 2019 12:31:29 +0000 (14:31 +0200)]
grlib, gptimer: get rid of the old-style create function

Suggested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agogrlib, irqmp: get rid of the old-style create function
KONRAD Frederic [Wed, 15 May 2019 12:31:28 +0000 (14:31 +0200)]
grlib, irqmp: get rid of the old-style create function

Suggested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agoleon3: fix the error message when no bios are provided
KONRAD Frederic [Wed, 15 May 2019 12:31:27 +0000 (14:31 +0200)]
leon3: fix the error message when no bios are provided

The leon3 board is looking for u-boot.bin by default (LEON3_PROM_FILENAME)..
But in the case this file is not found and no other file are given on the
command line we get the following error:

  $ ./qemu-system-sparc -M leon3_generic
  qemu-system-sparc: Can't read bios image (null)

So use LEON3_PROM_FILENAME instead of filename in case it is NULL to get a
less cryptic message:

  $ ./qemu-system-sparc -M leon3_generic
  qemu-system-sparc: Can't read bios image 'u-boot.bin'

Suggested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agohw/char/escc: Lower irq when transmit buffer is filled
Stephen Checkoway [Fri, 19 Apr 2019 15:40:41 +0000 (11:40 -0400)]
hw/char/escc: Lower irq when transmit buffer is filled

The SCC/ESCC will briefly stop asserting an interrupt when the
transmit FIFO is filled.

This code doesn't model the transmit FIFO/shift register so the
pending transmit interrupt is never deasserted which means that an
edge-triggered interrupt controller will never see the low-to-high
transition it needs to raise another interrupt. The practical
consequence of this is that guest firmware with an interrupt service
routine for the ESCC that does not send all of the data it has
immediately will stop sending data if the following sequence of
events occurs:
1. Disable processor interrupts
2. Write a character to the ESCC
3. Add additional characters to a buffer which is drained by the ISR
4. Enable processor interrupts

In this case, the first character will be sent, the interrupt will
fire and the ISR will output the second character. Since the pending
transmit interrupt remains asserted, no additional interrupts will
ever fire.

This behavior was triggered by firmware for an embedded system with a
Z85C30 which necessitated this patch.

This patch fixes that situation by explicitly lowering the IRQ when a
character is written to the buffer and no other interrupts are currently
pending.

Signed-off-by: Stephen Checkoway <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
5 years agos390/css: handle CCW_FLAG_SKIP
Cornelia Huck [Mon, 6 May 2019 17:11:48 +0000 (19:11 +0200)]
s390/css: handle CCW_FLAG_SKIP

If a ccw has CCW_FLAG_SKIP set, and the command is of type
read, read backwards, or sense, no data should be written
to the guest for that command.

Reviewed-by: Eric Farman <[email protected]>
Message-Id: <20190516133327[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
5 years agoMerge tag 's390-ccw-bios-2019-05-08' into s390-next-staging
Cornelia Huck [Fri, 17 May 2019 05:58:45 +0000 (07:58 +0200)]
Merge tag 's390-ccw-bios-2019-05-08' into s390-next-staging

Skip unsupported bootmap signature entries instead of aborting the boot process

# gpg: Signature made Wed 08 May 2019 11:42:24 AM CEST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [undefined]
# gpg:                 aka "Thomas Huth <[email protected]>" [undefined]
# gpg:                 aka "Thomas Huth <[email protected]>" [unknown]

* tag 's390-ccw-bios-2019-05-08':
  pc-bios/s390: Update firmware image with "Skip bootmap signature entries" fix
  s390-bios: Skip bootmap signature entries
  pc-bios/s390-ccw: Clean up harmless misuse of isdigit()

5 years agos390/ipl: cast to SCSIDevice directly
Cornelia Huck [Thu, 2 May 2019 15:46:51 +0000 (17:46 +0200)]
s390/ipl: cast to SCSIDevice directly

Coverity notes that the result of object_dynamic_cast() to
SCSIDevice is not checked in s390_gen_initial_iplp(); as
we know that we always have a SCSIDevice in that branch,
we can instead cast via SCSI_DEVICE directly.

Coverity: CID 1401098
Fixes: 44445d8668f4 ("s390 vfio-ccw: Add bootindex property and IPLB data")
Message-Id: <20190502155516[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Christian Borntraeger <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
5 years agomemory: correct the comment to DIRTY_MEMORY_MIGRATION
Wei Yang [Fri, 26 Apr 2019 02:09:27 +0000 (10:09 +0800)]
memory: correct the comment to DIRTY_MEMORY_MIGRATION

The dirty bit is DIRTY_MEMORY_MIGRATION. Correct the comment.

Signed-off-by: Wei Yang <[email protected]>
Message-Id: <20190426020927[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agovl: fix -sandbox parsing crash when seccomp support is disabled
Marc-André Lureau [Mon, 29 Apr 2019 13:47:57 +0000 (15:47 +0200)]
vl: fix -sandbox parsing crash when seccomp support is disabled

$ ./x86_64-softmmu/qemu-system-x86_64 -sandbox off
qemu-system-x86_64: -sandbox off: There is no option group 'sandbox'
Segmentation fault

Commit 5780760f5e ("seccomp: check TSYNC host capability") wrapped one
use of the sandbox option group to produce a sensible error, it didn't
do the same for another call to qemu_opts_parse_noisily():

(gdb) bt
    at util/qemu-option.c:829
 #0  0x00000000105b36d8 in opts_parse (list=0x0, params=0x3ffffffffab5 "off", permit_abbrev=true, defaults=false, errp=0x3ffffffff080)
     at util/qemu-option.c:829
 #1  0x00000000105b3b74 in qemu_opts_parse_noisily (list=<optimized out>, params=<optimized out>, permit_abbrev=<optimized out>) at util/qemu-option.c:890
 #2  0x0000000010024964 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:3589

Fixes: 5780760f5ea6163939a5dabe7427318b4f07d1a2
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20190429134757[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agohvf: Add missing break statement
Chen Zhang [Mon, 22 Apr 2019 03:42:25 +0000 (11:42 +0800)]
hvf: Add missing break statement

In target/i386/hvf/hvf.c, a break statement was probably missing in
`hvf_vcpu_exec()`, in handling EXIT_REASON_HLT.

These lines seemed to be equivalent to `kvm_handle_halt()`.

Signed-off-by: Chen Zhang <[email protected]>
Message-Id: <087F1D9C-109D-41D1-BE2C-CE5D840C981B@me.com>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
5 years agotarget/m68k: Optimize rotate_x() using extract_i32()
Philippe Mathieu-Daudé [Sun, 10 Mar 2019 00:34:27 +0000 (01:34 +0100)]
target/m68k: Optimize rotate_x() using extract_i32()

Optimize rotate_x() using tcg_gen_extract_i32(). We can now free the
'sz' tcg_temp earlier. Since it is allocated with tcg_const_i32(),
free it with tcg_temp_free_i32().

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20190310003428[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agotarget/m68k: Fix a tcg_temp leak
Philippe Mathieu-Daudé [Sun, 10 Mar 2019 00:34:25 +0000 (01:34 +0100)]
target/m68k: Fix a tcg_temp leak

The function gen_get_ccr() returns a tcg_temp created with
tcg_temp_new(). Free it with tcg_temp_free().

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20190310003428[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agotarget/m68k: Reduce the l1 TCGLabel scope
Philippe Mathieu-Daudé [Sun, 10 Mar 2019 00:34:23 +0000 (01:34 +0100)]
target/m68k: Reduce the l1 TCGLabel scope

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20190310003428[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agotarget/m68k: Switch to transaction_failed hook
Peter Maydell [Mon, 10 Dec 2018 16:56:36 +0000 (16:56 +0000)]
target/m68k: Switch to transaction_failed hook

Switch the m68k target from the old unassigned_access hook
to the transaction_failed hook.

The notable difference is that rather than it being called
for all physical memory accesses which fail (including
those made by DMA devices or by the gdbstub), it is only
called for those made by the CPU via its MMU. (In previous
commits we put in explicit checks for the direct physical
loads made by the target/m68k code which will no longer
be handled by calling the unassigned_access hook.)

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20181210165636[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agotarget/m68k: In get_physical_address() check for memory access failures
Peter Maydell [Mon, 10 Dec 2018 16:56:35 +0000 (16:56 +0000)]
target/m68k: In get_physical_address() check for memory access failures

In get_physical_address(), use address_space_ldl() and
address_space_stl() instead of ldl_phys() and stl_phys().
This allows us to check whether the memory access failed.
For the moment, we simply return -1 in this case;
add a TODO comment that we should ideally generate the
appropriate kind of fault.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20181210165636[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
This page took 0.08903 seconds and 4 git commands to generate.