diff mbox series

[RFC,13/15] vhost-user: Increase VHOST_USER_MAX_RAM_SLOTS to 496 with CONFIG_VIRTIO_MEM

Message ID 20211013103330.26869-14-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series virtio-mem: Expose device memory via separate memslots | expand

Commit Message

David Hildenbrand Oct. 13, 2021, 10:33 a.m. UTC
Let's increase the number of slots to 4096 to allow for increased
flexibility with virtio-mem when dealing with large virtio-mem devices
that start out small.

In the future, we might want to look into some performance improvements,
but for now there isn't really anything stopping us from raising the
limit.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/virtio/vhost-user.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 2c8556237f..1c6a720728 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -24,6 +24,7 @@ 
 #include "sysemu/cryptodev.h"
 #include "migration/migration.h"
 #include "migration/postcopy-ram.h"
+#include CONFIG_DEVICES
 #include "trace.h"
 
 #include <sys/ioctl.h>
@@ -45,8 +46,10 @@ 
  * the maximum number supported by the target
  * hardware plaform.
  */
-#if defined(TARGET_X86) || defined(TARGET_X86_64) || \
-    defined(TARGET_ARM) || defined(TARGET_ARM_64)
+#if defined(CONFIG_VIRTIO_MEM)
+#define VHOST_USER_MAX_RAM_SLOTS 4096
+#elif defined(TARGET_X86) || defined(TARGET_X86_64) || \
+      defined(TARGET_ARM) || defined(TARGET_ARM_64)
 #include "hw/acpi/acpi.h"
 #define VHOST_USER_MAX_RAM_SLOTS ACPI_MAX_RAM_SLOTS