]> Git Repo - qemu.git/log
qemu.git
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 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]>
6 years agoahci: fix spacing damage on ahci_mem_write
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: fix spacing damage on ahci_mem_write

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: make mem_read_32 traces more descriptive
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: make mem_read_32 traces more descriptive

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: modify ahci_mem_read_32 to work on register numbers
John Snow [Fri, 8 Jun 2018 17:17:38 +0000 (13:17 -0400)]
ahci: modify ahci_mem_read_32 to work on register numbers

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: fix host register max address
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: fix host register max address

Yes, comment, it ought to be 0x2C.

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: add host register enumeration
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: add host register enumeration

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: delete old port register address definitions
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: delete old port register address definitions

They're now unused.

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: make port write traces more descriptive
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: make port write traces more descriptive

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180531222835[email protected]
[Changed format specifier. --js]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: modify ahci_port_write to use register numbers
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: modify ahci_port_write to use register numbers

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: combine identical clauses in port write
John Snow [Fri, 8 Jun 2018 17:17:37 +0000 (13:17 -0400)]
ahci: combine identical clauses in port write

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: fix spacing damage on ahci_port_write
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: fix spacing damage on ahci_port_write

Churn.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180531222835[email protected]
[Fix patchew/checkpatch nit. --js]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: make port read traces more descriptive
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: make port read traces more descriptive

A trace is added to let us watch unimplemented registers specifically,
as these are more likely to cause us trouble. Otherwise, the port read
traces now tell us what register is getting hit, which is nicer.

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: modify ahci_port_read to use register numbers
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: modify ahci_port_read to use register numbers

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: add port register enumeration
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: add port register enumeration

Instead of tracking offsets, lets count the registers.

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: don't schedule unnecessary BH
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: don't schedule unnecessary BH

The comment gives us a hint. *Maybe* we still have something to
process. Well, why not check?

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180531004323[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: fix PxCI register race
John Snow [Fri, 8 Jun 2018 17:17:36 +0000 (13:17 -0400)]
ahci: fix PxCI register race

Fixes: https://bugs.launchpad.net/qemu/+bug/1769189
AHCI presently signals completion prior to the PxCI register being
cleared to indicate completion. If a guest driver attempts to issue
a new command in its IRQ handler, it might be surprised to learn there
is still a command pending.

In the case of Windows 10's boot driver, it will actually poll the IRQ
register hoping to find out when the command is done running -- which
will never happen, as there isn't a command running.

Fix this: clear PxCI in ahci_cmd_done and not in the asynchronous BH.
Because it now runs synchronously, we don't need to check if the command
is actually done by spying on the ATA registers. We know it's done.

CC: qemu-stable <[email protected]>
Reported-by: François Guerraz <[email protected]>
Tested-by: Bruce Rogers <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180531004323[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoahci: trim signatures on raise/lower
John Snow [Fri, 8 Jun 2018 17:17:35 +0000 (13:17 -0400)]
ahci: trim signatures on raise/lower

These functions work on the AHCI device, not the individual
AHCI devices, so trim the AHCIDevice argument.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 20180531004323[email protected]
Signed-off-by: John Snow <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180608' into...
Peter Maydell [Fri, 8 Jun 2018 15:26:51 +0000 (16:26 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180608' into staging

target-arm queue:
 * arm_gicv3_kvm: fix migration of registers corresponding to
   IRQs 992 to 1020 in the KVM GIC
 * aspeed: remove ignore_memory_transaction_failures on all boards
 * aspeed: add support for the witherspoon-bmc board
 * aspeed: add an I2C RTC device and EEPROM I2C devices
 * aspeed: add the pc9552 chips to the witherspoon machine
 * ftgmac100: fix various bugs
 * hw/arm: Remove the deprecated xlnx-ep108 machine
 * hw/i2c: Add trace events
 * add missing '\n' on various qemu_log() logging strings
 * sdcard: clean up spec version support so we report the
   right spec version to the guest and only implement the
   commands that are supposed to be present in that version

# gpg: Signature made Fri 08 Jun 2018 13:36:37 BST
# gpg:                using RSA key 3C2525ED14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20180608: (31 commits)
  sdcard: Disable CMD19/CMD23 for Spec v2
  sdcard: Reflect when the Spec v3 is supported in the Config Register (SCR)
  sdcard: Disable SEND_IF_COND (CMD8) for Spec v1
  sdcard: Add a 'spec_version' property, default to Spec v2.00
  sdcard: Allow commands valid in SPI mode
  sdcard: Update the Configuration Register (SCR) to Spec Version 1.10
  target/xtensa: Add trailing '\n' to qemu_log() calls
  RISC-V: Add trailing '\n' to qemu_log() calls
  target/m68k: Add trailing '\n' to qemu_log() call
  target/arm: Add trailing '\n' to qemu_log() calls
  stellaris: Add trailing '\n' to qemu_log() calls
  hw/mips/boston: Add trailing '\n' to qemu_log() calls
  hw/core/register: Add trailing '\n' to qemu_log() call
  ppc/pnv: Add trailing '\n' to qemu_log() calls
  xilinx-dp: Add trailing '\n' to qemu_log() call
  hw/digic: Add trailing '\n' to qemu_log() calls
  hw/sd/milkymist-memcard: Add trailing '\n' to qemu_log() call
  hw/i2c: Add trace events
  hw/arm: Remove the deprecated xlnx-ep108 machine
  ftgmac100: remove check on runt messages
  ...

Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Disable CMD19/CMD23 for Spec v2
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:34 +0000 (13:15 +0100)]
sdcard: Disable CMD19/CMD23 for Spec v2

These commands got introduced by Spec v3
(see 0c3fb03f7ec and 4481bbc79d2).

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180607180641[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Reflect when the Spec v3 is supported in the Config Register (SCR)
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:34 +0000 (13:15 +0100)]
sdcard: Reflect when the Spec v3 is supported in the Config Register (SCR)

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20180607180641[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Disable SEND_IF_COND (CMD8) for Spec v1
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:34 +0000 (13:15 +0100)]
sdcard: Disable SEND_IF_COND (CMD8) for Spec v1

CMD8 is "Reserved" in Spec v1.10.

Spec v2.00 introduces the SEND_IF_COND command:

  6.4.1 Power Up

    CMD8 is newly added in the Physical Layer Specification Version
    2.00 to support multiple voltage ranges and used to check whether
    the card supports supplied voltage. The version 2.00 or later host
    shall issue CMD8 and verify voltage before card initialization.
    The host that does not support CMD8 shall supply high voltage range.

Message-Id: 201204252110[email protected]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180607180641[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Add a 'spec_version' property, default to Spec v2.00
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
sdcard: Add a 'spec_version' property, default to Spec v2.00

As of this commit, the Spec v1 is not working, and all controllers
expect the cards to be conformant to Spec v2.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20180607180641[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Allow commands valid in SPI mode
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
sdcard: Allow commands valid in SPI mode

From the "Physical Layer Simplified Specification Version 1.10"
  Chapter 7.3 "SPI Mode Transaction Packets"
    Table 57: "Commands and arguments"

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Alistair Francis <[email protected]>
Message-id: 20180607180641[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agosdcard: Update the Configuration Register (SCR) to Spec Version 1.10
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
sdcard: Update the Configuration Register (SCR) to Spec Version 1.10

The initial implementation is based on the Specs v1.10 (see a1bb27b1e98).

However the SCR is anouncing the card being v1.01.

The new chapters added in version 1.10 are:

    4.3.10 Switch function command

    Switch function command (CMD6) 1 is used to switch or expand
    memory card functions. [...]
    This is a new feature, introduced in SD physical Layer
    Specification Version 1.10. Therefore, cards that are
    compatible with earlier versions of the spec do not support
    it. The host shall check the "SD_SPEC" field in the SCR
    register to recognize what version of the spec the card
    complies with before using CMD6. It is mandatory for SD
    memory card of Ver1.10 to support CMD6.

    4.3.11 High-Speed mode (25MB/sec interface speed)

    Though the Rev 1.01 SD memory card supports up to 12.5MB/sec
    interface speed, the speed of 25MB/sec is necessary to support
    increasing performance needs of the host and because of memory
    size which continues to grow.
    To achieve 25MB/sec interface speed, clock rate is increased to
    50MHz and CLK/CMD/DAT signal timing and circuit conditions are
    reconsidered and changed from Physical Layer Specification
    Version 1.01.

    4.3.12 Command system (This chapter is newly added in version 1.10)

    SD commands CMD34-37, CMD50, CMD57 are reserved for SD command
    system expansion via the switch command.
    [These commands] will be considered as illegal commands (as
    defined in revision 1.01 of the SD physical layer specification).

The SWITCH_FUNCTION is implemented since the first commit, a1bb27b1e98.

The 25MB/sec High-Speed mode was already updated in d7ecb867529.

The current implementation does not implements CMD34-37, CMD50 and
CMD57, thus these commands already return ILLEGAL.

With this patch, the SCR register now matches the description of the header:

 * SD Memory Card emulation as defined in the "SD Memory Card Physical
 * layer specification, Version 1.10."

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180607180641[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agotarget/xtensa: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
target/xtensa: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Max Filippov <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoRISC-V: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
RISC-V: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agotarget/m68k: Add trailing '\n' to qemu_log() call
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
target/m68k: Add trailing '\n' to qemu_log() call

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agotarget/arm: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
target/arm: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agostellaris: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
stellaris: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/mips/boston: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
hw/mips/boston: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/core/register: Add trailing '\n' to qemu_log() call
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
hw/core/register: Add trailing '\n' to qemu_log() call

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoppc/pnv: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
ppc/pnv: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: David Gibson <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoxilinx-dp: Add trailing '\n' to qemu_log() call
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
xilinx-dp: Add trailing '\n' to qemu_log() call

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20180606152128[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/digic: Add trailing '\n' to qemu_log() calls
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
hw/digic: Add trailing '\n' to qemu_log() calls

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/sd/milkymist-memcard: Add trailing '\n' to qemu_log() call
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
hw/sd/milkymist-memcard: Add trailing '\n' to qemu_log() call

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606152128[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/i2c: Add trace events
Philippe Mathieu-Daudé [Fri, 8 Jun 2018 12:15:33 +0000 (13:15 +0100)]
hw/i2c: Add trace events

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180606191801[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agohw/arm: Remove the deprecated xlnx-ep108 machine
Thomas Huth [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
hw/arm: Remove the deprecated xlnx-ep108 machine

It has been marked as deprecated since QEMU v2.11, so it is time to
remove this now. The xlnx-zcu102 machine is very much the same and
can be used as a replacement instead.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agoftgmac100: remove check on runt messages
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
ftgmac100: remove check on runt messages

This is a ethernet wire limitation not needed in emulation. It breaks
U-Boot n/w stack also.

Signed-off-by: Cédric Le Goater <[email protected]>
Message-id: 20180530061711[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agoftgmac100: fix multicast hash routine
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
ftgmac100: fix multicast hash routine

Based on the multicast hash calculation of the FTGMAC100 Linux driver.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530061711[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoftgmac100: add IEEE 802.1Q VLAN support
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
ftgmac100: add IEEE 802.1Q VLAN support

The ftgmac100 NIC supports VLAN tag insertion and the MAC engine also
has a control to remove VLAN tags from received packets.

The VLAN control bits and VLAN tag information are contained in the
second word of the transmit and receive descriptors. The Insert VLAN
bit and the VLAN Tag available bit are only valid in the first segment
of the packet.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530061711[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoftgmac100: compute maximum frame size depending on the protocol
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
ftgmac100: compute maximum frame size depending on the protocol

The maximum frame size includes the CRC and depends if a VLAN tag is
inserted or not. Adjust the frame size limit in the transmit handler
using on the FTGMAC100State buffer size and in the receive handler use
the packet protocol.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530061711[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoaspeed: add the pc9552 chips to the witherspoon machine
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
aspeed: add the pc9552 chips to the witherspoon machine

The pca9552 LED blinkers on the Witherspoon machine are used for leds
but also as GPIOs to control fans and GPUs.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agomisc: add pca9552 LED blinker model
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
misc: add pca9552 LED blinker model

Specs are available here :

    https://www.nxp.com/docs/en/application-note/AN264.pdf

This is a simple model supporting the basic registers for led and GPIO
mode. The device also supports two blinking rates but not the model
yet.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoaspeed: Add EEPROM I2C devices
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
aspeed: Add EEPROM I2C devices

The Aspeed boards have at least one EEPROM to hold the Vital Product
Data (VPD).

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agosmbus: add a smbus_eeprom_init_one() routine
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
smbus: add a smbus_eeprom_init_one() routine

This is an helper routine to add a single EEPROM on an I2C bus. It can
be directly used by smbus_eeprom_init() which adds a certain number of
EEPROMs on mips and x86 machines.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoaspeed: add an I2C RTC device to all machines
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
aspeed: add an I2C RTC device to all machines

The AST2500 EVB does not have an RTC but we can pretend that one is
plugged on the I2C bus header.

The romulus and witherspoon boards expects an Epson RX8900 I2C RTC but
a ds1338 is good enough for the basic features we need.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoaspeed: add support for the witherspoon-bmc board
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
aspeed: add support for the witherspoon-bmc board

The Witherspoon boards are OpenPOWER system hosting POWER9 Processors.
Add support for their BMC including a couple of I2C devices as found
on real HW.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoaspeed: remove ignore_memory_transaction_failures on all boards
Cédric Le Goater [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
aspeed: remove ignore_memory_transaction_failures on all boards

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: 20180530064049[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agoarm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR
Shannon Zhao [Fri, 8 Jun 2018 12:15:32 +0000 (13:15 +0100)]
arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR

While we skip the GIC_INTERNAL irqs, we don't change the register offset
accordingly. This will overlap the GICR registers value and leave the
last GIC_INTERNAL irq's registers out of update.

Fix this by skipping the registers banked by GICR.

Also for migration compatibility if the migration source (old version
qemu) doesn't send gicd_no_migration_shift_bug = 1 to destination, then
we shift the data of PPI to get the right data for SPI.

Fixes: 367b9f527becdd20ddf116e17a3c0c2bbc486920
Cc: [email protected]
Reviewed-by: Eric Auger <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Shannon Zhao <[email protected]>
Message-id: 1527816987[email protected]
Signed-off-by: Peter Maydell <[email protected]>
6 years agochardev: Restore CR,LF on stdio
Philippe Mathieu-Daudé [Thu, 7 Jun 2018 21:08:18 +0000 (18:08 -0300)]
chardev: Restore CR,LF on stdio

Remove the 'stair-step output' on stdio.

This partially reverts commit 12fb0ac05, which was correct
on the mailing list but got corrupted by the maintainer :p

Introduced-by: [email protected]
Reported-by: BALATON Zoltan <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Tested-by: Laurent Desnogues <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20180607210818[email protected]
Suggested-by: Thomas Huth <[email protected]>
Tested-by: Laurent Desnogues <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
Peter Maydell [Fri, 8 Jun 2018 09:26:16 +0000 (10:26 +0100)]
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging

slirp updates

Prasad J Pandit (2):
  slirp: Fix buffer overflow on packet reassembling

Samuel Thibault (3):
  slirp: Add Samuel Thibault's staging tree for slirp
  slirp: fix domainname version availability

# gpg: Signature made Fri 08 Jun 2018 07:12:24 BST
# gpg:                using RSA key 996849C1CF560478
# gpg: Good signature from "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# gpg:                 aka "Samuel Thibault <[email protected]>"
# 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: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
#      Subkey fingerprint: 3A3A 5D46 4660 E867 610C  A427 9968 49C1 CF56 0478

* remotes/thibault/tags/samuel-thibault:
  slirp: reformat m_inc routine
  slirp: correct size computation while concatenating mbuf
  slirp: fix domainname version availability
  slirp: Add Samuel Thibault's staging tree for slirp
  slirp: Fix spurious error report when sending directly

Signed-off-by: Peter Maydell <[email protected]>
6 years agoslirp: reformat m_inc routine
Prasad J Pandit [Tue, 5 Jun 2018 18:08:35 +0000 (23:38 +0530)]
slirp: reformat m_inc routine

Coding style changes to the m_inc routine and minor refactoring.

Reported-by: ZDI Disclosures <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Signed-off-by: Samuel Thibault <[email protected]>
6 years agoslirp: correct size computation while concatenating mbuf
Prasad J Pandit [Tue, 5 Jun 2018 18:08:35 +0000 (23:38 +0530)]
slirp: correct size computation while concatenating mbuf

While reassembling incoming fragmented datagrams, 'm_cat' routine
extends the 'mbuf' buffer, if it has insufficient room. It computes
a wrong buffer size, which leads to overwriting adjacent heap buffer
area. Correct this size computation in m_cat.

Reported-by: ZDI Disclosures <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Signed-off-by: Samuel Thibault <[email protected]>
6 years agoslirp: fix domainname version availability
Samuel Thibault [Thu, 31 May 2018 19:51:02 +0000 (21:51 +0200)]
slirp: fix domainname version availability

The change missed the 2.12 deadline.

Signed-off-by: Samuel Thibault <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
6 years agoslirp: Add Samuel Thibault's staging tree for slirp
Samuel Thibault [Thu, 31 May 2018 19:45:10 +0000 (21:45 +0200)]
slirp: Add Samuel Thibault's staging tree for slirp

Signed-off-by: Samuel Thibault <[email protected]>
Acked-by: Thomas Huth <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
Peter Maydell [Thu, 7 Jun 2018 15:22:57 +0000 (16:22 +0100)]
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

Mostly bug fixes and code sanitization motivated by the upcoming
support for Darwin hosts. Thanks to Keno Fischer.

# gpg: Signature made Thu 07 Jun 2018 11:30:56 BST
# gpg:                using RSA key 71D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <[email protected]>"
# gpg:                 aka "Gregory Kurz <[email protected]>"
# gpg:                 aka "[jpeg image of size 3330]"
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz/tags/for-upstream:
  9p: xattr: Properly translate xattrcreate flags
  9p: Properly check/translate flags in unlinkat
  9p: local: Avoid warning if FS_IOC_GETVERSION is not defined
  9p: xattr: Fix crashes due to free of uninitialized value
  9p: Move a couple xattr functions to 9p-util
  9p: local: Properly set errp in fstatfs error path
  9p: proxy: Fix size passed to `connect`

Signed-off-by: Peter Maydell <[email protected]>
6 years ago9p: xattr: Properly translate xattrcreate flags
Keno Fischer [Thu, 7 Jun 2018 10:17:22 +0000 (12:17 +0200)]
9p: xattr: Properly translate xattrcreate flags

As with unlinkat, these flags come from the client and need to
be translated to their host values. The protocol values happen
to match linux, but that need not be true in general.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: Properly check/translate flags in unlinkat
Keno Fischer [Thu, 7 Jun 2018 10:17:22 +0000 (12:17 +0200)]
9p: Properly check/translate flags in unlinkat

The 9p-local code previously relied on P9_DOTL_AT_REMOVEDIR and AT_REMOVEDIR
having the same numerical value and deferred any errorchecking to the
syscall itself. However, while the former assumption is true on Linux,
it is not true in general. 9p-handle did this properly however. Move
the translation code to the generic 9p server code and add an error
if unrecognized flags are passed.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: local: Avoid warning if FS_IOC_GETVERSION is not defined
Keno Fischer [Thu, 7 Jun 2018 10:17:22 +0000 (12:17 +0200)]
9p: local: Avoid warning if FS_IOC_GETVERSION is not defined

Both `stbuf` and `local_ioc_getversion` where unused when
FS_IOC_GETVERSION was not defined, causing a compiler warning.

Reorganize the code to avoid this warning.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: xattr: Fix crashes due to free of uninitialized value
Keno Fischer [Thu, 7 Jun 2018 10:17:22 +0000 (12:17 +0200)]
9p: xattr: Fix crashes due to free of uninitialized value

If the size returned from llistxattr/lgetxattr is 0, we skipped
the malloc call, leaving xattr.value uninitialized. However, this
value is later passed to `g_free` without any further checks,
causing an error. Fix that by always calling g_malloc unconditionally.
If `size` is 0, it will return NULL, which is safe to pass to g_free.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: Move a couple xattr functions to 9p-util
Keno Fischer [Thu, 7 Jun 2018 10:17:22 +0000 (12:17 +0200)]
9p: Move a couple xattr functions to 9p-util

These functions will need custom implementations on Darwin. Since the
implementation is very similar among all of them, and 9p-util already
has the _nofollow version of fgetxattrat, let's move them all there.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: local: Properly set errp in fstatfs error path
Keno Fischer [Thu, 7 Jun 2018 10:17:21 +0000 (12:17 +0200)]
9p: local: Properly set errp in fstatfs error path

In the review of

    9p: Avoid warning if FS_IOC_GETVERSION is not defined

Grep Kurz noted this error path was failing to set errp.
Fix that.

Signed-off-by: Keno Fischer <[email protected]>
[added local: to commit title, Greg Kurz]
Signed-off-by: Greg Kurz <[email protected]>
6 years ago9p: proxy: Fix size passed to `connect`
Keno Fischer [Thu, 7 Jun 2018 10:17:21 +0000 (12:17 +0200)]
9p: proxy: Fix size passed to `connect`

The size to pass to the `connect` call is the size of the entire
`struct sockaddr_un`. Passing anything shorter than this causes errors
on darwin.

Signed-off-by: Keno Fischer <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-06-06-1' into...
Peter Maydell [Thu, 7 Jun 2018 08:55:42 +0000 (09:55 +0100)]
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-06-06-1' into staging

Merge tpm 2018/06/06 v1

# gpg: Signature made Wed 06 Jun 2018 20:48:33 BST
# gpg:                using RSA key 75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <[email protected]>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2018-06-06-1:
  test: Add swtpm migration test for the TPM TIS interface
  test: Pass TPM interface model to functions creating command line
  test: Move common TPM test functions to tpm-tests.c
  test: Move reusable code from tpm-crb-swtpm-test.c to tpm-util.c

Signed-off-by: Peter Maydell <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20180605.0' into...
Peter Maydell [Thu, 7 Jun 2018 07:59:28 +0000 (08:59 +0100)]
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20180605.0' into staging

VFIO updates 2018-06-05

 - Removed unused DPRINTF (Tiwei Bie)
 - KVM & VFIO ioeventfd support for NVIDIA MSI ACK (Alex Williamson)
 - Default vfio-pci display support to "off" (Alex Williamson)

# gpg: Signature made Tue 05 Jun 2018 20:51:14 BST
# gpg:                using RSA key 239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-update-20180605.0:
  vfio/pci: Default display option to "off"
  vfio/quirks: Enable ioeventfd quirks to be handled by vfio directly
  vfio/quirks: ioeventfd quirk acceleration
  vfio/quirks: Add quirk reset callback
  vfio/quirks: Add common quirk alloc helper
  vfio: remove DPRINTF() definition from vfio-common.h

Signed-off-by: Peter Maydell <[email protected]>
6 years agotest: Add swtpm migration test for the TPM TIS interface
Stefan Berger [Wed, 30 May 2018 17:44:41 +0000 (13:44 -0400)]
test: Add swtpm migration test for the TPM TIS interface

Add a test case for testing swtpm migration with the TPM TIS
interface.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
6 years agotest: Pass TPM interface model to functions creating command line
Stefan Berger [Wed, 30 May 2018 18:31:12 +0000 (14:31 -0400)]
test: Pass TPM interface model to functions creating command line

Pass the TPM interface model, such as 'tpm-crb', through to the functions
that create the command line for QEMU.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
6 years agotest: Move common TPM test functions to tpm-tests.c
Stefan Berger [Wed, 30 May 2018 16:30:26 +0000 (12:30 -0400)]
test: Move common TPM test functions to tpm-tests.c

Move common TPM test functions from tpm-crb-swtpm-test.c to tpm-tests.c
so that for example test cases with the TPM TIS interface can use the
same code. Prefix all funcions with 'tpm_test_'.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
6 years agotest: Move reusable code from tpm-crb-swtpm-test.c to tpm-util.c
Stefan Berger [Wed, 30 May 2018 16:12:50 +0000 (12:12 -0400)]
test: Move reusable code from tpm-crb-swtpm-test.c to tpm-util.c

Move code we can reuse from tpm-crb-swtpm-test.c into tpm-util.c
and prefix functions with 'tpm_util_'.

Remove some unnecessary #include's.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
6 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-docker-updates-050618-1'...
Peter Maydell [Tue, 5 Jun 2018 16:06:23 +0000 (17:06 +0100)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-docker-updates-050618-1' into staging

Docker related updates

  - configure/probe for docker
  - TARGET_DIRS -> TARGET_LIST cleanup
  - new fedora-i386-cross and debian/tricore images
  - test-mingw use SDL2/GTK3

# gpg: Signature made Tue 05 Jun 2018 16:32:53 BST
# gpg:                using RSA key FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <[email protected]>"
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-docker-updates-050618-1:
  docker: add debian/tricore image
  docker: test-mingw: use SDL2 and GTK+3
  docker: Add fedora-i386-cross image
  Makefile: Rename TARGET_DIRS to TARGET_LIST
  configure: add test for docker availability
  docker: add "probe" command for configure

Signed-off-by: Peter Maydell <[email protected]>
6 years agodocker: add debian/tricore image
Philippe Mathieu-Daudé [Wed, 2 May 2018 00:21:43 +0000 (21:21 -0300)]
docker: add debian/tricore image

TriCore binutils is built from Bastian Koppelmann repository.

Note: There is no TriCore compiler in this image (only assembler/linker).

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
[AJB: base of Debian9, add to Makefile.include]
Signed-off-by: Alex Bennée <[email protected]>
6 years agodocker: test-mingw: use SDL2 and GTK+3
Paolo Bonzini [Fri, 16 Mar 2018 12:25:39 +0000 (13:25 +0100)]
docker: test-mingw: use SDL2 and GTK+3

Do not test the deprecated API versions.  debian-win32-cross and debian-win64-cross
are already using SDL2 (they do not cover GTK+ at all).

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
[AJB: fix merge conflicts]
Signed-off-by: Alex Bennée <[email protected]>
6 years agodocker: Add fedora-i386-cross image
Fam Zheng [Fri, 8 Sep 2017 09:16:56 +0000 (17:16 +0800)]
docker: Add fedora-i386-cross image

It has some basic *-devel.i686 packages to be used with "gcc -m32" as a
32 bit cross build environment.

Signed-off-by: Fam Zheng <[email protected]>
[AJB: add glibc-static]
Signed-off-by: Alex Bennée <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
6 years agoMakefile: Rename TARGET_DIRS to TARGET_LIST
Fam Zheng [Fri, 8 Sep 2017 09:16:54 +0000 (17:16 +0800)]
Makefile: Rename TARGET_DIRS to TARGET_LIST

To be more accurate on its purpose and make code that looks for a certain
target out of this variable more readable.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
This page took 0.089613 seconds and 4 git commands to generate.