]> Git Repo - qemu.git/log
qemu.git
6 years agospapr/vio: deprecate the "irq" property
Cédric Le Goater [Tue, 5 Jun 2018 06:56:26 +0000 (08:56 +0200)]
spapr/vio: deprecate the "irq" property

VIO devices have an "irq" property that can be used by the sPAPR IRQ
allocator as an IRQ number hint. But it is not set in QEMU nor in
libvirt. It brings unnecessary complexity to the underlying layers
managing the IRQ number space and it is in full opposition with the
new static IRQ allocator we want to introduce in sPAPR.

Let's deprecate it to simplify the spapr_irq_alloc routine in the
future.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
[dwg: Check qtest_enabled() to suppress bogus warnings from make check]
Signed-off-by: David Gibson <[email protected]>
6 years agotarget/ppc: Allow privileged access to SPR_PCR
Joel Stanley [Mon, 4 Jun 2018 08:45:13 +0000 (18:15 +0930)]
target/ppc: Allow privileged access to SPR_PCR

The powerpc Linux kernel[1] and skiboot firmware[2] recently gained changes
that cause the Processor Compatibility Register (PCR) SPR to be cleared.

These changes cause Linux to fail to boot on the Qemu powernv machine
with an error:

 Trying to write privileged spr 338 (0x152) at 0000000030017f0c

With this patch Qemu makes this register available as a hypervisor
privileged register.

Note that bits set in this register disable features of the processor.
Currently the only register state that is supported is when the register
is zeroed (enable all features). This is sufficient for guests to
once again boot.

[1] https://lkml.kernel.org/r/20180518013742[email protected]
[2] https://patchwork.ozlabs.org/patch/915932/

Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agotarget/ppc: Factor out the parsing in kvmppc_get_cpu_characteristics()
Suraj Jitindar Singh [Fri, 11 May 2018 06:25:07 +0000 (16:25 +1000)]
target/ppc: Factor out the parsing in kvmppc_get_cpu_characteristics()

Factor out the parsing of struct kvm_ppc_cpu_char in
kvmppc_get_cpu_characteristics() into a separate function for each cap
for simplicity.

Signed-off-by: Suraj Jitindar Singh <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agoprep: fix keyboard for the 40p machine
Mark Cave-Ayland [Thu, 24 May 2018 05:39:58 +0000 (06:39 +0100)]
prep: fix keyboard for the 40p machine

Commit 72d3d8f052 "hw/isa/superio: Add a keyboard/mouse controller (8042)"
added an 8042 keyboard device to the PC87312 superio device to replace that
being used by the prep machine.

Unfortunately this commit didn't do the same for the 40p machine which broke
the keyboard by registering two 8042 keyboard devices at the same address.

Resolve this by similarly removing the 8042 keyboard from the 40p machine as
done for the prep machine in commit 72d3d8f052.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Hervé Poussineau <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years ago40p: remove pci_allow_0_address = true from 40p machine class
Mark Cave-Ayland [Fri, 25 May 2018 21:15:23 +0000 (22:15 +0100)]
40p: remove pci_allow_0_address = true from 40p machine class

The Linux sandalfoot zImage has an initialisation process which resets the
VGA controller by setting all the BAR addresses to zero to access the VGA
ioports at their legacy addresses.

Unfortunately setting the framebuffer BAR to address 0 makes the framebuffer
memory overlap the internal VGA memory causing accesses to fail, and so
prevents the kernel from switching successfully to text mode.

Since OpenHackWare configures the framebuffer BAR address outside of the legacy
VGA internal memory space, remove pci_allow_0_address from the 40p machine class
which causes the BAR reprogramming to zero to fail and so the VGA internal
memory can be accessed correctly again.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agotarget/ppc: Use proper logging function for possible guest errors
Thomas Huth [Mon, 28 May 2018 18:11:19 +0000 (20:11 +0200)]
target/ppc: Use proper logging function for possible guest errors

fprintf() and qemu_log_separate() are frowned upon these days for printing
logging information in QEMU. Accessing the wrong SPRs indicates wrong guest
behaviour in most cases, and we've got a proper way to log such situations,
which is the qemu_log_mask(LOG_GUEST_ERROR, ...) function. So use this
function now for logging the bad SPR accesses instead.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agohw/ppc/spapr_drc: Replace error_setg(&error_abort) by error_report() + abort()
Philippe Mathieu-Daudé [Tue, 29 May 2018 17:48:19 +0000 (14:48 -0300)]
hw/ppc/spapr_drc: Replace error_setg(&error_abort) by error_report() + abort()

Use error_report() + abort() instead of error_setg(&error_abort),
as suggested by the "qapi/error.h" documentation:

    Please don't error_setg(&error_fatal, ...), use error_report() and
    exit(), because that's more obvious.
    Likewise, don't error_setg(&error_abort, ...), use assert().

Use abort() instead of the suggested assert() because the error message
already got displayed.

Suggested-by: Eric Blake <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agouninorth: remove token register from uninorth device
Mark Cave-Ayland [Sun, 6 May 2018 14:20:05 +0000 (15:20 +0100)]
uninorth: remove token register from uninorth device

>From observation of various OS sources it can be seen that the token register
introduced in 4e46dcdbd3 "PPC: Newworld: Add uninorth token register" is not
required, since the only register currently implemented is the uninorth hardware
version which is read-only.

Remove the token register implementation and instead return the uninorth
version corresponding to the hardware.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agomacio: add trace-events to timer device
Mark Cave-Ayland [Sun, 6 May 2018 14:20:03 +0000 (15:20 +0100)]
macio: add trace-events to timer device

Signed-off-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agoppc440_pcix: Fix a typo in setting a register (Coverity CID1390577)
BALATON Zoltan [Fri, 4 May 2018 08:45:50 +0000 (10:45 +0200)]
ppc440_pcix: Fix a typo in setting a register (Coverity CID1390577)

Signed-off-by: BALATON Zoltan <[email protected]>
Signed-off-by: David Gibson <[email protected]>
6 years agonvdimm: make persistence option symbolic
Ross Zwisler [Thu, 7 Jun 2018 22:31:11 +0000 (16:31 -0600)]
nvdimm: make persistence option symbolic

Replace the "nvdimm-cap" option which took numeric arguments such as "2"
with a more user friendly "nvdimm-persistence" option which takes symbolic
arguments "cpu" or "mem-ctrl".

Signed-off-by: Ross Zwisler <[email protected]>
Suggested-by: Michael S. Tsirkin <[email protected]>
Suggested-by: Dan Williams <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
6 years agohw/i386: Update SSDT table used by "make check"
Ross Zwisler [Thu, 7 Jun 2018 22:31:09 +0000 (16:31 -0600)]
hw/i386: Update SSDT table used by "make check"

This commit:

commit aa78a16d8645 ("hw/i386: Rename 2.13 machine types to 3.0")

updated the name used to create the q35 machine, which in turn changed the
SSDT table which is generated when we run "make check":

  acpi-test: Warning! SSDT mismatch. Actual [asl:/tmp/asl-QZDWJZ.dsl,
  aml:/tmp/aml-T8JYJZ], Expected [asl:/tmp/asl-DTWVJZ.dsl,
  aml:tests/acpi-test-data/q35/SSDT.dimmpxm].

Here's the only difference, aside from the checksum:

  <     Name (MEMA, 0x07FFF000)
  ---
  >     Name (MEMA, 0x07FFE000)

Update the binary table that we compare against so it reflects this name
change.

Signed-off-by: Ross Zwisler <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Fixes: commit aa78a16d8645 ("hw/i386: Rename 2.13 machine types to 3.0")
Tested-by: Thomas Huth <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
6 years agoqapi: add disabled parameter to block-dirty-bitmap-add
Vladimir Sementsov-Ogievskiy [Mon, 11 Jun 2018 18:53:32 +0000 (14:53 -0400)]
qapi: add disabled parameter to block-dirty-bitmap-add

This is needed, for example, to create a new bitmap and merge several
disabled bitmaps into a new one. Without this flag we will have to
put block-dirty-bitmap-add and block-dirty-bitmap-disable into one
transaction.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180606182449[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoqapi: add x-block-dirty-bitmap-merge
Vladimir Sementsov-Ogievskiy [Mon, 11 Jun 2018 18:53:32 +0000 (14:53 -0400)]
qapi: add x-block-dirty-bitmap-merge

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180606182449[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoqmp: transaction support for x-block-dirty-bitmap-enable/disable
Vladimir Sementsov-Ogievskiy [Mon, 11 Jun 2018 18:53:32 +0000 (14:53 -0400)]
qmp: transaction support for x-block-dirty-bitmap-enable/disable

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180606182449[email protected]
[Added x- prefix. --js]
Signed-off-by: John Snow <[email protected]>
6 years agoqapi: add x-block-dirty-bitmap-enable/disable
Vladimir Sementsov-Ogievskiy [Mon, 11 Jun 2018 18:53:32 +0000 (14:53 -0400)]
qapi: add x-block-dirty-bitmap-enable/disable

Expose the ability to turn bitmaps "on" or "off". This is experimental
and principally for the sake of the Libvirt Checkpoints API, and it may
or may not be committed for 3.0.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180606182449[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoblock/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap
Vladimir Sementsov-Ogievskiy [Mon, 11 Jun 2018 18:53:31 +0000 (14:53 -0400)]
block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap

Add locks and remove comments about BQL accordingly to
dirty_bitmap_mutex definition in block_int.h.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180606182449[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoblock: simplify code around releasing bitmaps
Paolo Bonzini [Mon, 11 Jun 2018 18:53:31 +0000 (14:53 -0400)]
block: simplify code around releasing bitmaps

QLIST_REMOVE does not require walking the list, and once the "bitmap"
argument is removed from bdrv_do_release_matching_dirty_bitmap_locked
the code simplifies a lot and it is worth inlining everything in the
callers of bdrv_do_release_matching_dirty_bitmap.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id: 20180326104037[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoblock: remove bdrv_dirty_bitmap_make_anon
Paolo Bonzini [Mon, 11 Jun 2018 18:53:31 +0000 (14:53 -0400)]
block: remove bdrv_dirty_bitmap_make_anon

All this function is doing will be repeated by
bdrv_do_release_matching_dirty_bitmap_locked, except
resetting bm->persistent.  But even that does not matter
because the bitmap will be freed.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 20180323164254[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agocli: Don't run early event loop if no --preconfig was specified
Igor Mammedov [Tue, 5 Jun 2018 14:00:42 +0000 (16:00 +0200)]
cli: Don't run early event loop if no --preconfig was specified

After 047f7038f586d215 it is possible for event loop to run two
times. First time whilst parsing command line options (the idea
is to bring up monitor early so that management applications can
tweak config before machine is initialized). And the second time
is after everything is set up (this is the usual place). In both
cases the event loop is called as main_loop_wait(nonblocking =
false) which causes the event loop to block until at least one
event occurred.

Now, consider that somebody (i.e. libvirt) calls us with
-daemonize. This operation is split in two steps. The main()
calls os_daemonize() which fork()-s and then waits in read()
until child notifies it via write():

/qemu.git $ ./x86_64-softmmu/qemu-system-x86_64 -S -daemonize \
  -no-user-config -nodefaults -nographic

  main():                child:
    os_daemonize():
      read(pipe[0])

                           main_loop():
                             main_loop_wait(false)

                           os_setup_post():
                             write(pipe[1])

                           main_loop():
                             main_loop_wait(false)

Here it can be clearly seen that main() does not exit until an
event occurs, but at the same time nobody will touch the monitor
socket until their exec("qemu-system-*") finishes. So the whole
thing deadlocks.

The solution is to not call main_loop_wait() unless --preconfig was
specified (in which case caller knows they must connect to the
socket before exec() finishes).

Patch also fixes hang when -nodefaults option is used, which were
causing QEMU hang in the early main_loop_wait() indefinitely by
the same means (not calling main_loop_wait() unless --preconfig
is present on CLI)

Based on
  From: Michal Privoznik <[email protected]>
  Subject: [PATCH] cli: Don't run early event loop if no --preconfig was specified
  Message-Id: <ad910973c593c5ac2fed3a10ea958f7e9c12f82c.1527935663[email protected]>
Fixes: 047f7038f586d215
Signed-off-by: Igor Mammedov <[email protected]>
Message-Id: <1528207243[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Peter Maydell [Mon, 11 Jun 2018 17:24:56 +0000 (18:24 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging

x86 queue, 2018-06-11

* Support for CPUID[0x8000001D] (AMD Cache Topology Information)
* pc bug fix: Remove PC_COMPAT_2_12 from 3.0 machine-types

# gpg: Signature made Mon 11 Jun 2018 18:22:48 BST
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <[email protected]>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-pull-request:
  pc: Remove PC_COMPAT_2_12 from 3.0 machine-types
  i386: Populate AMD Processor Cache Information for cpuid 0x8000001D
  i386: Clean up cache CPUID code

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2018-06-11' into staging
Peter Maydell [Mon, 11 Jun 2018 14:31:20 +0000 (15:31 +0100)]
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2018-06-11' into staging

Block patches:
- Various bug fixes
- Removal of qemu-img convert's deprecated -s option
- qemu-io now exits with an error when a command failed

# gpg: Signature made Mon 11 Jun 2018 15:23:42 BST
# gpg:                using RSA key F407DB0061D5CF40
# gpg: Good signature from "Max Reitz <[email protected]>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* remotes/maxreitz/tags/pull-block-2018-06-11: (29 commits)
  iotests: Add case for a corrupted inactive image
  qcow2: Do not mark inactive images corrupt
  block: Make bdrv_is_writable() public
  throttle: Fix crash on reopen
  block/qcow2-bitmap: fix free_bitmap_clusters
  qemu-img: Remove deprecated -s snapshot_id_or_name option
  iotests: Fix 219's timing
  iotests: improve pause_job
  iotests: Test post-backing convert target behavior
  qemu-img: Special post-backing convert handling
  iotests: Add test for rebasing with relative paths
  qemu-img: Resolve relative backing paths in rebase
  iotests: Let 216 make use of qemu-io's exit code
  iotests.py: Add qemu_io_silent
  qemu-io: Exit with error when a command failed
  qemu-io: Let command functions return error code
  qemu-io: Drop command functions' return values
  iotests: Repairing error during snapshot deletion
  qcow2: Repair OFLAG_COPIED when fixing leaks
  iotests: Rework 113
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agoiotests: Add case for a corrupted inactive image
Max Reitz [Wed, 6 Jun 2018 19:37:02 +0000 (21:37 +0200)]
iotests: Add case for a corrupted inactive image

Reviewed-by: John Snow <[email protected]>
Tested-by: Jeff Cody <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180606193702[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqcow2: Do not mark inactive images corrupt
Max Reitz [Wed, 6 Jun 2018 19:37:01 +0000 (21:37 +0200)]
qcow2: Do not mark inactive images corrupt

When signaling a corruption on a read-only image, qcow2 already makes
fatal events non-fatal (i.e., they will not result in the image being
closed, and the image header's corrupt flag will not be set).  This is
necessary because we cannot set the corrupt flag on read-only images,
and it is possible because further corruption of read-only images is
impossible.

Inactive images are effectively read-only, too, so we should do the same
for them.  bdrv_is_writable() can tell us whether an image can actually
be written to, so use its result instead of !bs->read_only.

(Otherwise, the assert(!(bs->open_flags & BDRV_O_INACTIVE)) in
bdrv_co_pwritev() will fail, crashing qemu.)

Cc: [email protected]
Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180606193702[email protected]
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoblock: Make bdrv_is_writable() public
Max Reitz [Wed, 6 Jun 2018 19:37:00 +0000 (21:37 +0200)]
block: Make bdrv_is_writable() public

This is a useful function for the whole block layer, so make it public.
At the same time, users outside of block.c probably do not need to make
use of the reopen functionality, so rename the current function to
bdrv_is_writable_after_reopen() create a new bdrv_is_writable() function
that just passes NULL to it for the reopen queue.

Cc: [email protected]
Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180606193702[email protected]
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agothrottle: Fix crash on reopen
Alberto Garcia [Fri, 8 Jun 2018 15:15:36 +0000 (18:15 +0300)]
throttle: Fix crash on reopen

The throttle block filter can be reopened, and with this it is
possible to change the throttle group that the filter belongs to.

The way the code does that is the following:

  - On throttle_reopen_prepare(): create a new ThrottleGroupMember
    and attach it to the new throttle group.

  - On throttle_reopen_commit(): detach the old ThrottleGroupMember,
    delete it and replace it with the new one.

The problem with this is that by replacing the ThrottleGroupMember the
previous value of io_limits_disabled is lost, causing an assertion
failure in throttle_co_drain_end().

This problem can be reproduced by reopening a throttle node:

   $QEMU -monitor stdio
   -object throttle-group,id=tg0,x-iops-total=1000 \
   -blockdev node-name=hd0,driver=qcow2,file.driver=file,file.filename=hd.qcow2 \
   -blockdev node-name=root,driver=throttle,throttle-group=tg0,file=hd0,read-only=on

   (qemu) block_stream root
   block/throttle.c:214: throttle_co_drain_end: Assertion `tgm->io_limits_disabled' failed.

Since we only want to change the throttle group on reopen there's no
need to create a ThrottleGroupMember and discard the old one. It's
easier if we simply detach it from its current group and attach it to
the new one.

Signed-off-by: Alberto Garcia <[email protected]>
Message-id: 20180608151536[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoblock/qcow2-bitmap: fix free_bitmap_clusters
Vladimir Sementsov-Ogievskiy [Fri, 8 Jun 2018 10:12:25 +0000 (13:12 +0300)]
block/qcow2-bitmap: fix free_bitmap_clusters

This assert may fail, because bitmap_table is not initialized. Just
drop it, as it's obvious, that bitmap_table_load sets bitmap_table
parameter only when returning zero.

Reported-by: Pavel Butsykin <[email protected]>
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-id: 20180608101225[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Remove deprecated -s snapshot_id_or_name option
Thomas Huth [Wed, 6 Jun 2018 12:35:51 +0000 (14:35 +0200)]
qemu-img: Remove deprecated -s snapshot_id_or_name option

It has been marked as deprecated since QEMU v2.0 already, so it
is time now to finally remove it.

Signed-off-by: Thomas Huth <[email protected]>
Message-id: 1528288551[email protected]
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Fix 219's timing
Max Reitz [Wed, 6 Jun 2018 19:06:28 +0000 (21:06 +0200)]
iotests: Fix 219's timing

219 has two issues that may lead to sporadic failure, both of which are
the result of issuing query-jobs too early after a job has been
modified.  This can then lead to different results based on whether the
modification has taken effect already or not.

First, query-jobs is issued right after the job has been created.
Besides its current progress possibly being in any random state (which
has already been taken care of), its total progress too is basically
arbitrary, because the job may not yet have been able to determine it.
This patch addresses this by just filtering the total progress, like
what has been done for the current progress already.  However, for more
clarity, the filtering is changed to replace the values by a string
'FILTERED' instead of deleting them.

Secondly, query-jobs is issued right after a job has been resumed.  The
job may or may not yet have had the time to actually perform any I/O,
and thus its current progress may or may not have advanced.  To make
sure it has indeed advanced (which is what the reference output already
assumes), keep querying it until it has.

Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180606190628[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: improve pause_job
Vladimir Sementsov-Ogievskiy [Fri, 1 Jun 2018 11:59:23 +0000 (14:59 +0300)]
iotests: improve pause_job

It's possible, that job was finished during waiting. In this case we
will see error message "Timeout waiting for job to pause" which is not
very informative. So, let's check during waiting iteration that the job
exists.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-id: 20180601115923[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Test post-backing convert target behavior
Max Reitz [Tue, 1 May 2018 16:57:50 +0000 (18:57 +0200)]
iotests: Test post-backing convert target behavior

This adds a test case to 122 for what happens when you convert to a
target with a backing file that is shorter than the target, and the
image format does not support efficient zero writes (as is the case with
qcow2 v2).

Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180501165750[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Special post-backing convert handling
Max Reitz [Tue, 1 May 2018 16:57:49 +0000 (18:57 +0200)]
qemu-img: Special post-backing convert handling

Currently, qemu-img convert writes zeroes when it reads zeroes.
Sometimes it does not because the target is initialized to zeroes
anyway, so we do not need to overwrite (and thus potentially allocate)
it.  This is never the case for targets with backing files, though.  But
even they may have an area that is initialized to zeroes, and that is
the area past the end of the backing file (if that is shorter than the
overlay).

So if the target format's unallocated blocks are zero and there is a gap
between the target's backing file's end and the target's end, we do not
have to explicitly write zeroes there.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1527898
Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180501165750[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Add test for rebasing with relative paths
Max Reitz [Wed, 9 May 2018 18:20:02 +0000 (20:20 +0200)]
iotests: Add test for rebasing with relative paths

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509182002[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Resolve relative backing paths in rebase
Max Reitz [Wed, 9 May 2018 18:20:01 +0000 (20:20 +0200)]
qemu-img: Resolve relative backing paths in rebase

Currently, rebase interprets a relative path for the new backing image
as follows:
(1) Open the new backing image with the given relative path (thus relative to
    qemu-img's working directory).
(2) Write it directly into the overlay's backing path field (thus
    relative to the overlay).

If the overlay is not in qemu-img's working directory, both will be
different interpretations, which may either lead to an error somewhere
(either rebase fails because it cannot open the new backing image, or
your overlay becomes unusable because its backing path does not point to
a file), or, even worse, it may result in your rebase being performed
for a different backing file than what your overlay will point to after
the rebase.

Fix this by interpreting the target backing path as relative to the
overlay, like qemu-img does everywhere else.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1569835
Cc: [email protected]
Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180509182002[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Let 216 make use of qemu-io's exit code
Max Reitz [Wed, 9 May 2018 19:43:02 +0000 (21:43 +0200)]
iotests: Let 216 make use of qemu-io's exit code

As a showcase of how you can use qemu-io's exit code to determine
success or failure (same for qemu-img), this test is changed to use
qemu_io_silent() instead of qemu_io(), and to assert the exit code
instead of logging the filtered result.

One real advantage of this is that in case of an error, you get a
backtrace that helps you locate the issue in the test file quickly.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509194302[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests.py: Add qemu_io_silent
Max Reitz [Wed, 9 May 2018 19:43:01 +0000 (21:43 +0200)]
iotests.py: Add qemu_io_silent

With qemu-io now returning a useful exit code, some tests may find it
sufficient to just query that instead of logging (and filtering) the
whole output.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509194302[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-io: Exit with error when a command failed
Max Reitz [Wed, 9 May 2018 19:43:00 +0000 (21:43 +0200)]
qemu-io: Exit with error when a command failed

Currently, qemu-io basically always returns success when it gets to
interactive mode (so once the whole command line has been parsed; even
before the commands on the command line are interpreted).  That is not
very useful.

This patch makes qemu-io return failure when any of the executed
commands failed.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1519617
Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509194302[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-io: Let command functions return error code
Max Reitz [Wed, 9 May 2018 19:42:59 +0000 (21:42 +0200)]
qemu-io: Let command functions return error code

This is basically what everything else in the qemu code base does, so we
can do it here, too.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509194302[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-io: Drop command functions' return values
Max Reitz [Wed, 9 May 2018 19:42:58 +0000 (21:42 +0200)]
qemu-io: Drop command functions' return values

For qemu-io, a function returns an integer with two possible values: 0
for "qemu-io may continue execution", or 1 for "qemu-io should exit".
However, there is only a single command that returns 1, and that is
"quit".

So let's turn this case into a global variable instead so we can make
better use of the return value in a later patch.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509194302[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Repairing error during snapshot deletion
Max Reitz [Wed, 9 May 2018 20:00:59 +0000 (22:00 +0200)]
iotests: Repairing error during snapshot deletion

This adds a test for an I/O error during snapshot deletion, and maybe
more importantly, for how to repair the resulting image.  If the
snapshot has been deleted before the error occurs, the only negative
result will be leaked clusters -- and those should be repairable with
qemu-img check -r leaks.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509200059[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqcow2: Repair OFLAG_COPIED when fixing leaks
Max Reitz [Wed, 9 May 2018 20:00:58 +0000 (22:00 +0200)]
qcow2: Repair OFLAG_COPIED when fixing leaks

Repairing OFLAG_COPIED is usually safe because it is done after the
refcounts have been repaired.  Therefore, it we did not find anyone else
referencing a data or L2 cluster, it makes no sense to not set
OFLAG_COPIED -- and the other direction (clearing OFLAG_COPIED) is
always safe, anyway, it may just induce leaks.

Furthermore, if OFLAG_COPIED is actually consistent with a wrong (leaky)
refcount, we will decrement the refcount with -r leaks, but OFLAG_COPIED
will then be wrong.  qemu-img check should not produce images that are
more corrupted afterwards then they were before.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1527085
Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509200059[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Rework 113
Max Reitz [Wed, 9 May 2018 21:00:23 +0000 (23:00 +0200)]
iotests: Rework 113

This test case has been broken since 398e6ad014df261d (roughly half a
year).  qemu-img amend requires its output image to be R/W, so it opens
it as such; the node is then turned into an read-only node automatically
which is now accompanied by a warning, however.  This warning has not
been part of the reference output.

For one thing, this warning shows that we cannot keep the test case as
it is.  We would need a format that has no create_opts but that does
have write support -- we do not have such a format, though.

Another thing is that qemu now actually checks whether an image format
supports amendment instead of whether it has create_opts (since the
former always implies the latter).  So we can now use any format that
does not support amendment (even if it supports creation) and thus test
the same code path.

The reason nobody has noticed the breakage until now of course is the
fact that nobody runs the iotests for nbd+bochs.  There actually was
never any reason to set the protocol to "nbd" but because that was
technically correct; functionally it made no difference.  So that is the
first thing we are going to change: Make the protocol "file" instead so
that people might actually notice breakage here.

Secondly, now that bochs no longer works for the amend test case, we
have to change the format there anyway.  Set let us just bend the truth
a bit, declare this test a raw test.  In fact, that does not even
concern the bochs test cases, other than the output now reading 'bochs'
instead of 'IMGFMT'.

So with this test now being a raw test, we can rework the amend test
case to use raw instead.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Test help option for unsupporting formats
Max Reitz [Wed, 9 May 2018 21:00:22 +0000 (23:00 +0200)]
iotests: Test help option for unsupporting formats

This adds test cases to 082 for qemu-img create/convert/amend "-o help"
on formats that do not support creation or amendment, respectively.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Recognize no creation support in -o help
Max Reitz [Wed, 9 May 2018 21:00:21 +0000 (23:00 +0200)]
qemu-img: Recognize no creation support in -o help

The only users of print_block_option_help() are qemu-img create and
qemu-img convert for the output image, so this function is always used
for image creation (it used to be used for amendment also, but that is
no longer the case).

So if image creation is not supported by either the format or the
protocol, there is no need to print any option description, because the
user cannot create an image like this anyway.

This also fixes an assertion failure:

    $ qemu-img create -f bochs -o help
    Supported options:
    qemu-img: util/qemu-option.c:219:
    qemu_opts_print_help: Assertion `list' failed.
    [1]    24831 abort (core dumped)  qemu-img create -f bochs -o help

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Add print_amend_option_help()
Max Reitz [Wed, 9 May 2018 21:00:20 +0000 (23:00 +0200)]
qemu-img: Add print_amend_option_help()

The more generic print_block_option_help() function is not really
suitable for qemu-img amend, for a couple of reasons:
(1) We do not need to append the protocol-level options, as amendment
    happens only on one node and does not descend downwards to its
    children.
(2) print_block_option_help() says those options are "supported".  For
    option amendment, we do not really know that.  So this new function
    explicitly says that those options are the creation options, and not
    all of them may be supported.
(3) If the driver does not support option amendment, we should not print
    anything (except for an error message that amendment is not
    supported).

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1537956
Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-option: Pull out "Supported options" print
Max Reitz [Wed, 9 May 2018 21:00:19 +0000 (23:00 +0200)]
qemu-option: Pull out "Supported options" print

It really is up to the caller to decide what this list of options means.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoblock: Add Error parameter to bdrv_amend_options
Max Reitz [Wed, 9 May 2018 21:00:18 +0000 (23:00 +0200)]
block: Add Error parameter to bdrv_amend_options

Looking at the qcow2 code that is riddled with error_report() calls,
this is really how it should have been from the start.

Along the way, turn the target_version/current_version comparisons at
the beginning of qcow2_downgrade() into assertions (the caller has to
make sure these conditions are met), and rephrase the error message on
using compat=1.1 to get refcount widths other than 16 bits.

Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180509210023[email protected]
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoqemu-img: Amendment support implies create_opts
Max Reitz [Wed, 9 May 2018 21:00:17 +0000 (23:00 +0200)]
qemu-img: Amendment support implies create_opts

Instead of checking whether a driver has a non-NULL create_opts we
should check whether it supports image amendment in the first place.  If
it does, it must have create_opts.

On the other hand, if it does not have create_opts (so it does not
support amendment either), the error message "does not support any
options" is a bit useless.  Stating clearly that the driver has no
amendment support whatsoever is probably better.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20180509210023[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoiotests: Add creation test to 153
Max Reitz [Wed, 9 May 2018 21:53:36 +0000 (23:53 +0200)]
iotests: Add creation test to 153

This patch adds a test case to 153 which tries to overwrite an image
(using qemu-img create) while it is in use.  Without the original user
explicitly sharing the necessary permissions (writing and truncation),
this should not be allowed.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-id: 20180509215336[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agoblock/file-posix: File locking during creation
Max Reitz [Wed, 9 May 2018 21:53:35 +0000 (23:53 +0200)]
block/file-posix: File locking during creation

When creating a file, we should take the WRITE and RESIZE permissions.
We do not need either for the creation itself, but we do need them for
clearing and resizing it.  So we can take the proper permissions by
replacing O_TRUNC with an explicit truncation to 0, and by taking the
appropriate file locks between those two steps.

Signed-off-by: Max Reitz <[email protected]>
Message-id: 20180509215336[email protected]
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
6 years agoblock/file-posix: Pass FD to locking helpers
Max Reitz [Wed, 9 May 2018 21:53:34 +0000 (23:53 +0200)]
block/file-posix: Pass FD to locking helpers

raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a
BDRVRawState *, but they only use the lock_fd field.  During image
creation, we do not have a BDRVRawState, but we do have an FD; so if we
want to reuse the functions there, we should modify them to receive only
the FD.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-id: 20180509215336[email protected]
Signed-off-by: Max Reitz <[email protected]>
6 years agolinux-user/sparc64: Add inotify_rm_watch and tee syscalls
Richard Henderson [Thu, 7 Jun 2018 18:48:44 +0000 (11:48 -0700)]
linux-user/sparc64: Add inotify_rm_watch and tee syscalls

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180607184844[email protected]>

6 years agolinux-user/microblaze: Fix typo in accept4 syscall
Richard Henderson [Thu, 7 Jun 2018 18:48:43 +0000 (11:48 -0700)]
linux-user/microblaze: Fix typo in accept4 syscall

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180607184844[email protected]>
[lv: replace tabs by spaces]
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user/hppa: Fix typo in mknodat syscall
Richard Henderson [Thu, 7 Jun 2018 18:48:42 +0000 (11:48 -0700)]
linux-user/hppa: Fix typo in mknodat syscall

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180607184844[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user/alpha: Fix epoll syscalls
Richard Henderson [Thu, 7 Jun 2018 18:48:41 +0000 (11:48 -0700)]
linux-user/alpha: Fix epoll syscalls

These were named incorrectly, going so far as to invade strace.list.

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180607184844[email protected]>
[lv: replace tabs by spaces]
Signed-off-by: Laurent Vivier <[email protected]>
6 years agoqemu-binfmt-conf.sh: ignore the OS/ABI field
Laurent Vivier [Tue, 5 Jun 2018 19:47:25 +0000 (21:47 +0200)]
qemu-binfmt-conf.sh: ignore the OS/ABI field

Most of the binaries have a value of "UNIX - System V" for the OS/ABI.

But cc1 has a value of "UNIX - GNU", and if we don't update the binfmt
mask to ignore the OS/ABI field, gcc fails to execute it:

gcc: error trying to exec '/usr/lib/gcc/m68k-linux-gnu/7/cc1': execv: Exec format error

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20180605194725[email protected]>

6 years agolinux-user: disable qemu-bridge-helper and socket_scm_helper build
Laurent Vivier [Tue, 5 Jun 2018 16:09:58 +0000 (18:09 +0200)]
linux-user: disable qemu-bridge-helper and socket_scm_helper build

linux-user targets don't need them, and if we ask to build statically
linked binaries, some static libraries they need are not available.

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-Id: <20180605160958[email protected]>

6 years agolinux-user: Use is_error() to avoid warnings and make the code clearer
Philippe Mathieu-Daudé [Mon, 4 Jun 2018 15:37:22 +0000 (12:37 -0300)]
linux-user: Use is_error() to avoid warnings and make the code clearer

This fixes:

  linux-user/flatload.c:740:9: warning: Loss of sign in implicit conversion
      if (res > (unsigned long)-4096)
          ^~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180604153722[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agolinux-user: Export use is_error(), use it to avoid warnings
Philippe Mathieu-Daudé [Mon, 4 Jun 2018 15:37:21 +0000 (12:37 -0300)]
linux-user: Export use is_error(), use it to avoid warnings

This fixes:

  linux-user/flatload.c:740:9: warning: Loss of sign in implicit conversion
      if (res > (unsigned long)-4096)
          ^~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20180604153722[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/vivier/tags/m68k-for-3.0-pull-request' into...
Peter Maydell [Mon, 11 Jun 2018 11:46:16 +0000 (12:46 +0100)]
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-3.0-pull-request' into staging

Convert to TranslatorOps

I've updated the series to fix conflicts with:

21528149eb target/m68k: Add trailing '\n' to qemu_log() call
07ea28b418 tcg: Pass tb and index to tcg_gen_exit_tb separately

# gpg: Signature made Mon 11 Jun 2018 11:48:52 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier <[email protected]>"
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/m68k-for-3.0-pull-request:
  target/m68k: Merge disas_m68k_insn into m68k_tr_translate_insn
  target/m68k: Improve ending TB at page boundaries
  target/m68k: Convert to TranslatorOps
  target/m68k: Convert to DisasContextBase
  target/m68k: Rename DISAS_UPDATE and gen_lookup_tb
  target/m68k: Use lookup_and_goto_tb for DISAS_JUMP
  target/m68k: Remove DISAS_JUMP_NEXT as unused
  target/m68k: Replace DISAS_TB_JUMP with DISAS_NORETURN
  target/m68k: Use DISAS_NORETURN for exceptions

Signed-off-by: Peter Maydell <[email protected]>
6 years agotarget/m68k: Merge disas_m68k_insn into m68k_tr_translate_insn
Richard Henderson [Sat, 12 May 2018 05:02:50 +0000 (22:02 -0700)]
target/m68k: Merge disas_m68k_insn into m68k_tr_translate_insn

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Improve ending TB at page boundaries
Richard Henderson [Sat, 12 May 2018 05:02:49 +0000 (22:02 -0700)]
target/m68k: Improve ending TB at page boundaries

Rather than limit total TB size to PAGE-32 bytes, end the TB when
near the end of a page.  This should provide proper semantics of
SIGSEGV when executing near the end of a page.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Convert to TranslatorOps
Richard Henderson [Sat, 12 May 2018 05:02:48 +0000 (22:02 -0700)]
target/m68k: Convert to TranslatorOps

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Convert to DisasContextBase
Richard Henderson [Sat, 12 May 2018 05:02:47 +0000 (22:02 -0700)]
target/m68k: Convert to DisasContextBase

Removed ctx->insn_pc in favour of ctx->base.pc_next.
Yes, it is annoying, but didn't want to waste its 4 bytes.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging
Peter Maydell [Mon, 11 Jun 2018 10:12:46 +0000 (11:12 +0100)]
Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

Pull request

# gpg: Signature made Fri 08 Jun 2018 18:46:24 BST
# gpg:                using RSA key 7DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <[email protected]>"
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jnsnow/tags/ide-pull-request: (30 commits)
  ide: introduce ide_transfer_start_norecurse
  atapi: call ide_set_irq before ide_transfer_start
  ide: make ide_transfer_stop idempotent
  ide: call ide_cmd_done from ide_transfer_stop
  ide: push end_transfer_func out of start_transfer callback, rename callback
  ahci: move PIO Setup FIS before transfer, fix it for ATAPI commands
  libqos/ahci: track sector size
  MAINTAINERS: Add the cdrom-test to John's section
  tests/cdrom-test: Test that -cdrom parameter is working
  tests/cdrom-test: Test booting from CD-ROM ISO image file
  tests/boot-sector: Add magic bytes to s390x boot code header
  ahci: make ahci_mem_write traces more descriptive
  ahci: delete old host register address definitions
  ahci: adjust ahci_mem_write to work on registers
  ahci: fix spacing damage on ahci_mem_write
  ahci: make mem_read_32 traces more descriptive
  ahci: modify ahci_mem_read_32 to work on register numbers
  ahci: fix host register max address
  ahci: add host register enumeration
  ahci: delete old port register address definitions
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agotarget/m68k: Rename DISAS_UPDATE and gen_lookup_tb
Richard Henderson [Sat, 12 May 2018 05:02:46 +0000 (22:02 -0700)]
target/m68k: Rename DISAS_UPDATE and gen_lookup_tb

The name gen_lookup_tb is at odds with tcg_gen_lookup_and_goto_tb.
For these cases, we do indeed want to exit back to the main loop.
Similarly, DISAS_UPDATE performs no actual update, whereas DISAS_EXIT
does what it says.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Use lookup_and_goto_tb for DISAS_JUMP
Richard Henderson [Sat, 12 May 2018 05:02:45 +0000 (22:02 -0700)]
target/m68k: Use lookup_and_goto_tb for DISAS_JUMP

These are all indirect or out-of-page direct jumps.
We can indirectly chain to the next TB without going
back to the main loop.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Remove DISAS_JUMP_NEXT as unused
Richard Henderson [Sat, 12 May 2018 05:02:44 +0000 (22:02 -0700)]
target/m68k: Remove DISAS_JUMP_NEXT as unused

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Replace DISAS_TB_JUMP with DISAS_NORETURN
Richard Henderson [Sat, 12 May 2018 05:02:43 +0000 (22:02 -0700)]
target/m68k: Replace DISAS_TB_JUMP with DISAS_NORETURN

We have exited the TB after using goto_tb; there is no
distinction from DISAS_NORETURN.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agotarget/m68k: Use DISAS_NORETURN for exceptions
Richard Henderson [Sat, 12 May 2018 05:02:42 +0000 (22:02 -0700)]
target/m68k: Use DISAS_NORETURN for exceptions

The raise_exception helper does not return.  Do not generate
any code following that.

Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20180512050250[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
6 years agopc: Remove PC_COMPAT_2_12 from 3.0 machine-types
Eduardo Habkost [Fri, 8 Jun 2018 19:29:40 +0000 (16:29 -0300)]
pc: Remove PC_COMPAT_2_12 from 3.0 machine-types

commit f548222c added PC_COMPAT_2_12 to the 3.0 PC machine-types.
I believe this happened during manual conflict resolution when
applying the patch.

Cc: Xiao Guangrong <[email protected]>
Cc: Juan Quintela <[email protected]>
Fixes: f548222c24342ca74689de7794f9006b43f86a54
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608192940[email protected]>
Reviewed-by: Marcel Apfelbaum<[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: Remove scripts/ordereddict.py
Eduardo Habkost [Fri, 8 Jun 2018 17:52:52 +0000 (14:52 -0300)]
python: Remove scripts/ordereddict.py

Python 2.7 (the minimum Python version we require) provides
collections.OrderedDict on the standard library, so we don't need
to carry our own implementation.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608175252[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: Remove scripts/argparse.py
Eduardo Habkost [Fri, 8 Jun 2018 17:52:51 +0000 (14:52 -0300)]
python: Remove scripts/argparse.py

Python 2.7 (the minimum Python version we require) already
provides the argparse module on the standard library.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608175252[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoconfigure: Require Python 2.7 or newer
Eduardo Habkost [Fri, 8 Jun 2018 14:30:26 +0000 (11:30 -0300)]
configure: Require Python 2.7 or newer

All of the supported build platforms documented in qemu-doc.texi
should already support Python 2.7.

Removing support for Python 2.6 will allow us to remove some
compatibility modules we carry in the QEMU tree:

* scripts/argparse.py
* scripts/ordereddict.py

Python 2.6 is also not receiving bug fixes upstream and is not
supported by pylint, which makes it harder to keep the code
compatible with both Python 2 and Python 3.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608143026[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Cleber Rosa <[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoi386: Populate AMD Processor Cache Information for cpuid 0x8000001D
Babu Moger [Thu, 24 May 2018 15:43:31 +0000 (11:43 -0400)]
i386: Populate AMD Processor Cache Information for cpuid 0x8000001D

Add information for cpuid 0x8000001D leaf. Populate cache topology information
for different cache types (Data Cache, Instruction Cache, L2 and L3) supported
by 0x8000001D leaf. Please refer to the Processor Programming Reference (PPR)
for AMD Family 17h Model for more details.

Signed-off-by: Babu Moger <[email protected]>
Message-Id: <1527176614[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoi386: Clean up cache CPUID code
Eduardo Habkost [Thu, 24 May 2018 15:43:30 +0000 (11:43 -0400)]
i386: Clean up cache CPUID code

Always initialize CPUCaches structs with cache information, even
if legacy_cache=true.  Use different CPUCaches struct for
CPUID[2], CPUID[4], and the AMD CPUID leaves.

This will simplify a lot the logic inside cpu_x86_cpuid().

Signed-off-by: Eduardo Habkost <[email protected]>
Signed-off-by: Babu Moger <[email protected]>
Message-Id: <1527176614[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_numliterals
Eduardo Habkost [Fri, 8 Jun 2018 12:29:52 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_numliterals

Convert octal literals into the new syntax.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_numliterals $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_except
Eduardo Habkost [Fri, 8 Jun 2018 12:29:51 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_except

Convert "except X, T" to "except X as T".

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_except $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_renames
Eduardo Habkost [Fri, 8 Jun 2018 12:29:50 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_renames

Change sys.maxint to sys.maxsize.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_renames $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_tuple_params
Eduardo Habkost [Fri, 8 Jun 2018 12:29:49 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_tuple_params

Remove implicit tuple parameter unpacking.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_tuple_params $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_reduce
Eduardo Habkost [Fri, 8 Jun 2018 12:29:48 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_reduce

Handle the move of reduce() to functools.reduce().

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_reduce $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_standarderror
Eduardo Habkost [Fri, 8 Jun 2018 12:29:47 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_standarderror

Rename StandardError to Exception.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_standarderror $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f lib2to3.fixes.fix_has_key
Eduardo Habkost [Fri, 8 Jun 2018 12:29:46 +0000 (09:29 -0300)]
python: futurize -f lib2to3.fixes.fix_has_key

Change "dict.has_key(key)" to "key in dict"

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f lib2to3.fixes.fix_has_key $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f libfuturize.fixes.fix_next_call
Eduardo Habkost [Fri, 8 Jun 2018 12:29:45 +0000 (09:29 -0300)]
python: futurize -f libfuturize.fixes.fix_next_call

Change obj.next() calls to next(obj).

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f libfuturize.fixes.fix_next_call $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f libfuturize.fixes.fix_absolute_import
Eduardo Habkost [Fri, 8 Jun 2018 12:29:44 +0000 (09:29 -0300)]
python: futurize -f libfuturize.fixes.fix_absolute_import

Make implicit relative imports explicit and add "from __future__ import
absolute_import" at the top of each relevant module.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f libfuturize.fixes.fix_absolute_import $py

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agopython: futurize -f libfuturize.fixes.fix_print_with_import
Eduardo Habkost [Fri, 8 Jun 2018 12:29:43 +0000 (09:29 -0300)]
python: futurize -f libfuturize.fixes.fix_print_with_import

Change all Python code to use print as a function.

This is necessary for Python 3 compatibility.

Done using:

  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
    sort -u | grep -v README.sh4)
  $ futurize -w -f libfuturize.fixes.fix_print_with_import $py

Reviewed-by: Stefan Hajnoczi <[email protected]>
Acked-by: Fam Zheng <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20180608122952[email protected]>
[ehabkost: fixup tests/docker/docker.py]
Signed-off-by: Eduardo Habkost <[email protected]>
6 years agoide: introduce ide_transfer_start_norecurse
Paolo Bonzini [Wed, 6 Jun 2018 19:09:55 +0000 (15:09 -0400)]
ide: introduce ide_transfer_start_norecurse

For the case where the end_transfer_func is also the caller of
ide_transfer_start, the mutual recursion can lead to unlimited
stack usage.  Introduce a new version that can be used to change
tail recursion into a loop, and use it in trace_ide_atapi_cmd_reply_end.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoatapi: call ide_set_irq before ide_transfer_start
Paolo Bonzini [Wed, 6 Jun 2018 19:09:54 +0000 (15:09 -0400)]
atapi: call ide_set_irq before ide_transfer_start

The ATAPI_INT_REASON_IO interrupt is raised when I/O starts, but in the
AHCI case ide_set_irq was actually called at the end of a mutual recursion.
Move it early, with the side effect that ide_transfer_start becomes a tail
call in ide_atapi_cmd_reply_end.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoide: make ide_transfer_stop idempotent
Paolo Bonzini [Wed, 6 Jun 2018 19:09:53 +0000 (15:09 -0400)]
ide: make ide_transfer_stop idempotent

There is code checking s->end_transfer_func and it was not taught about
ide_transfer_cancel.  We can just use ide_transfer_stop because
s->end_transfer_func is only ever called in the DRQ phase.

ide_transfer_cancel can then be removed, since it would just be
calling ide_transfer_halt.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoide: call ide_cmd_done from ide_transfer_stop
Paolo Bonzini [Wed, 6 Jun 2018 19:09:52 +0000 (15:09 -0400)]
ide: call ide_cmd_done from ide_transfer_stop

The code can simply be moved to the sole caller that has notify == true.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoide: push end_transfer_func out of start_transfer callback, rename callback
Paolo Bonzini [Wed, 6 Jun 2018 19:09:51 +0000 (15:09 -0400)]
ide: push end_transfer_func out of start_transfer callback, rename callback

Now that end_transfer_func is a tail call in ahci_start_transfer,
formalize the fact that the callback (of which ahci_start_transfer is
the sole implementation) takes care of the transfer too: rename it to
pio_transfer and, if it is present, call the end_transfer_func as soon
as it returns.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: move PIO Setup FIS before transfer, fix it for ATAPI commands
John Snow [Wed, 6 Jun 2018 19:09:50 +0000 (15:09 -0400)]
ahci: move PIO Setup FIS before transfer, fix it for ATAPI commands

The PIO Setup FIS is written in the PIO:Entry state, which comes before
the ATA and ATAPI data transfer states.  As a result, the PIO Setup FIS
interrupt is now raised before DMA ends for ATAPI commands, and tests have
to be adjusted.

This is also hinted by the description of the command header in the AHCI
specification, where the "A" bit is described as

    When ‘1’, indicates that a PIO setup FIS shall be sent by the device
    indicating a transfer for the ATAPI command.

and also by the description of the ACMD (ATAPI command region):

    The ATAPI command must be either 12 or 16 bytes in length. The length
    transmitted by the HBA is determined by the PIO setup FIS that is sent
    by the device requesting the ATAPI command.

QEMU, which conflates the "generator" and the "receiver" of the FIS into
one device, always uses ATAPI_PACKET_SIZE, aka 12, for the length.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agolibqos/ahci: track sector size
John Snow [Wed, 6 Jun 2018 19:09:49 +0000 (15:09 -0400)]
libqos/ahci: track sector size

It's not always 512, and it does wind up mattering for PIO tranfers,
because this means DRQ blocks are four times as big for ATAPI.
Replace an instance of 2048 with the correct define, too.

This patch by itself winds changing no behavior. fis->count is ignored
for CMD_PACKET, and sect_count only gets used in non-ATAPI cases.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606190955[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoMAINTAINERS: Add the cdrom-test to John's section
Thomas Huth [Fri, 8 Jun 2018 17:17:39 +0000 (13:17 -0400)]
MAINTAINERS: Add the cdrom-test to John's section

The cdrom-test checks various block types - IDE, SCSI and
virtio, so it's a little bit hard to decide where this should
belong to in the MAINTAINERS file. But John volunteered to take
it, so let's put it into the IDE section for now.

Signed-off-by: Thomas Huth <[email protected]>
Acked-by: John Snow <[email protected]>
Signed-off-by: John Snow <[email protected]>
6 years agotests/cdrom-test: Test that -cdrom parameter is working
Thomas Huth [Fri, 8 Jun 2018 17:17:39 +0000 (13:17 -0400)]
tests/cdrom-test: Test that -cdrom parameter is working

Commit 1454509726719e0933c800 recently broke the "-cdrom" parameter
on a couple of boards without us noticing it immediately. Thus let's
add a test which checks that "-cdrom" can at least be used to start
QEMU with certain machine types.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Hervé Poussineau <[email protected]>
Acked-By: Mark Cave-Ayland <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: John Snow <[email protected]>
6 years agotests/cdrom-test: Test booting from CD-ROM ISO image file
Thomas Huth [Fri, 8 Jun 2018 17:17:39 +0000 (13:17 -0400)]
tests/cdrom-test: Test booting from CD-ROM ISO image file

We already have the code for a boot file in tests/boot-sector.c,
so if the genisoimage program is available, we can easily create
a bootable CD ISO image that we can use for testing whether our
CD-ROM emulation and the BIOS CD-ROM boot works correctly.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Hervé Poussineau <[email protected]>
Acked-By: Mark Cave-Ayland <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: John Snow <[email protected]>
6 years agotests/boot-sector: Add magic bytes to s390x boot code header
Thomas Huth [Fri, 8 Jun 2018 17:17:39 +0000 (13:17 -0400)]
tests/boot-sector: Add magic bytes to s390x boot code header

We're going to use the s390x boot code for testing CD-ROM booting.
But the ISO loader of the s390-ccw bios is a little bit more picky
than the network loader and expects some magic bytes in the header
of the file (see linux_s390_magic in pc-bios/s390-ccw/bootmap.c), so
we've got to add them in our boot code here, too.

Reviewed-by: Christian Borntraeger <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Hervé Poussineau <[email protected]>
Acked-By: Mark Cave-Ayland <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: John Snow <[email protected]>
6 years agoahci: make ahci_mem_write traces more descriptive
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: make ahci_mem_write traces more descriptive

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180531222835[email protected]
[Fixed format specifiers. --js]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: delete old host register address definitions
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: delete old host register address definitions

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180531222835[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: adjust ahci_mem_write to work on registers
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: adjust ahci_mem_write to work on registers

Actually, this function looks pretty broken, but for now, let's finish
up what this series of commits came here to do.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180531222835[email protected]
Signed-off-by: John Snow <[email protected]>
This page took 0.100175 seconds and 4 git commands to generate.