mbox

[PULL,0/5] Vga 20181012 patches

Message ID 20181012123851.30856-1-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show

Pull-request

git://git.kraxel.org/qemu tags/vga-20181012-pull-request

Message

Gerd Hoffmann Oct. 12, 2018, 12:38 p.m. UTC
The following changes since commit 75e50c80e051423a6f55a34ee4a1eec842444a5b:

  Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into staging (2018-10-11 10:43:37 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/vga-20181012-pull-request

for you to fetch changes up to b398f03c60bb5739ae68c161c315c7cce8ef2fde:

  hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate file (2018-10-12 13:50:38 +0200)

----------------------------------------------------------------
vga: config tweaks, edid updates, qxl bugfix.

----------------------------------------------------------------

Gerd Hoffmann (4):
  display: add separate config option for bochs-display
  bochs-display: wire up edid support
  qxl: check qxl_phys2virt return value
  i2c: switch ddc to use the new edid generator

Thomas Huth (1):
  hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate
    file

 hw/display/cirrus_vga_internal.h | 103 ++++++++++++++++++++
 include/hw/i2c/i2c-ddc.h         |   4 +-
 hw/display/bochs-display.c       |  13 +++
 hw/display/cirrus_vga.c          | 143 +---------------------------
 hw/display/cirrus_vga_isa.c      |  98 +++++++++++++++++++
 hw/display/qxl.c                 |   2 +-
 hw/i2c/i2c-ddc.c                 | 200 ++-------------------------------------
 default-configs/pci.mak          |   1 +
 hw/display/Makefile.objs         |   4 +-
 9 files changed, 235 insertions(+), 333 deletions(-)
 create mode 100644 hw/display/cirrus_vga_internal.h
 create mode 100644 hw/display/cirrus_vga_isa.c

Comments

Peter Maydell Oct. 12, 2018, 3:45 p.m. UTC | #1
On 12 October 2018 at 13:38, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 75e50c80e051423a6f55a34ee4a1eec842444a5b:
>
>   Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into staging (2018-10-11 10:43:37 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/vga-20181012-pull-request
>
> for you to fetch changes up to b398f03c60bb5739ae68c161c315c7cce8ef2fde:
>
>   hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate file (2018-10-12 13:50:38 +0200)
>
> ----------------------------------------------------------------
> vga: config tweaks, edid updates, qxl bugfix.
>
> ----------------------------------------------------------------
>
> Gerd Hoffmann (4):
>   display: add separate config option for bochs-display
>   bochs-display: wire up edid support
>   qxl: check qxl_phys2virt return value
>   i2c: switch ddc to use the new edid generator
>
> Thomas Huth (1):
>   hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate
>     file

Hi. This generates new clang runtime sanitizer errors:

QTEST_QEMU_BINARY=sh4-softmmu/qemu-system-sh4 QTEST_QEMU_IMG=qemu-img
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
gtester -k --verbose -m=quick tests/endianness-test tests/qmp-test
tests/qmp-cmd-test tests/device-introspect-test tests/cdrom-test
tests/machine-none-test tests/qom-test tests/test-hmp
TEST: tests/endianness-test... (pid=19412)
  /sh4/endianness/r2d:
/home/petmay01/linaro/qemu-for-merges/hw/display/edid-generate.c:226:5:
runtime error: store to misaligned address 0x55bc89d7cffe for type
'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
0x55bc89d7cffe: note: pointer points here
 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00
             ^

which are caused by this line in edid_desc_timing():

    *(uint32_t *)(desc) = cpu_to_le32(clock / 10000);

Casting to some pointer type like this is almost never right;
you want instead to just use one of our existing utility
functions for "store to arbitrary memory with correct
endianness and handling alignment". In this case that's
    stl_le_p(desc, clock / 10000);

This also failed to pass 'make check' on SPARC with lots of
bus errors, which are almost certainly the same misaligned
access problem.

There seem to be other instances of the problem in the
same file, eg
    *(uint16_t *)(edid +  8) = cpu_to_be16(vendor_id);
    *(uint16_t *)(edid + 10) = cpu_to_le16(model_nr);
    *(uint32_t *)(edid + 12) = cpu_to_le32(serial_nr);


Could you fix all these and resubmit, please?

thanks
-- PMM