linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/4] KVM: arm64: Increase number of user memslots
@ 2017-03-07  5:52 linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS linucherian at gmail.com
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: linucherian at gmail.com @ 2017-03-07  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linu Cherian <linu.cherian@cavium.com>


v2 -> v3:
- Added documentation for KVM_CAP_NR_MEMSLOTS
- Removed KVM_PRIVATE_MEM_SLOTS which is unused
- KVM_USER_MEM_SLOTS changed to 512 from 508
 
v1 -> v2:
- Enabling KVM_CAP_NR_MEMSLOTS for arm/arm64 moved to separate patch.
- Updated commit message so that what is reported to userspace is explicit.



Linu Cherian (4):
  KVM: Add documentation for KVM_CAP_NR_MEMSLOTS
  KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
  KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are
    unused
  KVM: arm64: Increase number of user memslots to 512

 Documentation/virtual/kvm/api.txt | 4 ++++
 arch/arm/include/asm/kvm_host.h   | 1 -
 arch/arm/kvm/arm.c                | 3 +++
 arch/arm64/include/asm/kvm_host.h | 3 +--
 4 files changed, 8 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS
  2017-03-07  5:52 [PATCH V3 0/4] KVM: arm64: Increase number of user memslots linucherian at gmail.com
@ 2017-03-07  5:52 ` linucherian at gmail.com
  2017-03-07 14:58   ` Christoffer Dall
  2017-03-07  5:52 ` [PATCH V3 2/4] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: linucherian at gmail.com @ 2017-03-07  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linu Cherian <linu.cherian@cavium.com>

Signed-off-by: Linu Cherian <linu.cherian@cavium.com>
---
 Documentation/virtual/kvm/api.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 03145b7..7b82f1c 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -951,6 +951,10 @@ This ioctl allows the user to create or modify a guest physical memory
 slot.  When changing an existing slot, it may be moved in the guest
 physical memory space, or its flags may be modified.  It may not be
 resized.  Slots may not overlap in guest physical address space.
+Bits 0-15 of "slot" specifies the slot id and this value should be
+less than the maximum number of user memory slots supported per VM.
+The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
+if this capability is supported by the architecture.
 
 If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
 specifies the address space which is being modified.  They must be
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 2/4] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
  2017-03-07  5:52 [PATCH V3 0/4] KVM: arm64: Increase number of user memslots linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS linucherian at gmail.com
@ 2017-03-07  5:52 ` linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 4/4] KVM: arm64: Increase number of user memslots to 512 linucherian at gmail.com
  3 siblings, 0 replies; 7+ messages in thread
From: linucherian at gmail.com @ 2017-03-07  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linu Cherian <linu.cherian@cavium.com>

Return KVM_USER_MEM_SLOTS for userspace capability query on
NR_MEMSLOTS.

Signed-off-by: Linu Cherian <linu.cherian@cavium.com>
---
 arch/arm/kvm/arm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 9d74464..b64b47f 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -221,6 +221,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_MAX_VCPUS:
 		r = KVM_MAX_VCPUS;
 		break;
+	case KVM_CAP_NR_MEMSLOTS:
+		r = KVM_USER_MEM_SLOTS;
+		break;
 	case KVM_CAP_MSI_DEVID:
 		if (!kvm)
 			r = -EINVAL;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused
  2017-03-07  5:52 [PATCH V3 0/4] KVM: arm64: Increase number of user memslots linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS linucherian at gmail.com
  2017-03-07  5:52 ` [PATCH V3 2/4] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
@ 2017-03-07  5:52 ` linucherian at gmail.com
  2017-03-07 14:58   ` Marc Zyngier
  2017-03-07  5:52 ` [PATCH V3 4/4] KVM: arm64: Increase number of user memslots to 512 linucherian at gmail.com
  3 siblings, 1 reply; 7+ messages in thread
From: linucherian at gmail.com @ 2017-03-07  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linu Cherian <linu.cherian@cavium.com>

Signed-off-by: Linu Cherian <linu.cherian@cavium.com>
---
 arch/arm/include/asm/kvm_host.h   | 1 -
 arch/arm64/include/asm/kvm_host.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index d5423ab..b9b39f0 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -30,7 +30,6 @@
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
 #define KVM_USER_MEM_SLOTS 32
-#define KVM_PRIVATE_MEM_SLOTS 4
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #define KVM_HAVE_ONE_REG
 #define KVM_HALT_POLL_NS_DEFAULT 500000
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index e505038..a0409b0 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -31,7 +31,6 @@
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
 #define KVM_USER_MEM_SLOTS 32
-#define KVM_PRIVATE_MEM_SLOTS 4
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #define KVM_HALT_POLL_NS_DEFAULT 500000
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 4/4] KVM: arm64: Increase number of user memslots to 512
  2017-03-07  5:52 [PATCH V3 0/4] KVM: arm64: Increase number of user memslots linucherian at gmail.com
                   ` (2 preceding siblings ...)
  2017-03-07  5:52 ` [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused linucherian at gmail.com
@ 2017-03-07  5:52 ` linucherian at gmail.com
  3 siblings, 0 replies; 7+ messages in thread
From: linucherian at gmail.com @ 2017-03-07  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linu Cherian <linu.cherian@cavium.com>

Having only 32 memslots is a real constraint for the maximum
number of PCI devices that can be assigned to a single guest.
Assuming each PCI device/virtual function having two memory BAR
regions, we could assign only 15 devices/virtual functions to a
guest.

Hence increase KVM_USER_MEM_SLOTS to 512 as done in other archs like
powerpc.

Signed-off-by: Linu Cherian <linu.cherian@cavium.com>
---
 arch/arm64/include/asm/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index a0409b0..4027002 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -30,7 +30,7 @@
 
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
-#define KVM_USER_MEM_SLOTS 32
+#define KVM_USER_MEM_SLOTS 512
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #define KVM_HALT_POLL_NS_DEFAULT 500000
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS
  2017-03-07  5:52 ` [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS linucherian at gmail.com
@ 2017-03-07 14:58   ` Christoffer Dall
  0 siblings, 0 replies; 7+ messages in thread
From: Christoffer Dall @ 2017-03-07 14:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 07, 2017 at 11:22:41AM +0530, linucherian at gmail.com wrote:
> From: Linu Cherian <linu.cherian@cavium.com>

Please add a patch description, even if it just repeats the subject line
as in this case.

Otherwise:

Acked-by: Christoffer Dall <cdall@linaro.org>

> 
> Signed-off-by: Linu Cherian <linu.cherian@cavium.com>
> ---
>  Documentation/virtual/kvm/api.txt | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index 03145b7..7b82f1c 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -951,6 +951,10 @@ This ioctl allows the user to create or modify a guest physical memory
>  slot.  When changing an existing slot, it may be moved in the guest
>  physical memory space, or its flags may be modified.  It may not be
>  resized.  Slots may not overlap in guest physical address space.
> +Bits 0-15 of "slot" specifies the slot id and this value should be
> +less than the maximum number of user memory slots supported per VM.
> +The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
> +if this capability is supported by the architecture.
>  
>  If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
>  specifies the address space which is being modified.  They must be
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused
  2017-03-07  5:52 ` [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused linucherian at gmail.com
@ 2017-03-07 14:58   ` Marc Zyngier
  0 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2017-03-07 14:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 07 2017 at  5:52:43 am GMT, linucherian at gmail.com wrote:
> From: Linu Cherian <linu.cherian@cavium.com>
>
> Signed-off-by: Linu Cherian <linu.cherian@cavium.com>

Please add a decent commit message. Even if this is an obvious patch,
explain the rational behind it. Patch 1 has the same problem.

Thanks,

	M.
-- 
Jazz is not dead, it just smell funny.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-07 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07  5:52 [PATCH V3 0/4] KVM: arm64: Increase number of user memslots linucherian at gmail.com
2017-03-07  5:52 ` [PATCH V3 1/4] KVM: Add documentation for KVM_CAP_NR_MEMSLOTS linucherian at gmail.com
2017-03-07 14:58   ` Christoffer Dall
2017-03-07  5:52 ` [PATCH V3 2/4] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
2017-03-07  5:52 ` [PATCH V3 3/4] KVM: arm/arm64: Remove KVM_PRIVATE_MEM_SLOTS definition that are unused linucherian at gmail.com
2017-03-07 14:58   ` Marc Zyngier
2017-03-07  5:52 ` [PATCH V3 4/4] KVM: arm64: Increase number of user memslots to 512 linucherian at gmail.com

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).