qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 314aec: hostmem-file: reject invalid pmem fil


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 314aec: hostmem-file: reject invalid pmem file sizes
Date: Tue, 12 Mar 2019 09:43:36 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 314aec4a6e06844937f1677f6cba21981005f389
      
https://github.com/qemu/qemu/commit/314aec4a6e06844937f1677f6cba21981005f389
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M backends/hostmem-file.c
    M include/qemu/osdep.h
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  hostmem-file: reject invalid pmem file sizes

Guests started with NVDIMMs larger than the underlying host file produce
confusing errors inside the guest.  This happens because the guest
accesses pages beyond the end of the file.

Check the pmem file size on startup and print a clear error message if
the size is invalid.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1669053
Cc: Wei Yang <address@hidden>
Cc: Zhang Yi <address@hidden>
Cc: Eduardo Habkost <address@hidden>
Cc: Igor Mammedov <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Wei Yang <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Pankaj Gupta <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: c1404bde9cb326a42327c892e25ecbfcce806a3d
      
https://github.com/qemu/qemu/commit/c1404bde9cb326a42327c892e25ecbfcce806a3d
  Author: Eric Auger <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M hw/acpi/nvdimm.c
    M hw/i386/pc.c
    M include/hw/i386/pc.h
    M include/hw/mem/nvdimm.h

  Log Message:
  -----------
  nvdimm: Rename AcpiNVDIMMState into NVDIMMState

As we intend to migrate the acpi_nvdimm_state into
the base machine with a new dimms_state name, let's
also rename the datatype.

Signed-off-by: Eric Auger <address@hidden>
Suggested-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: f6a0d06ba72a0c493e1e05872caf2f3781af316d
      
https://github.com/qemu/qemu/commit/f6a0d06ba72a0c493e1e05872caf2f3781af316d
  Author: Eric Auger <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M hw/core/machine.c
    M hw/i386/acpi-build.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/boards.h
    M include/hw/i386/pc.h

  Log Message:
  -----------
  machine: Move nvdimms state into struct MachineState

As NVDIMM support is looming for ARM and SPAPR, let's
move the acpi_nvdimm_state to the generic machine struct
instead of duplicating the same code in several machines.
It is also renamed into nvdimms_state and becomes a pointer.

nvdimm and nvdimm-persistence become generic machine options.
They become guarded by a nvdimm_supported machine class member.
We also add a description for those options.

Signed-off-by: Eric Auger <address@hidden>
Suggested-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4a66c7a9996bb1bb1191170b172daa54e226d7ff
      
https://github.com/qemu/qemu/commit/4a66c7a9996bb1bb1191170b172daa54e226d7ff
  Author: Ilya Maximets <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M backends/hostmem-memfd.c
    M tests/vhost-user-test.c

  Log Message:
  -----------
  hostmem-memfd: disable for systems without sealing support

If seals are not supported, memfd_create() will fail.
Furthermore, there is no way to disable it in this case because
'.seal' property is not registered.

This issue leads to vhost-user-test failures on RHEL 7.2:

  qemu-system-x86_64: -object memory-backend-memfd,id=mem,size=2M,: \
                      failed to create memfd: Invalid argument

and actually breaks the feature on such systems.

Let's restrict memfd backend to systems with sealing support.

Signed-off-by: Ilya Maximets <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 92db922f66cde45bb216c36eb43b762429c96a74
      
https://github.com/qemu/qemu/commit/92db922f66cde45bb216c36eb43b762429c96a74
  Author: Ilya Maximets <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M util/memfd.c

  Log Message:
  -----------
  memfd: always check for MFD_CLOEXEC

QEMU always sets this flag unconditionally. We need to
check if it's supported.

Signed-off-by: Ilya Maximets <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: df20819328d6fa3cb9d4a259a58cebbee35cdd09
      
https://github.com/qemu/qemu/commit/df20819328d6fa3cb9d4a259a58cebbee35cdd09
  Author: Ilya Maximets <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M util/memfd.c

  Log Message:
  -----------
  memfd: set up correct errno if not supported

qemu_memfd_create() prints the value of 'errno' which is not
set in this case.

Signed-off-by: Ilya Maximets <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: edaed6c711f07267785a05a633d97dc9268a7385
      
https://github.com/qemu/qemu/commit/edaed6c711f07267785a05a633d97dc9268a7385
  Author: Ilya Maximets <address@hidden>
  Date:   2019-03-11 (Mon, 11 Mar 2019)

  Changed paths:
    M util/memfd.c

  Log Message:
  -----------
  memfd: improve error messages

This gives more information about the failure.
Additionally 'ENOSYS' returned for a non-Linux platforms instead of
'errno', which is not initilaized in this case.

Signed-off-by: Ilya Maximets <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2cb73afa6a2408b397a5af1427d120b8aa04997a
      
https://github.com/qemu/qemu/commit/2cb73afa6a2408b397a5af1427d120b8aa04997a
  Author: Peter Maydell <address@hidden>
  Date:   2019-03-12 (Tue, 12 Mar 2019)

  Changed paths:
    M backends/hostmem-file.c
    M backends/hostmem-memfd.c
    M hw/acpi/nvdimm.c
    M hw/core/machine.c
    M hw/i386/acpi-build.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/boards.h
    M include/hw/i386/pc.h
    M include/hw/mem/nvdimm.h
    M include/qemu/osdep.h
    M tests/vhost-user-test.c
    M util/memfd.c
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/ehabkost/tags/machine-next-pull-request' into staging

Machine queue, 2019-03-11

* memfd fixes (Ilya Maximets)
* Move nvdimms state into struct MachineState (Eric Auger)
* hostmem-file: reject invalid pmem file sizes (Stefan Hajnoczi)

# gpg: Signature made Tue 12 Mar 2019 00:57:41 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request:
  memfd: improve error messages
  memfd: set up correct errno if not supported
  memfd: always check for MFD_CLOEXEC
  hostmem-memfd: disable for systems without sealing support
  machine: Move nvdimms state into struct MachineState
  nvdimm: Rename AcpiNVDIMMState into NVDIMMState
  hostmem-file: reject invalid pmem file sizes

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/46316f1dfffc...2cb73afa6a24



reply via email to

[Prev in Thread] Current Thread [Next in Thread]