Re: [PATCH v3 5/6] iommu/virtio: Support topology description in config space

2020-09-25 Thread Bjorn Helgaas
On Fri, Sep 25, 2020 at 10:12:43AM +0200, Jean-Philippe Brucker wrote: > On Thu, Sep 24, 2020 at 10:22:03AM -0500, Bjorn Helgaas wrote: > > On Fri, Aug 21, 2020 at 03:15:39PM +0200, Jean-Philippe Brucker wrote: > > > + /* Perform the init sequence before we can read the config */ > > > + ret = vio

Re: [virtio-dev] Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Gerd Hoffmann
Hi, > Many power platforms are OF based, thus without ACPI or DT support. pseries has lots of stuff below /proc/device-tree. Dunno whenever that is the same kind of device tree we have on arm ... take care, Gerd ___ Virtualization mailing list Vi

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Michael S. Tsirkin
On Fri, Sep 25, 2020 at 01:26:29PM +0200, Jean-Philippe Brucker wrote: > On Fri, Sep 25, 2020 at 06:22:57AM -0400, Michael S. Tsirkin wrote: > > On Fri, Sep 25, 2020 at 10:48:06AM +0200, Jean-Philippe Brucker wrote: > > > On Fri, Aug 21, 2020 at 03:15:34PM +0200, Jean-Philippe Brucker wrote: > > >

[RFC PATCH 17/19] tools/vhost-user-rpmb: add key persistence

2020-09-25 Thread Alex Bennée
Add support for persisting the key in --key-path. By default it will accept the program-key command and store the key in the key file. If you pass --key-set then the key is deemed to be programmed and can't be re-programmed. Obviously you will need some other mechanism to let the guest know what th

[RFC PATCH 19/19] docs: add a man page for vhost-user-rpmb

2020-09-25 Thread Alex Bennée
Basic usage and example invocation. Signed-off-by: Alex Bennée --- docs/tools/index.rst | 1 + docs/tools/vhost-user-rpmb.rst | 102 + 2 files changed, 103 insertions(+) create mode 100644 docs/tools/vhost-user-rpmb.rst diff --git a/docs/tools/index.

[RFC PATCH 15/19] tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_WRITE

2020-09-25 Thread Alex Bennée
With this command we are finally updating data to the backing store and cycling the write_count and each successful write. We also include the write count in all response frames as the spec is a little unclear but the example test code expected it. Signed-off-by: Alex Bennée --- tools/vhost-user

[RFC PATCH 14/19] tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_GET_WRITE_COUNTER

2020-09-25 Thread Alex Bennée
This is the first function with an implied response that doesn't need a VIRTIO_RPMB_REQ_RESULT_READ. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 44 1 file changed, 44 insertions(+) diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-us

[RFC PATCH 13/19] tools/vhost-user-rpmb: implement the PROGRAM_KEY handshake

2020-09-25 Thread Alex Bennée
This implements the first handshake of the device initialisation which is the programming of the device key. This can only be done once per-device. Currently there is no persistence for the device key and other metadata such as the write count. This will be added later. [TODO: clarify the spec if

[RFC PATCH 18/19] tools/vhost-user-rpmb: allow setting of the write_count

2020-09-25 Thread Alex Bennée
This is mostly useful for testing. Practically all guest operations will probe the write count before any write transaction. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-user-rpmb/

[RFC PATCH 16/19] tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_READ

2020-09-25 Thread Alex Bennée
The read command is a lot simpler to implement. However the spec does specify you can only read a single block at a time so we limit it to that. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 52 1 file changed, 52 insertions(+) diff --git a/t

[RFC PATCH 10/19] tools/vhost-user-rpmb: handle shutdown and SIGINT/SIGHUP cleanly

2020-09-25 Thread Alex Bennée
The libvhost-user library will just exit if it handles the VHOST_USER_NONE message and we want to ensure we have tidied up after ourselves. As we need to signal the shutdown of the main loop we need to move the information into the VuRmb state structure. We also want to do the same if we catch a S

[RFC PATCH 08/19] tools/vhost-user-rpmb: connect to fd and instantiate basic run loop

2020-09-25 Thread Alex Bennée
Again doesn't do much on it's own but will create a socket and wait on messages coming in from the vhost-user message socket. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 211 +- tools/vhost-user-rpmb/meson.build | 2 +- 2 files changed, 210 in

[RFC PATCH 12/19] tools/vhost-user-rpmb: import hmac_sha256 functions

2020-09-25 Thread Alex Bennée
We need to calculate HMAC-256SHA as part of the protocol. To avoid making the daemon dependent on QEMU's internal crypto library we import the functions here. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/hmac_sha256.h | 87 tools/vhost-user-rpmb/hmac_sha256.c | 331

[RFC PATCH 11/19] tools/vhost-user-rpmb: add --flash-path for backing store

2020-09-25 Thread Alex Bennée
We will need to store the data somewhere so add the option to point to the file where we will keep the data. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 58 +++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/tools/vhost-user-rpmb/

[RFC PATCH 07/19] tools/vhost-user-rpmb: implement --print-capabilities

2020-09-25 Thread Alex Bennée
A very simple capabilities dump. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-user-rpmb/main.c index a40a680a74ca..6b1989125bd6 100644 --- a/tools/vhost-user-rpmb/main.c +

[RFC PATCH 05/19] virtio-pci: add notification trace points

2020-09-25 Thread Alex Bennée
Signed-off-by: Alex Bennée --- hw/virtio/virtio-pci.c | 3 +++ hw/virtio/trace-events | 7 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 507cb57c410f..33a40e31d955 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/vir

[RFC PATCH 04/19] hw/block: add vhost-user-rpmb-pci boilerplate

2020-09-25 Thread Alex Bennée
This allows is to instantiate a vhost-user-rpmb device as part of a PCI bus. It is mostly boilerplate which looks pretty similar to the vhost-user-fs-pci device if you squint. Signed-off-by: Alex Bennée --- - enable use IOEVENTFD flag - swap obj set bool args --- hw/block/vhost-user-rpmb-pc

[RFC PATCH 02/19] hw/block: add boilerplate for vhost-user-rpmb device

2020-09-25 Thread Alex Bennée
This creates the QEMU side of the vhost-user-rpmb device which connects to the remote daemon. It is based of the reasonably modern vhost-user-fs code with bits from vhost-user-blk as we want the virtio-config itself to be sourced from the daemon. Signed-off-by: Alex Bennée --- include/hw/virtio/

[RFC PATCH 09/19] tools/vhost-user-rpmb: add a --verbose/debug flags for logging

2020-09-25 Thread Alex Bennée
This gives us two levels of informational output when tracing what the daemon is doing. Signed-off-by: Alex Bennée --- tools/vhost-user-rpmb/main.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-user-rpmb/main.c index 269c86cbb

[RFC PATCH 01/19] tools/virtiofsd: add support for --socket-group

2020-09-25 Thread Alex Bennée
If you like running QEMU as a normal user (very common for TCG runs) but you have to run virtiofsd as a root user you run into connection problems. Adding support for an optional --socket-group allows the users to keep using the command line. Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnocz

[RFC PATCH 03/19] hw/virtio: move virtio-pci.h into shared include space

2020-09-25 Thread Alex Bennée
This allows other device classes that will be exposed via PCI to be able to do so in the appropriate hw/ directory. I resisted the temptation to re-order headers to be more aesthetically pleasing. Signed-off-by: Alex Bennée --- {hw => include/hw}/virtio/virtio-pci.h | 0 hw/virtio/vhost-scsi-pci

[RFC PATCH 06/19] tools/vhost-user-rpmb: add boilerplate and initial main

2020-09-25 Thread Alex Bennée
This adds the boilerplate files for a new vhost-user helper called vhost-user-rpmb which will support virtio based RPMB (Replay Protected Memory Block) devices. This commit just adds the initial boilerplate for building the binary with the common vhost-user options. As of this commit the only usef

[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)

2020-09-25 Thread Alex Bennée
Hi, This is an initial implementation of a vhost-user backend for the VirtIO RPMB device. The device is currently in the draft of the next VirtIO specification and describes block device which uses combination of a key, nonce, hashing and a persistent write counter to prevent replay attacks (hence

Re: [RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()

2020-09-25 Thread Jason Wang
On 2020/9/24 下午3:48, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:03AM +0800, Jason Wang wrote: We need to free vqs during the err path after it has been allocated since vhost won't do that for us. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 11 --- 1 file changed, 8 ins

Re: [RFC PATCH 00/24] Control VQ support in vDPA

2020-09-25 Thread Jason Wang
On 2020/9/24 下午6:17, Stefan Hajnoczi wrote: On Thu, Sep 24, 2020 at 11:21:01AM +0800, Jason Wang wrote: This series tries to add the support for control virtqueue in vDPA. Please include documentation for both driver authors and vhost-vdpa ioctl users. vhost-vdpa ioctls are only documented wit

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-25 Thread Jason Wang
On 2020/9/25 下午6:19, Michael S. Tsirkin wrote: On Fri, Sep 25, 2020 at 10:20:05AM +0300, Leon Romanovsky wrote: On Thu, Sep 24, 2020 at 12:02:43PM -0400, Michael S. Tsirkin wrote: On Thu, Sep 24, 2020 at 08:47:05AM -0700, Randy Dunlap wrote: On 9/24/20 3:24 AM, Eli Cohen wrote: On Thu, Sep 2

Re: [RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()

2020-09-25 Thread Jason Wang
On 2020/9/24 下午5:31, Michael S. Tsirkin wrote: On Thu, Sep 24, 2020 at 11:21:03AM +0800, Jason Wang wrote: We need to free vqs during the err path after it has been allocated since vhost won't do that for us. Signed-off-by: Jason Wang This is a bugfix too right? I don't see it posted separat

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Jean-Philippe Brucker
On Fri, Sep 25, 2020 at 06:22:57AM -0400, Michael S. Tsirkin wrote: > On Fri, Sep 25, 2020 at 10:48:06AM +0200, Jean-Philippe Brucker wrote: > > On Fri, Aug 21, 2020 at 03:15:34PM +0200, Jean-Philippe Brucker wrote: > > > Add a topology description to the virtio-iommu driver and enable x86 > > > pl

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Michael S. Tsirkin
On Fri, Sep 25, 2020 at 10:48:06AM +0200, Jean-Philippe Brucker wrote: > On Fri, Aug 21, 2020 at 03:15:34PM +0200, Jean-Philippe Brucker wrote: > > Add a topology description to the virtio-iommu driver and enable x86 > > platforms. > > > > Since [v2] we have made some progress on adding ACPI suppo

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Michael S. Tsirkin
On Thu, Sep 24, 2020 at 02:50:46PM +0200, Joerg Roedel wrote: > On Thu, Sep 24, 2020 at 08:41:21AM -0400, Michael S. Tsirkin wrote: > > But this has nothing to do with Linux. There is also no guarantee that > > the two committees will decide to use exactly the same format. Once one > > of them set

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-25 Thread Michael S. Tsirkin
On Thu, Sep 24, 2020 at 01:24:13PM +0300, Eli Cohen wrote: > On Thu, Sep 24, 2020 at 05:30:55AM -0400, Michael S. Tsirkin wrote: > > > > --- linux-next-20200917.orig/drivers/vdpa/Kconfig > > > > +++ linux-next-20200917/drivers/vdpa/Kconfig > > > > @@ -31,7 +31,7 @@ config IFCVF > > > > > > > > con

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-25 Thread Michael S. Tsirkin
On Fri, Sep 25, 2020 at 10:20:05AM +0300, Leon Romanovsky wrote: > On Thu, Sep 24, 2020 at 12:02:43PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 24, 2020 at 08:47:05AM -0700, Randy Dunlap wrote: > > > On 9/24/20 3:24 AM, Eli Cohen wrote: > > > > On Thu, Sep 24, 2020 at 05:30:55AM -0400, Micha

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Jean-Philippe Brucker
On Fri, Aug 21, 2020 at 03:15:34PM +0200, Jean-Philippe Brucker wrote: > Add a topology description to the virtio-iommu driver and enable x86 > platforms. > > Since [v2] we have made some progress on adding ACPI support for > virtio-iommu, which is the preferred boot method on x86. It will be a >

Re: [PATCH v3 5/6] iommu/virtio: Support topology description in config space

2020-09-25 Thread Jean-Philippe Brucker
On Thu, Sep 24, 2020 at 10:22:03AM -0500, Bjorn Helgaas wrote: > On Fri, Aug 21, 2020 at 03:15:39PM +0200, Jean-Philippe Brucker wrote: > > Platforms without device-tree nor ACPI can provide a topology > > description embedded into the virtio config space. Parse it. > > > > Use PCI FIXUP to probe