qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 426ec9: vfio/pci: Use local error object in v


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 426ec9: vfio/pci: Use local error object in vfio_initfn
Date: Tue, 18 Oct 2016 05:00:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 426ec9049e29397af95f8c28e020590bd1fe57dd
      
https://github.com/qemu/qemu/commit/426ec9049e29397af95f8c28e020590bd1fe57dd
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio/pci: Use local error object in vfio_initfn

To prepare for migration to realize, let's use a local error
object in vfio_initfn. Also let's use the same error prefix for all
error messages.

On top of the 1-1 conversion, we start using a common error prefix for
all error messages. We also introduce a similar warning prefix which will
be used later on.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: cde4279baa246fdfadb06d021e3b8d0a0234879f
      
https://github.com/qemu/qemu/commit/cde4279baa246fdfadb06d021e3b8d0a0234879f
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_populate_vga

Pass an error object to prepare for the same operation in
vfio_populate_device. Eventually this contributes to the migration
to VFIO-PCI realize.

We now report an error on vfio_get_region_info failure.

vfio_probe_igd_bar4_quirk is not involved in the migration to realize
and simply calls error_reportf_err.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 2312d907ddcdeffa45350e5960be46d6105b8ec2
      
https://github.com/qemu/qemu/commit/2312d907ddcdeffa45350e5960be46d6105b8ec2
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_populate_device

Pass an error object to prepare for migration to VFIO-PCI realize.
The returned value will be removed later on.

The case where error recovery cannot be enabled is not converted into
an error object but directly reported through error_report, as before.
Populating an error instead would cause the future realize function to
fail, which is not wanted.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 008d0e2d7bb1bb8c0393d5cc7501a05c2bc4ed81
      
https://github.com/qemu/qemu/commit/008d0e2d7bb1bb8c0393d5cc7501a05c2bc4ed81
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_msix_early_setup

Pass an error object to prepare for migration to VFIO-PCI realize.
The returned value will be removed later on.

We now format an error in case of reading failure for
- the MSIX flags
- the MSIX table,
- the MSIX PBA.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 7dfb34247e231e1f317e3558af96c90f06fef8a5
      
https://github.com/qemu/qemu/commit/7dfb34247e231e1f317e3558af96c90f06fef8a5
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_intx_enable

Pass an error object to prepare for migration to VFIO-PCI realize.

The error object is propagated down to vfio_intx_enable_kvm().

The three other callers, vfio_intx_enable_kvm(), vfio_msi_disable_common()
and vfio_pci_post_reset() do not propagate the error and simply call
error_reportf_err() with the ERR_PREFIX formatting.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 7ef165b9a8d903babddaf9c61c54ae9b6e739604
      
https://github.com/qemu/qemu/commit/7ef165b9a8d903babddaf9c61c54ae9b6e739604
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_add_capabilities

Pass an error object to prepare for migration to VFIO-PCI realize.
The error is cascaded downto vfio_add_std_cap and then vfio_msi(x)_setup,
vfio_setup_pcie_cap.

vfio_add_ext_cap does not return anything else than 0 so let's transform
it into a void function.

Also use pci_add_capability2 which takes an error object.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 7237011d0596e57f42d2a4e0556034b8d13533fe
      
https://github.com/qemu/qemu/commit/7237011d0596e57f42d2a4e0556034b8d13533fe
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Pass an error object to vfio_pci_igd_opregion_init

Pass an error object to prepare for migration to VFIO-PCI realize.

In vfio_probe_igd_bar4_quirk, simply report the error.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 01905f58f166646619c35a2ebfc3ca3ed4cad62d
      
https://github.com/qemu/qemu/commit/01905f58f166646619c35a2ebfc3ca3ed4cad62d
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio: Pass an Error object to vfio_connect_container

The error is currently simply reported in vfio_get_group. Don't
bother too much with the prefix which will be handled at upper level,
later on.

Also return an error value in case container->error is not 0 and
the container is teared down.

On vfio_spapr_remove_window failure, we also report an error whereas
it was silent before.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 1b808d5be070e9d07e5d0e5b825a31a0cf87001d
      
https://github.com/qemu/qemu/commit/1b808d5be070e9d07e5d0e5b825a31a0cf87001d
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Pass an error object to vfio_get_group

Pass an error object to prepare for migration to VFIO-PCI realize.

For the time being let's just simply report the error in
vfio platform's vfio_base_device_init(). A subsequent patch will
duly propagate the error up to vfio_platform_realize.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 59f7d6743ccbe17587e491dc5d79cad8bf31f76a
      
https://github.com/qemu/qemu/commit/59f7d6743ccbe17587e491dc5d79cad8bf31f76a
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Pass an error object to vfio_get_device

Pass an error object to prepare for migration to VFIO-PCI realize.

In vfio platform vfio_base_device_init we currently just report the
error. Subsequent patches will propagate the error up to the realize
function.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 5ff7419d4c7706fc3f625c0fd48cae191d2cecbc
      
https://github.com/qemu/qemu/commit/5ff7419d4c7706fc3f625c0fd48cae191d2cecbc
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/platform.c

  Log Message:
  -----------
  vfio/platform: Pass an error object to vfio_populate_device

Propagate the vfio_populate_device errors up to vfio_base_device_init.
The error object also is passed to vfio_init_intp. At the moment we
only report the error. Subsequent patches will propagate the error
up to the realize function.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 0d84f47bff2f98d0cea5fb27e9b62225ccebd70a
      
https://github.com/qemu/qemu/commit/0d84f47bff2f98d0cea5fb27e9b62225ccebd70a
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/platform.c

  Log Message:
  -----------
  vfio/platform: fix a wrong returned value in vfio_populate_device

In case the vfio_init_intp fails we currently do not return an
error value. This patch fixes the bug. The returned value is not
explicit but in practice the error object is the one used to
report the error to the end-user and the actual returned error
value is not used.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 9bdbfbd50dfcc23252224112e8cbb720a8535d40
      
https://github.com/qemu/qemu/commit/9bdbfbd50dfcc23252224112e8cbb720a8535d40
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/platform.c

  Log Message:
  -----------
  vfio/platform: Pass an error object to vfio_base_device_init

This patch propagates errors encountered during vfio_base_device_init
up to the realize function.

In case the host value is not set or badly formed we now report an
error.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 1a22aca1d0071bdc4abc1a72894a13f0076b2404
      
https://github.com/qemu/qemu/commit/1a22aca1d0071bdc4abc1a72894a13f0076b2404
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c
    M hw/vfio/trace-events

  Log Message:
  -----------
  vfio/pci: Conversion to realize

This patch converts VFIO PCI to realize function.

Also original initfn errors now are propagated using QEMU
error objects. All errors are formatted with the same pattern:
"vfio: %s: the error description"

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: ec3bcf424edb76e00b6ff545360329c4cedf9953
      
https://github.com/qemu/qemu/commit/ec3bcf424edb76e00b6ff545360329c4cedf9953
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Remove vfio_msix_early_setup returned value

The returned value is not used anymore by the caller, vfio_realize,
since the error now is stored in the error object. So let's remove it.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: e04cff9d975389b83d59b89cc3904b20ae0b4ce1
      
https://github.com/qemu/qemu/commit/e04cff9d975389b83d59b89cc3904b20ae0b4ce1
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Remove vfio_populate_device returned value

The returned value (either -errno or -1) is not used anymore by the caller,
vfio_realize, since the error now is stored in the error object. So let's
remove it.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 4a946268504e72fe0c547b9dda97adbe277a585f
      
https://github.com/qemu/qemu/commit/4a946268504e72fe0c547b9dda97adbe277a585f
  Author: Eric Auger <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Handle host oversight

In case the end-user calls qemu with -vfio-pci option without passing
either sysfsdev or host property value, the device is interpreted as
0000:00:00.0. Let's create a specific error message to guide the end-user.

Signed-off-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 31e6a7b17b35711eb44f0e686b5ba68d15bfe4c1
      
https://github.com/qemu/qemu/commit/31e6a7b17b35711eb44f0e686b5ba68d15bfe4c1
  Author: Thorsten Kohfeldt <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci-quirks.c

  Log Message:
  -----------
  vfio/pci: Fix vfio_rtl8168_quirk_data_read address offset

Introductory comment for rtl8168 VFIO MSI-X quirk states:
At BAR2 offset 0x70 there is a dword data register,
   offset 0x74 is a dword address register.
vfio: vfio_bar_read(0000:05:00.0:BAR2+0x70, 4) = 0xfee00398 // read data

Thus, correct offset for data read is 0x70,
but function vfio_rtl8168_quirk_data_read() wrongfully uses offset 0x74.

Signed-off-by: Thorsten Kohfeldt <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 893bfc3cc893ed36cedc364e99cf483e9b08c294
      
https://github.com/qemu/qemu/commit/893bfc3cc893ed36cedc364e99cf483e9b08c294
  Author: Cao jin <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio: fix duplicate function call

When vfio device is reset(encounter FLR, or bus reset), if need to do
bus reset(vfio_pci_hot_reset_one is called), vfio_pci_pre_reset &
vfio_pci_post_reset will be called twice.

Signed-off-by: Cao jin <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 1b0d3845b454eaaac0b2064c78926ca4d739a080
      
https://github.com/qemu/qemu/commit/1b0d3845b454eaaac0b2064c78926ca4d739a080
  Author: Peter Maydell <address@hidden>
  Date:   2016-10-18 (Tue, 18 Oct 2016)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h
    M hw/vfio/platform.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20161017.0' 
into staging

VFIO updates 2016-10-17

 - Convert to realize & improve error reporting (Eric Auger)
 - RTL quirk bug fix (Thorsten Kohfeldt)
 - Skip duplicate pre/post reset (Cao jin)

# gpg: Signature made Mon 17 Oct 2016 20:42:44 BST
# gpg:                using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-updates-20161017.0:
  vfio: fix duplicate function call
  vfio/pci: Fix vfio_rtl8168_quirk_data_read address offset
  vfio/pci: Handle host oversight
  vfio/pci: Remove vfio_populate_device returned value
  vfio/pci: Remove vfio_msix_early_setup returned value
  vfio/pci: Conversion to realize
  vfio/platform: Pass an error object to vfio_base_device_init
  vfio/platform: fix a wrong returned value in vfio_populate_device
  vfio/platform: Pass an error object to vfio_populate_device
  vfio: Pass an error object to vfio_get_device
  vfio: Pass an error object to vfio_get_group
  vfio: Pass an Error object to vfio_connect_container
  vfio/pci: Pass an error object to vfio_pci_igd_opregion_init
  vfio/pci: Pass an error object to vfio_add_capabilities
  vfio/pci: Pass an error object to vfio_intx_enable
  vfio/pci: Pass an error object to vfio_msix_early_setup
  vfio/pci: Pass an error object to vfio_populate_device
  vfio/pci: Pass an error object to vfio_populate_vga
  vfio/pci: Use local error object in vfio_initfn

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


Compare: https://github.com/qemu/qemu/compare/f525c8a6cb9e...1b0d3845b454

reply via email to

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