All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juraj Marcin <jmarcin@redhat.com>,
	peterx@redhat.com, Prasad Pandit <ppandit@redhat.com>,
	Julia Suvorova <jusual@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Fabiano Rosas <farosas@suse.de>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: [PATCH 2/4] KVM: Define KVM_MEMSLOTS_NUM_MAX_DEFAULT
Date: Wed,  4 Sep 2024 15:16:33 -0400	[thread overview]
Message-ID: <20240904191635.3045606-3-peterx@redhat.com> (raw)
In-Reply-To: <20240904191635.3045606-1-peterx@redhat.com>

Make the default max nr_slots a macro, it's only used when KVM reports
nothing.  Then we put all the rest macros together later soon.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 accel/kvm/kvm-all.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 991c389adc..e408dbb753 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -69,6 +69,9 @@
 #define KVM_GUESTDBG_BLOCKIRQ 0
 #endif
 
+/* Default max allowed memslots if kernel reported nothing */
+#define  KVM_MEMSLOTS_NUM_MAX_DEFAULT                       32
+
 struct KVMParkedVcpu {
     unsigned long vcpu_id;
     int kvm_fd;
@@ -2458,7 +2461,7 @@ static int kvm_init(MachineState *ms)
 
     /* If unspecified, use the default value */
     if (!s->nr_slots_max) {
-        s->nr_slots_max = 32;
+        s->nr_slots_max = KVM_MEMSLOTS_NUM_MAX_DEFAULT;
     }
 
     s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE);
-- 
2.45.0



  parent reply	other threads:[~2024-09-04 19:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 19:16 [PATCH 0/4] KVM: Dynamic sized memslots array Peter Xu
2024-09-04 19:16 ` [PATCH 1/4] KVM: Rename KVMState->nr_slots to nr_slots_max Peter Xu
2024-09-04 20:36   ` David Hildenbrand
2024-09-04 19:16 ` Peter Xu [this message]
2024-09-04 20:39   ` [PATCH 2/4] KVM: Define KVM_MEMSLOTS_NUM_MAX_DEFAULT David Hildenbrand
2024-09-04 20:56     ` Peter Xu
2024-09-04 19:16 ` [PATCH 3/4] KVM: Dynamic sized kvm memslots array Peter Xu
2024-09-04 20:43   ` David Hildenbrand
2024-09-04 20:51     ` David Hildenbrand
2024-09-04 20:55     ` Peter Xu
2024-09-04 21:07   ` David Hildenbrand
2024-09-04 21:20     ` Peter Xu
2024-09-04 21:23       ` David Hildenbrand
2024-09-04 21:34         ` Peter Xu
2024-09-04 21:38           ` David Hildenbrand
2024-09-04 21:46             ` Peter Xu
2024-09-04 21:58               ` Peter Xu
2024-09-04 19:16 ` [PATCH 4/4] KVM: Rename KVMMemoryListener.nr_used_slots to nr_slots_used Peter Xu
2024-09-04 20:40   ` David Hildenbrand

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=20240904191635.3045606-3-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=david@redhat.com \
    --cc=farosas@suse.de \
    --cc=jmarcin@redhat.com \
    --cc=jusual@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vkuznets@redhat.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.