From: Alex Williamson <alex.williamson@redhat.com>
To: mtosatti@redhat.com, gleb@redhat.com
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: [PATCH 06/10] kvm: Make KVM_PRIVATE_MEM_SLOTS optional
Date: Thu, 06 Dec 2012 15:21:03 -0700 [thread overview]
Message-ID: <20121206222103.24968.19718.stgit@bling.home> (raw)
In-Reply-To: <20121206214722.24968.6043.stgit@bling.home>
Seems like everyone copied x86 and defined 4 private memory slots
that never actually get used. Even x86 only uses 3 of the 4. These
aren't exposed so there's no need to add padding.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
arch/ia64/include/asm/kvm_host.h | 2 --
arch/powerpc/include/asm/kvm_host.h | 4 +---
arch/s390/include/asm/kvm_host.h | 2 --
arch/x86/include/asm/kvm_host.h | 4 ++--
include/linux/kvm_host.h | 4 ++++
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
index 48d7b0e..cfa7498 100644
--- a/arch/ia64/include/asm/kvm_host.h
+++ b/arch/ia64/include/asm/kvm_host.h
@@ -24,8 +24,6 @@
#define __ASM_KVM_HOST_H
#define KVM_USER_MEM_SLOTS 32
-/* memory slots that does not exposed to userspace */
-#define KVM_PRIVATE_MEM_SLOTS 4
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 5eb1dd8..23ca70d 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -38,9 +38,7 @@
#define KVM_MAX_VCPUS NR_CPUS
#define KVM_MAX_VCORES NR_CPUS
#define KVM_USER_MEM_SLOTS 32
-/* memory slots that does not exposed to userspace */
-#define KVM_PRIVATE_MEM_SLOTS 4
-#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
+#define KVM_MEM_SLOTS_NUM KVM_USER_MEM_SLOTS
#ifdef CONFIG_KVM_MMIO
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index ac33432..711c5ab 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -21,8 +21,6 @@
#define KVM_MAX_VCPUS 64
#define KVM_USER_MEM_SLOTS 32
-/* memory slots that does not exposed to userspace */
-#define KVM_PRIVATE_MEM_SLOTS 4
struct sca_entry {
atomic_t scn;
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index e619519..ce8b037 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -32,8 +32,8 @@
#define KVM_MAX_VCPUS 254
#define KVM_SOFT_MAX_VCPUS 160
#define KVM_USER_MEM_SLOTS 32
-/* memory slots that does not exposed to userspace */
-#define KVM_PRIVATE_MEM_SLOTS 4
+/* memory slots that are not exposed to userspace */
+#define KVM_PRIVATE_MEM_SLOTS 3
#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
#define KVM_MMIO_SIZE 16
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index fb9354d..bf8380f 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -298,6 +298,10 @@ struct kvm_irq_routing_table {};
#endif
+#ifndef KVM_PRIVATE_MEM_SLOTS
+#define KVM_PRIVATE_MEM_SLOTS 0
+#endif
+
#ifndef KVM_MEM_SLOTS_NUM
#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
#endif
next prev parent reply other threads:[~2012-12-06 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 22:20 [PATCH 00/10] kvm: memory slot cleanups, fix, and increase Alex Williamson
2012-12-06 22:20 ` [PATCH 01/10] kvm: Restrict non-existing slot state transitions Alex Williamson
2012-12-06 22:20 ` [PATCH 02/10] kvm: Check userspace_addr when modifying a memory slot Alex Williamson
2012-12-07 18:17 ` Jason Baron
2012-12-07 18:32 ` Alex Williamson
2012-12-07 18:44 ` Jason Baron
2012-12-06 22:20 ` [PATCH 03/10] kvm: Fix iommu map/unmap to handle memory slot moves Alex Williamson
2012-12-06 22:20 ` [PATCH 04/10] kvm: Minor memory slot optimization Alex Williamson
2012-12-06 22:20 ` [PATCH 05/10] kvm: Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS Alex Williamson
2012-12-06 22:21 ` Alex Williamson [this message]
2012-12-06 22:21 ` [PATCH 07/10] kvm: struct kvm_memory_slot.user_alloc -> bool Alex Williamson
2012-12-06 22:21 ` [PATCH 08/10] kvm: struct kvm_memory_slot.flags -> u32 Alex Williamson
2012-12-06 22:21 ` [PATCH 09/10] kvm: struct kvm_memory_slot.id -> short Alex Williamson
2012-12-06 22:21 ` [PATCH 10/10] kvm: Increase user memory slots on x86 to 125 Alex Williamson
2012-12-07 14:02 ` Takuya Yoshikawa
2012-12-07 16:09 ` Alex Williamson
2012-12-10 13:48 ` Takuya Yoshikawa
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=20121206222103.24968.19718.stgit@bling.home \
--to=alex.williamson@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).