lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <358601698.23011599.1524761004239.JavaMail.zimbra@redhat.com>
Date:   Thu, 26 Apr 2018 12:43:24 -0400 (EDT)
From:   Pankaj Gupta <pagupta@...hat.com>
To:     Stefan Hajnoczi <stefanha@...il.com>
Cc:     jack@...e.cz, kvm@...r.kernel.org, david@...hat.com,
        linux-nvdimm@...1.01.org, ross zwisler <ross.zwisler@...el.com>,
        qemu-devel@...gnu.org, lcapitulino@...hat.com, linux-mm@...ck.org,
        niteshnarayanlal@...mail.com, mst@...hat.com, hch@...radead.org,
        marcel@...hat.com, nilal@...hat.com,
        haozhong zhang <haozhong.zhang@...el.com>, riel@...riel.com,
        stefanha@...hat.com, pbonzini@...hat.com,
        dan j williams <dan.j.williams@...el.com>, kwolf@...hat.com,
        xiaoguangrong eric <xiaoguangrong.eric@...il.com>,
        linux-kernel@...r.kernel.org, imammedo@...hat.com
Subject: Re: [Qemu-devel] [RFC v2] qemu: Add virtio pmem device



> > +static void virtio_pmem_flush(VirtIODevice *vdev, VirtQueue *vq)
> > +{
> > +    VirtQueueElement *elem;
> > +    VirtIOPMEM *pmem = VIRTIO_PMEM(vdev);
> > +    HostMemoryBackend *backend = MEMORY_BACKEND(pmem->memdev);
> > +    int fd = memory_region_get_fd(&backend->mr);
> > +
> > +    elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
> > +    if (!elem) {
> > +        return;
> > +    }
> > +    /* flush raw backing image */
> > +    fsync(fd);
> 
> fsync(2) is a blocking syscall.  This can hang QEMU for an unbounded
> amount of time.

o.k. Main thread will block, agree.

> 
> Please do the fsync from a thread pool.  See block/file-posix.c's
> aio_worker() for an example.

Sure!

> 
> > +static void virtio_pmem_get_config(VirtIODevice *vdev, uint8_t *config)
> > +{
> > +    VirtIOPMEM *pmem = VIRTIO_PMEM(vdev);
> > +    struct virtio_pmem_config *pmemcfg = (struct virtio_pmem_config *)
> > config;
> > +
> > +    pmemcfg->start = pmem->start;
> > +    pmemcfg->size  = pmem->size;
> 
> Endianness.  Please use virtio_st*_p() instead.

sure.

> 
> > +#define VIRTIO_PMEM_PLUG 0
> 
> What is this?

will remove

Thanks,
Pankaj 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ