From: Benjamin Berg <benjamin@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: Benjamin Berg <benjamin.berg@intel.com>
Subject: [PATCH 1/4] um: virtio_uml: send SET_MEM_TABLE message with the exact size
Date: Sun, 3 Nov 2024 22:28:51 +0100 [thread overview]
Message-ID: <20241103212854.1436046-2-benjamin@sipsolutions.net> (raw)
In-Reply-To: <20241103212854.1436046-1-benjamin@sipsolutions.net>
From: Benjamin Berg <benjamin.berg@intel.com>
The rust based userspace vhost devices are very strict and will not
accept the message if it is longer than required. So, only include the
data for the first memory region.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
---
arch/um/drivers/virtio_uml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
index 4d3e9b9f5b61..c602892f329f 100644
--- a/arch/um/drivers/virtio_uml.c
+++ b/arch/um/drivers/virtio_uml.c
@@ -623,7 +623,7 @@ static int vhost_user_set_mem_table(struct virtio_uml_device *vu_dev)
{
struct vhost_user_msg msg = {
.header.request = VHOST_USER_SET_MEM_TABLE,
- .header.size = sizeof(msg.payload.mem_regions),
+ .header.size = offsetof(typeof(msg.payload.mem_regions), regions[1]),
.payload.mem_regions.num = 1,
};
unsigned long reserved = uml_reserved - uml_physmem;
--
2.47.0
next prev parent reply other threads:[~2024-11-03 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-03 21:28 [PATCH 0/4] Enable virtio-fs and virtio-snd in UML Benjamin Berg
2024-11-03 21:28 ` Benjamin Berg [this message]
2024-11-03 21:28 ` [PATCH 2/4] um: virtio_uml: use smaller virtqueue sizes for VIRTIO_ID_SOUND Benjamin Berg
2024-11-07 17:01 ` Johannes Berg
2024-11-03 21:28 ` [PATCH 3/4] um: virtio_uml: fix call_fd IRQ allocation Benjamin Berg
2024-11-03 21:28 ` [PATCH 4/4] um: virtio_uml: query the number of vqs if supported Benjamin Berg
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=20241103212854.1436046-2-benjamin@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=benjamin.berg@intel.com \
--cc=linux-um@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox