qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] dcff10: memfd: split qemu_memfd_alloc()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] dcff10: memfd: split qemu_memfd_alloc()
Date: Fri, 19 Jan 2018 10:07:34 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: dcff1035dfdfb4c76634df64a5359ac18749f7ca
      
https://github.com/qemu/qemu/commit/dcff1035dfdfb4c76634df64a5359ac18749f7ca
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M include/qemu/memfd.h
    M util/memfd.c

  Log Message:
  -----------
  memfd: split qemu_memfd_alloc()

Add a function to only create a memfd, without mmap. The function is
used in the following memory backend.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e3ab04deb036a707fdf1ca0418cb80c4cd9302f9
      
https://github.com/qemu/qemu/commit/e3ab04deb036a707fdf1ca0418cb80c4cd9302f9
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M util/memfd.c

  Log Message:
  -----------
  memfd: remove needless include

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: c7cddce1f7eb4b6d1ae979349f3dacb130a37814
      
https://github.com/qemu/qemu/commit/c7cddce1f7eb4b6d1ae979349f3dacb130a37814
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  qemu-options: document missing memory-backend-file options

This patch adds undocumented memory-backend-file options to the
documentation.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: cd19491ac19209d2554d593ea4f3bd9f6e3ed6b7
      
https://github.com/qemu/qemu/commit/cd19491ac19209d2554d593ea4f3bd9f6e3ed6b7
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  qemu-options: document memory-backend-ram

The documentation should mention -object memory-backend-ram.

Suggested-by: Yumei Huang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2d19c656612bbd104bb139217b12017a6992a898
      
https://github.com/qemu/qemu/commit/2d19c656612bbd104bb139217b12017a6992a898
  Author: Igor Mammedov <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  numa: fix missing '-numa cpu' in '-help' output

commit 419fcdec3c (numa: add '-numa cpu,...' option for property based node 
mapping)
added '-numa cpu' option but forgot to update appropriate section for '--help'.
Add '-numa cpu' description to '-help' output

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 0bd1909da606a60f50128290fc319db020fa303c
      
https://github.com/qemu/qemu/commit/0bd1909da606a60f50128290fc319db020fa303c
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/arm/virt.c
    M hw/core/machine.c
    M hw/i386/pc_q35.c
    M hw/ppc/e500plat.c
    M hw/ppc/spapr.c
    M hw/xen/xen_backend.c
    M include/hw/boards.h

  Log Message:
  -----------
  machine: Replace has_dynamic_sysbus with list of allowed devices

The existing has_dynamic_sysbus flag makes the machine accept
every user-creatable sysbus device type on the command-line.
Replace it with a list of allowed device types, so machines can
easily accept some sysbus devices while rejecting others.

To keep exactly the same behavior as before, the existing
has_dynamic_sysbus=true assignments are replaced with a
TYPE_SYS_BUS_DEVICE entry on the allowed list.  Other patches
will replace the TYPE_SYS_BUS_DEVICE entries with more specific
lists of devices.

Cc: Peter Maydell <address@hidden>
Cc: Marcel Apfelbaum <address@hidden>
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Alexander Graf <address@hidden>
Cc: David Gibson <address@hidden>
Cc: Stefano Stabellini <address@hidden>
Cc: Anthony Perard <address@hidden>
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 6f2062b9758ebc64dfbbda642b0c407c38131ea3
      
https://github.com/qemu/qemu/commit/6f2062b9758ebc64dfbbda642b0c407c38131ea3
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/arm/virt.c

  Log Message:
  -----------
  hw/arm/virt: Allow only supported dynamic sysbus devices

Replace the TYPE_SYS_BUS_DEVICE entry in the allowed sysbus
device list with the two device types that are really supported
by the virt machine: vfio-amd-xgbe and vfio-calxeda-xgmac.

Cc: Peter Maydell <address@hidden>
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 50d01d240f26a43a1d8c0667078bcab7186f2f96
      
https://github.com/qemu/qemu/commit/50d01d240f26a43a1d8c0667078bcab7186f2f96
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/ppc/e500plat.c

  Log Message:
  -----------
  ppc: e500: Allow only supported dynamic sysbus devices

platform_bus_create_devtree() already rejects all dynamic sysbus
devices except TYPE_ETSEC_COMMON, so register it as the only
allowed dynamic sysbus device for the ppce500 machine-type.

Cc: Alexander Graf <address@hidden>
Cc: David Gibson <address@hidden>
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Acked-by: David Gibson <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 7da79a167aa11af6fad353bfbc825fbff2db68a2
      
https://github.com/qemu/qemu/commit/7da79a167aa11af6fad353bfbc825fbff2db68a2
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Allow only supported dynamic sysbus devices

TYPE_SPAPR_PCI_HOST_BRIDGE is the only dynamic sysbus device not
rejected by ppc_spapr_reset(), so it can be the only entry on the
allowed list.

Cc: David Gibson <address@hidden>
Cc: Alexander Graf <address@hidden>
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Acked-by: David Gibson <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: b1b68e1094af0e8c7fcf6faff1a77b7787b3628b
      
https://github.com/qemu/qemu/commit/b1b68e1094af0e8c7fcf6faff1a77b7787b3628b
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/xen/xen_backend.c

  Log Message:
  -----------
  xen: Add only xen-sysdev to dynamic sysbus device list

There's no need to make the machine allow every possible sysbus
device.  We can now just add xen-sysdev to the allowed list.

Cc: Stefano Stabellini <address@hidden>
Cc: Anthony Perard <address@hidden>
Cc: address@hidden
Cc: Juergen Gross <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: ef18310d5495c4ce0e1289ed7fc9833d73fe5ee1
      
https://github.com/qemu/qemu/commit/ef18310d5495c4ce0e1289ed7fc9833d73fe5ee1
  Author: Eduardo Habkost <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/i386/pc_q35.c

  Log Message:
  -----------
  q35: Allow only supported dynamic sysbus devices

The only user-creatable sysbus devices in qemu-system-x86_64 are
amd-iommu, intel-iommu, and xen-backend.  xen-backend is handled
by xen_set_dynamic_sysbus(), so we only need to add amd-iommu and
intel-iommu.

Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Marcel Apfelbaum <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 58346214d03ffcd774e86e3ce72b4196769eb710
      
https://github.com/qemu/qemu/commit/58346214d03ffcd774e86e3ce72b4196769eb710
  Author: Thomas Huth <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M qdev-monitor.c

  Log Message:
  -----------
  qdev_monitor: Simplify error handling in qdev_device_add()

Instead of doing the clean-ups on errors multiple times, introduce
a jump label at the end of the function that can be used by all
error paths that need this cleanup.

Suggested-by: Igor Mammedov <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 03fcbd9dc5084ff4676c153fbe04fb0fcf939d09
      
https://github.com/qemu/qemu/commit/03fcbd9dc5084ff4676c153fbe04fb0fcf939d09
  Author: Thomas Huth <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/core/qdev.c
    M include/hw/qdev-core.h
    M qdev-monitor.c

  Log Message:
  -----------
  qdev: Check for the availability of a hotplug controller before adding a 
device

The qdev_unplug() function contains a g_assert(hotplug_ctrl) statement,
so QEMU crashes when the user tries to device_add + device_del a device
that does not have a corresponding hotplug controller. This could be
provoked for a couple of devices in the past (see commit 4c93950659487c7ad
or 84ebd3e8c7d4fe955 for example), and can currently for example also be
triggered like this:

$ s390x-softmmu/qemu-system-s390x -M none -nographic
QEMU 2.10.50 monitor - type 'help' for more information
(qemu) device_add qemu-s390x-cpu,id=x
(qemu) device_del x
**
ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
Aborted (core dumped)

So devices clearly need a hotplug controller when they should be usable
with device_add.
The code in qdev_device_add() already checks whether the bus has a proper
hotplug controller, but for devices that do not have a corresponding bus,
there is no appropriate check available yet. In that case we should check
whether the machine itself provides a suitable hotplug controller and
refuse to plug the device if none is available.

Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 1e2bdd2e20844f6bc343232ea1bb6f64c54a95ce
      
https://github.com/qemu/qemu/commit/1e2bdd2e20844f6bc343232ea1bb6f64c54a95ce
  Author: Thomas Huth <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M scripts/device-crash-test

  Log Message:
  -----------
  scripts: Remove fixed entries from the device-crash-test

These are crashes / errors which have been fixed already in the past
months. We can remove these from the device-crash-test script now.

Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 983768431676f9ab8599a0b4813e1ca17af70838
      
https://github.com/qemu/qemu/commit/983768431676f9ab8599a0b4813e1ca17af70838
  Author: Haozhong Zhang <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M backends/hostmem-file.c
    M docs/nvdimm.txt
    M exec.c
    M include/exec/memory.h
    M memory.c
    M numa.c
    M qemu-options.hx

  Log Message:
  -----------
  hostmem-file: add "align" option

When mmap(2) the backend files, QEMU uses the host page size
(getpagesize(2)) by default as the alignment of mapping address.
However, some backends may require alignments different than the page
size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
fails with a kernel message like

[617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma 
(0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)

Because there is no common approach to get such alignment requirement,
we add the 'align' option to 'memory-backend-file', so that users or
management utils, which have enough knowledge about the backend, can
specify a proper alignment via this option.

Signed-off-by: Haozhong Zhang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
[ehabkost: fixed typo, fixed error_setg() format string]
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: da6789c27c2ea71765cfab04bad9a42b5426f0bd
      
https://github.com/qemu/qemu/commit/da6789c27c2ea71765cfab04bad9a42b5426f0bd
  Author: Haozhong Zhang <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

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

  Log Message:
  -----------
  nvdimm: add a macro for property "label-size"

Signed-off-by: Haozhong Zhang <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: cb836434cda103fac3c06174e70bf5c9b7083b8e
      
https://github.com/qemu/qemu/commit/cb836434cda103fac3c06174e70bf5c9b7083b8e
  Author: Haozhong Zhang <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M docs/nvdimm.txt
    M hw/acpi/nvdimm.c
    M hw/mem/nvdimm.c
    M include/hw/mem/nvdimm.h

  Log Message:
  -----------
  nvdimm: add 'unarmed' option

Currently the only vNVDIMM backend can guarantee the guest write
persistence is device DAX on Linux, because no host-side kernel cache
is involved in the guest access to it. The approach to detect whether
the backend is device DAX needs to access sysfs, which may not work
with SELinux.

Instead, we add the 'unarmed' option to device 'nvdimm', so that users
or management utils, which have enough knowledge about the backend,
can control the unarmed flag in guest ACPI NFIT via this option. The
guest Linux NVDIMM driver, for example, will mark the corresponding
vNVDIMM device read-only if the unarmed flag in guest NFIT is set.

The default value of 'unarmed' option is 'off' in order to keep the
backwards compatibility.

Signed-off-by: Haozhong Zhang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: d342eb7662bcfe47c26615b67025ae59a383489d
      
https://github.com/qemu/qemu/commit/d342eb7662bcfe47c26615b67025ae59a383489d
  Author: Igor Mammedov <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/arm/virt.c
    M hw/core/machine.c
    M hw/i386/pc.c
    M hw/ppc/spapr.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/boards.h
    M vl.c

  Log Message:
  -----------
  possible_cpus: add CPUArchId::type field

Remove dependency of possible_cpus on 1st CPU instance,
which decouples configuration data from CPU instances that
are created using that data.

Also later it would be used for enabling early cpu to numa node
configuration at runtime qmp_query_hotpluggable_cpus() should
provide a list of available cpu slots at early stage,
before machine_init() is called and the 1st cpu is created,
so that mgmt might be able to call it and use output to set
numa mapping.

Use MachineClass::possible_cpu_arch_ids() callback to set
cpu type info, along with the rest of possible cpu properties,
to let machine define which cpu type* will be used.

* for SPAPR it will be a spapr core type and for ARM/s390x/x86
  a respective descendant of CPUClass.

Move parse_numa_opts() in vl.c after cpu_model is parsed into
cpu_type so that possible_cpu_arch_ids() would know which
cpu_type to use during layout initialization.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: d6b6abc51dda79a97f2c7bd6652c1940c068f1ec
      
https://github.com/qemu/qemu/commit/d6b6abc51dda79a97f2c7bd6652c1940c068f1ec
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M hw/nvram/fw_cfg.c

  Log Message:
  -----------
  fw_cfg: fix memory corruption when all fw_cfg slots are used

When all the fw_cfg slots are used, a write is made outside the
bounds of the fw_cfg files array as part of the sort algorithm.

Fix it by avoiding an unnecessary array element move.
Fix also an assert while at it.

Signed-off-by: Marcel Apfelbaum <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: b384cd95eb9c6f73ad84ed1bb0717a26e29cc78f
      
https://github.com/qemu/qemu/commit/b384cd95eb9c6f73ad84ed1bb0717a26e29cc78f
  Author: Peter Maydell <address@hidden>
  Date:   2018-01-19 (Fri, 19 Jan 2018)

  Changed paths:
    M backends/hostmem-file.c
    M docs/nvdimm.txt
    M exec.c
    M hw/acpi/nvdimm.c
    M hw/arm/virt.c
    M hw/core/machine.c
    M hw/core/qdev.c
    M hw/i386/pc.c
    M hw/i386/pc_q35.c
    M hw/mem/nvdimm.c
    M hw/nvram/fw_cfg.c
    M hw/ppc/e500plat.c
    M hw/ppc/spapr.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/xen/xen_backend.c
    M include/exec/memory.h
    M include/hw/boards.h
    M include/hw/mem/nvdimm.h
    M include/hw/qdev-core.h
    M include/qemu/memfd.h
    M memory.c
    M numa.c
    M qdev-monitor.c
    M qemu-options.hx
    M scripts/device-crash-test
    M util/memfd.c
    M vl.c

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

machine queue, 2018-01-19

# gpg: Signature made Fri 19 Jan 2018 16:30:19 GMT
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request:
  fw_cfg: fix memory corruption when all fw_cfg slots are used
  possible_cpus: add CPUArchId::type field
  nvdimm: add 'unarmed' option
  nvdimm: add a macro for property "label-size"
  hostmem-file: add "align" option
  scripts: Remove fixed entries from the device-crash-test
  qdev: Check for the availability of a hotplug controller before adding a 
device
  qdev_monitor: Simplify error handling in qdev_device_add()
  q35: Allow only supported dynamic sysbus devices
  xen: Add only xen-sysdev to dynamic sysbus device list
  spapr: Allow only supported dynamic sysbus devices
  ppc: e500: Allow only supported dynamic sysbus devices
  hw/arm/virt: Allow only supported dynamic sysbus devices
  machine: Replace has_dynamic_sysbus with list of allowed devices
  numa: fix missing '-numa cpu' in '-help' output
  qemu-options: document memory-backend-ram
  qemu-options: document missing memory-backend-file options
  memfd: remove needless include
  memfd: split qemu_memfd_alloc()

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


Compare: https://github.com/qemu/qemu/compare/3e5bdc6573ed...b384cd95eb9c

reply via email to

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