qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] f9b490: accel/kvm: add PIO ioeventfds only in


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] f9b490: accel/kvm: add PIO ioeventfds only in case kvm_eve...
Date: Mon, 23 Nov 2020 07:15:16 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f9b49088952ddb6de6e9c2e5822a5e15434abc3b
      
https://github.com/qemu/qemu/commit/f9b49088952ddb6de6e9c2e5822a5e15434abc3b
  Author: Elena Afanasova <eafanasova@gmail.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M accel/kvm/kvm-all.c

  Log Message:
  -----------
  accel/kvm: add PIO ioeventfds only in case kvm_eventfds_allowed is true

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
Message-Id: <20201017210102.26036-1-eafanasova@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: e6ffd757829a0dcff649c99e6304a287cc6d0d27
      
https://github.com/qemu/qemu/commit/e6ffd757829a0dcff649c99e6304a287cc6d0d27
  Author: Elena Afanasova <eafanasova@gmail.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M softmmu/memory.c

  Log Message:
  -----------
  softmmu/memory: fix memory_region_ioeventfd_equal()

Eventfd can be registered with a zero length when fast_mmio is true.
Handle this case properly when dispatching through QEMU.

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
Message-id: cf71a62eb04e61932ff8ffdd02e0b2aab4f495a0.camel@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: dc0b4d94d49a37751b37184fc891a86af3cc72e5
      
https://github.com/qemu/qemu/commit/dc0b4d94d49a37751b37184fc891a86af3cc72e5
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Cover "block/nvme.h" file

The "block/nvme.h" header is shared by both the NVMe block
driver and the NVMe emulated device. Add the 'F:' entry on
both sections, so all maintainers/reviewers are notified
when it is changed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Message-Id: <20200701140634.25994-1-philmd@redhat.com>


  Commit: 8526e39e9974228f937d04e8eae140add8b17b43
      
https://github.com/qemu/qemu/commit/8526e39e9974228f937d04e8eae140add8b17b43
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Use hex format to display offset in trace events

Use the same format used for the hw/vfio/ trace events.

Suggested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-3-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 58ad6ae0cbad626bd574bc1347f210a35a8316eb
      
https://github.com/qemu/qemu/commit/58ad6ae0cbad626bd574bc1347f210a35a8316eb
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Report warning with warn_report()

Instead of displaying warning on stderr, use warn_report()
which also displays it on the monitor.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-4-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 15b2260bef333762904535affa7fb30390b3fb98
      
https://github.com/qemu/qemu/commit/15b2260bef333762904535affa7fb30390b3fb98
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Trace controller capabilities

Controllers have different capabilities and report them in the
CAP register. We are particularly interested by the page size
limits.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-5-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 1c914cd1208fcf7fc61edb043f091b9412642ec8
      
https://github.com/qemu/qemu/commit/1c914cd1208fcf7fc61edb043f091b9412642ec8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Trace nvme_poll_queue() per queue

As we want to enable multiple queues, report the event
in each nvme_poll_queue() call, rather than once in
the callback calling nvme_poll_queues().

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-6-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 51e98b6d21dbaf0c6adcbf00b76bfbe0a0537c02
      
https://github.com/qemu/qemu/commit/51e98b6d21dbaf0c6adcbf00b76bfbe0a0537c02
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Improve nvme_free_req_queue_wait() trace information

What we want to trace is the block driver state and the queue index.

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-7-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 6e1e9ff2d3709bb89156ea8e42239b6ee96a2a49
      
https://github.com/qemu/qemu/commit/6e1e9ff2d3709bb89156ea8e42239b6ee96a2a49
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Trace queue pair creation/deletion

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-8-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 3214b0f0948d5e01ccca62730e60a69e2ded8774
      
https://github.com/qemu/qemu/commit/3214b0f0948d5e01ccca62730e60a69e2ded8774
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Move definitions before structure declarations

To be able to use some definitions in structure declarations,
move them earlier. No logical change.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-9-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 1b539bd6dbe1459f160e25610ec2fc3388f700e8
      
https://github.com/qemu/qemu/commit/1b539bd6dbe1459f160e25610ec2fc3388f700e8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Use unsigned integer for queue counter/size

We can not have negative queue count/size/index, use unsigned type.
Rename 'nr_queues' as 'queue_count' to match the spec naming.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-10-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 7a5f00dde39c0120b1653f189de9bbd551a6b1d8
      
https://github.com/qemu/qemu/commit/7a5f00dde39c0120b1653f189de9bbd551a6b1d8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Make nvme_identify() return boolean indicating error

Just for consistency, following the example documented since
commit e3fe3988d7 ("error: Document Error API usage rules"),
return a boolean value indicating an error is set or not.
Directly pass errp as the local_err is not requested in our
case.

Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20201029093306.1063879-11-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: dfa9c6c65666d431b20f6ae3f18ee1e729f80f19
      
https://github.com/qemu/qemu/commit/dfa9c6c65666d431b20f6ae3f18ee1e729f80f19
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Make nvme_init_queue() return boolean indicating error

Just for consistency, following the example documented since
commit e3fe3988d7 ("error: Document Error API usage rules"),
return a boolean value indicating an error is set or not.
Directly pass errp as the local_err is not requested in our
case. This simplifies a bit nvme_create_queue_pair().

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-12-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 54248d4d73ddbce38e240056dacf582f92da872d
      
https://github.com/qemu/qemu/commit/54248d4d73ddbce38e240056dacf582f92da872d
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M include/block/nvme.h

  Log Message:
  -----------
  block/nvme: Introduce Completion Queue definitions

Rename Submission Queue flags with 'Sq' to differentiate
submission queue flags from command queue flags, and introduce
Completion Queue flag definitions.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20201029093306.1063879-13-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 76a24781cc82d99251f933c399d78af52e1d9b0e
      
https://github.com/qemu/qemu/commit/76a24781cc82d99251f933c399d78af52e1d9b0e
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Use definitions instead of magic values in add_io_queue()

Replace magic values by definitions, and simplifiy since the
number of queues will never reach 64K.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-14-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 3c363c073e024fae7b09cad916e63dae89ed46cc
      
https://github.com/qemu/qemu/commit/3c363c073e024fae7b09cad916e63dae89ed46cc
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Correctly initialize Admin Queue Attributes

>From the specification chapter 3.1.8 "AQA - Admin Queue Attributes"
the Admin Submission Queue Size field is a 0’s based value:

  Admin Submission Queue Size (ASQS):

    Defines the size of the Admin Submission Queue in entries.
    Enabling a controller while this field is cleared to 00h
    produces undefined results. The minimum size of the Admin
    Submission Queue is two entries. The maximum size of the
    Admin Submission Queue is 4096 entries.
    This is a 0’s based value.

This bug has never been hit because the device initialization
uses a single command synchronously :)

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-15-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 52b75ea8ec4f6cd8028bd8406ebcf2e80ffc6e05
      
https://github.com/qemu/qemu/commit/52b75ea8ec4f6cd8028bd8406ebcf2e80ffc6e05
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Simplify ADMIN queue access

We don't need to dereference from BDRVNVMeState each time.
Use a NVMeQueuePair pointer on the admin queue.
The nvme_init() becomes easier to review, matching the style
of nvme_add_io_queue().

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-16-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 08d5406798f7729de8344ef0ed16d8bad8cdfc84
      
https://github.com/qemu/qemu/commit/08d5406798f7729de8344ef0ed16d8bad8cdfc84
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Simplify nvme_cmd_sync()

As all commands use the ADMIN queue, it is pointless to pass
it as argument each time. Remove the argument, and rename the
function as nvme_admin_cmd_sync() to make this new behavior
clearer.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20201029093306.1063879-17-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: c8228ac35541564c46bf1c91ebe7951f367e2ce6
      
https://github.com/qemu/qemu/commit/c8228ac35541564c46bf1c91ebe7951f367e2ce6
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Set request_alignment at initialization

Commit bdd6a90a9e5 ("block: Add VFIO based NVMe driver")
sets the request_alignment in nvme_refresh_limits().
For consistency, also set it during initialization.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-18-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: a652a3ec697d5b4cfce44599d3540aae535b9545
      
https://github.com/qemu/qemu/commit/a652a3ec697d5b4cfce44599d3540aae535b9545
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Correct minimum device page size

While trying to simplify the code using a macro, we forgot
the 12-bit shift... Correct that.

Fixes: fad1eb68862 ("block/nvme: Use register definitions from 'block/nvme.h'")
Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-19-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 0aecd06049ced6c0f863e99510b7a7cbff54aa56
      
https://github.com/qemu/qemu/commit/0aecd06049ced6c0f863e99510b7a7cbff54aa56
  Author: Eric Auger <eric.auger@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Change size and alignment of IDENTIFY response buffer

In preparation of 64kB host page support, let's change the size
and alignment of the IDENTIFY command response buffer so that
the VFIO DMA MAP succeeds. We align on the host page size.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-20-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 2387aaced7209872238eaf594997009cffd5501d
      
https://github.com/qemu/qemu/commit/2387aaced7209872238eaf594997009cffd5501d
  Author: Eric Auger <eric.auger@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Change size and alignment of queue

In preparation of 64kB host page support, let's change the size
and alignment of the queue so that the VFIO DMA MAP succeeds.
We align on the host page size.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-21-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: f8fd3ebac358c187d0aba7f922450ed6addf41a8
      
https://github.com/qemu/qemu/commit/f8fd3ebac358c187d0aba7f922450ed6addf41a8
  Author: Eric Auger <eric.auger@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Change size and alignment of prp_list_pages

In preparation of 64kB host page support, let's change the size
and alignment of the prp_list_pages so that the VFIO DMA MAP succeeds
with 64kB host page size. We align on the host page size.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-22-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 9e13d598843cca1cdab7b7bdcb9cc0868ebf7fed
      
https://github.com/qemu/qemu/commit/9e13d598843cca1cdab7b7bdcb9cc0868ebf7fed
  Author: Eric Auger <eric.auger@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Align iov's va and size on host page size

Make sure iov's va and size are properly aligned on the
host page size.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-23-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 4b19e9b8159b5eecf8e90c81c56c1a13547e411a
      
https://github.com/qemu/qemu/commit/4b19e9b8159b5eecf8e90c81c56c1a13547e411a
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Fix use of write-only doorbells page on Aarch64 arch

qemu_vfio_pci_map_bar() calls mmap(), and mmap(2) states:

  'offset' must be a multiple of the page size as returned
   by sysconf(_SC_PAGE_SIZE).

In commit f68453237b9 we started to use an offset of 4K which
broke this contract on Aarch64 arch.

Fix by mapping at offset 0, and and accessing doorbells at offset=4K.

Fixes: f68453237b9 ("block/nvme: Map doorbells pages write-only")
Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-24-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: a0546a7b6f14a919b67cea1d1fc4362ac2901868
      
https://github.com/qemu/qemu/commit/a0546a7b6f14a919b67cea1d1fc4362ac2901868
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Fix nvme_submit_command() on big-endian host

The Completion Queue Command Identifier is a 16-bit value,
so nvme_submit_command() is unlikely to work on big-endian
hosts, as the relevant bits are truncated.
Fix by using the correct byte-swap function.

Fixes: bdd6a90a9e5 ("block: Add VFIO based NVMe driver")
Reported-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20201029093306.1063879-25-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: a4bc212add9bd9d7a7baaa095f875d9212eb1fc9
      
https://github.com/qemu/qemu/commit/a4bc212add9bd9d7a7baaa095f875d9212eb1fc9
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Improve reporting unsupported IOMMU type

Change the confuse "VFIO IOMMU check failed" error message by
the explicit "VFIO IOMMU Type1 is not supported" once.

Example on POWER:

 $ qemu-system-ppc64 -drive 
if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw
 qemu-system-ppc64: -drive 
if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw: VFIO IOMMU Type1 is not 
supported

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-2-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 3d87c2d9435a4c71d588a770a8a34382c1afa9c1
      
https://github.com/qemu/qemu/commit/3d87c2d9435a4c71d588a770a8a34382c1afa9c1
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Trace PCI I/O config accesses

We sometime get kernel panic with some devices on Aarch64
hosts. Alex Williamson suggests it might be broken PCIe
root complex. Add trace event to record the latest I/O
access before crashing. In case, assert our accesses are
aligned.

Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-3-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: df058222e77963e9bece723d19142354ed443d4a
      
https://github.com/qemu/qemu/commit/df058222e77963e9bece723d19142354ed443d4a
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Trace PCI BAR region info

For debug purpose, trace BAR regions info.

Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-4-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 2817fbcee060cfdf3899fbab97e185272f5f83ec
      
https://github.com/qemu/qemu/commit/2817fbcee060cfdf3899fbab97e185272f5f83ec
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Trace where BARs are mapped

For debugging purpose, trace where a BAR is mapped.

Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-5-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 4c946b2236e630613fcb89516bf7fb2f918dc996
      
https://github.com/qemu/qemu/commit/4c946b2236e630613fcb89516bf7fb2f918dc996
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Improve DMA trace events

For debugging purpose, trace where DMA regions are mapped.

Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-6-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: f6b8104d0b75a8c2b21bd3175e9ba9a402182b2e
      
https://github.com/qemu/qemu/commit/f6b8104d0b75a8c2b21bd3175e9ba9a402182b2e
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Convert vfio_dump_mapping to trace events

The QEMU_VFIO_DEBUG definition is only modifiable at build-time.
Trace events can be enabled at run-time. As we prefer the latter,
convert qemu_vfio_dump_mappings() to use trace events instead
of fprintf().

Reviewed-by: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-7-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: fc107d86840b3364e922c26cf7631b7fd38ce523
      
https://github.com/qemu/qemu/commit/fc107d86840b3364e922c26cf7631b7fd38ce523
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M util/vfio-helpers.c

  Log Message:
  -----------
  util/vfio-helpers: Assert offset is aligned to page size

mmap(2) states:

  'offset' must be a multiple of the page size as returned
   by sysconf(_SC_PAGE_SIZE).

Add an assertion to be sure we don't break this contract.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201103020733.2303148-8-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>


  Commit: 683685e72dccaf8cb9fe8ffa20f5c5aacea72118
      
https://github.com/qemu/qemu/commit/683685e72dccaf8cb9fe8ffa20f5c5aacea72118
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M MAINTAINERS
    M accel/kvm/kvm-all.c
    M block/nvme.c
    M block/trace-events
    M include/block/nvme.h
    M softmmu/memory.c
    M util/trace-events
    M util/vfio-helpers.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/stefanha-gitlab/tags/block-pull-request' into staging

Pull request for 5.2

NVMe fixes to solve IOMMU issues on non-x86 and error message/tracing
improvements. Elena Afanasova's ioeventfd fixes are also included.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

# gpg: Signature made Wed 04 Nov 2020 15:18:16 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha-gitlab/tags/block-pull-request: (33 commits)
  util/vfio-helpers: Assert offset is aligned to page size
  util/vfio-helpers: Convert vfio_dump_mapping to trace events
  util/vfio-helpers: Improve DMA trace events
  util/vfio-helpers: Trace where BARs are mapped
  util/vfio-helpers: Trace PCI BAR region info
  util/vfio-helpers: Trace PCI I/O config accesses
  util/vfio-helpers: Improve reporting unsupported IOMMU type
  block/nvme: Fix nvme_submit_command() on big-endian host
  block/nvme: Fix use of write-only doorbells page on Aarch64 arch
  block/nvme: Align iov's va and size on host page size
  block/nvme: Change size and alignment of prp_list_pages
  block/nvme: Change size and alignment of queue
  block/nvme: Change size and alignment of IDENTIFY response buffer
  block/nvme: Correct minimum device page size
  block/nvme: Set request_alignment at initialization
  block/nvme: Simplify nvme_cmd_sync()
  block/nvme: Simplify ADMIN queue access
  block/nvme: Correctly initialize Admin Queue Attributes
  block/nvme: Use definitions instead of magic values in add_io_queue()
  block/nvme: Introduce Completion Queue definitions
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/6ab64cc2a51d...683685e72dcc



reply via email to

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