]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
vhost: reduce stack usage in log_used
authorLi Wang <li.wang@windriver.com>
Mon, 14 Sep 2020 18:08:09 +0000 (02:08 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 21 Oct 2020 14:34:10 +0000 (10:34 -0400)
Fix the warning: [-Werror=-Wframe-larger-than=]

drivers/vhost/vhost.c: In function log_used:
drivers/vhost/vhost.c:1906:1:
warning: the frame size of 1040 bytes is larger than 1024 bytes

Signed-off-by: Li Wang <li.wang@windriver.com>
Link: https://lore.kernel.org/r/1600106889-25013-1-git-send-email-li.wang@windriver.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
drivers/vhost/vhost.c
drivers/vhost/vhost.h

index 9ad45e1d27f0f0d80eb904098de60c77f376de33..5c5edd4ff04b2daf30e906c138605bd491f29b94 100644 (file)
@@ -1897,7 +1897,7 @@ static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len)
 
 static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len)
 {
-       struct iovec iov[64];
+       struct iovec *iov = vq->log_iov;
        int i, ret;
 
        if (!vq->iotlb)
index 9032d3c2a9f48dd771e7ca7fcbad0cd0378e09d4..5fe4b478c21574cf2474820eb6ba545a2ffc2933 100644 (file)
@@ -123,6 +123,7 @@ struct vhost_virtqueue {
        /* Log write descriptors */
        void __user *log_base;
        struct vhost_log *log;
+       struct iovec log_iov[64];
 
        /* Ring endianness. Defaults to legacy native endianness.
         * Set to true when starting a modern virtio device. */