All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Yuval Shaia <yuval.shaia@oracle.com>,
	Michael Tsirkin <mst@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH PULL v2 09/10] hw/rdma: Implementation of PVRDMA device
Date: Fri, 27 Apr 2018 22:46:51 +0300	[thread overview]
Message-ID: <5026a614-5124-aecd-5221-5b105c82533b@redhat.com> (raw)
In-Reply-To: <CAFEAcA8yh0hhbhqBM3-iBXWHB72qx--FmnwFdQiPt9Fx13Fzmg@mail.gmail.com>

On 27/04/2018 17:55, Peter Maydell wrote:
> On 19 February 2018 at 11:43, Marcel Apfelbaum <marcel@redhat.com> wrote:
>> From: Yuval Shaia <yuval.shaia@oracle.com>
>>
>> PVRDMA is the QEMU implementation of VMware's paravirtualized RDMA device.
>> It works with its Linux Kernel driver AS IS, no need for any special
>> guest modifications.
>>
>> While it complies with the VMware device, it can also communicate with
>> bare metal RDMA-enabled machines and does not require an RDMA HCA in the
>> host, it can work with Soft-RoCE (rxe).
>>
>> It does not require the whole guest RAM to be pinned allowing memory
>> over-commit and, even if not implemented yet, migration support will be
>> possible with some HW assistance.
>>
>> Implementation is divided into 2 components, rdma general and pvRDMA
>> specific functions and structures.
>>
>> The second PVRDMA sub-module - interaction with PCI layer.
>> - Device configuration and setup (MSIX, BARs etc).
>> - Setup of DSR (Device Shared Resources)
>> - Setup of device ring.
>> - Device management.
>>
>> Reviewed-by: Dotan Barak <dotanb@mellanox.com>
>> Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com>
>> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
>> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> 
> 
>> +static void free_ports(PVRDMADev *dev)
>> +{
>> +    int i;
>> +
>> +    for (i = 0; i < MAX_PORTS; i++) {
>> +        g_free(dev->rdma_dev_res.ports[i].gid_tbl);
> 
> Coverity (CID 1390628) points out that this is attempting to
> call free on an array, which is not valid...
>

Definitely a bug, thanks! (git_tbl is part of RdmaRmPort,
it makes no sense to free it)

We didn't catch it because, funny thing,
the QOM 'exit' function is not called when QEMU exits
for any device created with "-device".

[Adding Michael and Markus]
Does anybody know anything about this issue? Is it on purpose?
Am I getting it wrong?


>> +    }
>> +}
>> +
>> +static void init_ports(PVRDMADev *dev, Error **errp)
>> +{
>> +    int i;
>> +
>> +    memset(dev->rdma_dev_res.ports, 0, sizeof(dev->rdma_dev_res.ports));
>> +
>> +    for (i = 0; i < MAX_PORTS; i++) {
>> +        dev->rdma_dev_res.ports[i].state = PVRDMA_PORT_DOWN;
>> +
>> +        dev->rdma_dev_res.ports[i].pkey_tbl =
>> +            g_malloc0(sizeof(*dev->rdma_dev_res.ports[i].pkey_tbl) *
>> +                      MAX_PORT_PKEYS);
> 
> ...init_ports() is allocated memory into ports[i].pkey_tbl,
> so maybe this is what free_ports() is intended to be freeing ?
> 

Right, we will fix it.

Thanks again for running Coverity!
Marcel

>> +    }
>> +}
> 
> thanks
> -- PMM
> 

  reply	other threads:[~2018-04-27 19:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 11:43 [Qemu-devel] [PATCH PULL v2 00/10] RDMA patches Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 01/10] mem: add share parameter to memory-backend-ram Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 02/10] docs: add pvrdma device documentation Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 03/10] scripts/update-linux-headers: import pvrdma headers Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 04/10] include/standard-headers: add pvrdma related headers Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 05/10] hw/rdma: Add wrappers and macros Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 06/10] hw/rdma: Definitions for rdma device and rdma resource manager Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 07/10] hw/rdma: Implementation of generic rdma device layers Marcel Apfelbaum
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 08/10] hw/rdma: PVRDMA commands and data-path ops Marcel Apfelbaum
2018-04-27 14:31   ` Peter Maydell
2018-04-27 18:20     ` Marcel Apfelbaum
2018-04-29  7:42       ` Yuval Shaia
2018-04-27 14:43   ` Peter Maydell
2018-04-27 18:22     ` Marcel Apfelbaum
2018-04-27 14:58   ` Peter Maydell
2018-04-27 18:28     ` Marcel Apfelbaum
2018-04-27 15:01   ` Peter Maydell
2018-04-27 18:31     ` Marcel Apfelbaum
2023-06-20 12:35   ` Peter Maydell
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 09/10] hw/rdma: Implementation of PVRDMA device Marcel Apfelbaum
2018-04-27 14:49   ` Peter Maydell
2018-04-27 19:36     ` Marcel Apfelbaum
2018-04-29  9:38       ` Yuval Shaia
2018-04-27 14:55   ` Peter Maydell
2018-04-27 19:46     ` Marcel Apfelbaum [this message]
2018-04-29  7:18     ` Yuval Shaia
2018-02-19 11:43 ` [Qemu-devel] [PATCH PULL v2 10/10] MAINTAINERS: add entry for hw/rdma Marcel Apfelbaum
2018-02-19 16:43 ` [Qemu-devel] [PATCH PULL v2 00/10] RDMA patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5026a614-5124-aecd-5221-5b105c82533b@redhat.com \
    --to=marcel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yuval.shaia@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.