* [PATCH V2 0/2] KVM: arm64: Increase number of user memslots
@ 2017-02-08 7:15 linucherian at gmail.com
2017-02-08 7:15 ` [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
2017-02-08 7:15 ` [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508 linucherian at gmail.com
0 siblings, 2 replies; 8+ messages in thread
From: linucherian at gmail.com @ 2017-02-08 7:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Linu Cherian <linu.cherian@cavium.com>
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 (2):
KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
KVM: arm64: Increase number of user memslots to 508
arch/arm/kvm/arm.c | 3 +++
arch/arm64/include/asm/kvm_host.h | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
--
1.9.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
2017-02-08 7:15 [PATCH V2 0/2] KVM: arm64: Increase number of user memslots linucherian at gmail.com
@ 2017-02-08 7:15 ` linucherian at gmail.com
2017-02-23 10:10 ` Christoffer Dall
2017-02-08 7:15 ` [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508 linucherian at gmail.com
1 sibling, 1 reply; 8+ messages in thread
From: linucherian at gmail.com @ 2017-02-08 7:15 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] 8+ messages in thread
* [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
2017-02-08 7:15 ` [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
@ 2017-02-23 10:10 ` Christoffer Dall
2017-02-26 4:30 ` Linu Cherian
0 siblings, 1 reply; 8+ messages in thread
From: Christoffer Dall @ 2017-02-23 10:10 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 08, 2017 at 12:45:40PM +0530, linucherian at gmail.com wrote:
> From: Linu Cherian <linu.cherian@cavium.com>
>
> Return KVM_USER_MEM_SLOTS for userspace capability query on
> NR_MEMSLOTS.
This feature seems to be undocumented (I cannot find it in
Documentation/virtual/kvm/api.txt).
Can we add documentation for it?
What does user space do currently without this capability? Does it just
rely on some default?
Thanks,
-Christoffer
>
> 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 [flat|nested] 8+ messages in thread
* [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64
2017-02-23 10:10 ` Christoffer Dall
@ 2017-02-26 4:30 ` Linu Cherian
0 siblings, 0 replies; 8+ messages in thread
From: Linu Cherian @ 2017-02-26 4:30 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Feb 23, 2017 at 3:40 PM, Christoffer Dall <cdall@linaro.org> wrote:
> On Wed, Feb 08, 2017 at 12:45:40PM +0530, linucherian at gmail.com wrote:
>> From: Linu Cherian <linu.cherian@cavium.com>
>>
>> Return KVM_USER_MEM_SLOTS for userspace capability query on
>> NR_MEMSLOTS.
>
> This feature seems to be undocumented (I cannot find it in
> Documentation/virtual/kvm/api.txt).
>
> Can we add documentation for it?
>
> What does user space do currently without this capability? Does it just
> rely on some default?
>
Yes, without this capability, qemu userspace take the default value of 32.
Will give it a try on the documentation part as a separate patch.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508
2017-02-08 7:15 [PATCH V2 0/2] KVM: arm64: Increase number of user memslots linucherian at gmail.com
2017-02-08 7:15 ` [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
@ 2017-02-08 7:15 ` linucherian at gmail.com
2017-02-23 10:14 ` Christoffer Dall
1 sibling, 1 reply; 8+ messages in thread
From: linucherian at gmail.com @ 2017-02-08 7:15 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 508, so that KVM_MEM_SLOTS_NUM is
512 as done in other archs like x86 and 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 e505038..88f017d 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 508
#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] 8+ messages in thread
* [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508
2017-02-08 7:15 ` [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508 linucherian at gmail.com
@ 2017-02-23 10:14 ` Christoffer Dall
2017-02-26 7:06 ` Linu Cherian
0 siblings, 1 reply; 8+ messages in thread
From: Christoffer Dall @ 2017-02-23 10:14 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 08, 2017 at 12:45:41PM +0530, linucherian at gmail.com wrote:
> 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 508, so that KVM_MEM_SLOTS_NUM is
> 512 as done in other archs like x86 and powerpc.
Actually on powerpc they just define KVM_USER_MEM_SLOTS as 512 directly.
On x86 they define them as 509 and have 3 private mem slots.
I don't understand the difference and as far as I can tell we don't have
any private memslots on arm/arm64, so this is just weird to me.
Thanks,
-Christoffer
>
> 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 e505038..88f017d 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 508
> #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 [flat|nested] 8+ messages in thread
* [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508
2017-02-23 10:14 ` Christoffer Dall
@ 2017-02-26 7:06 ` Linu Cherian
2017-03-02 12:29 ` Christoffer Dall
0 siblings, 1 reply; 8+ messages in thread
From: Linu Cherian @ 2017-02-26 7:06 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Feb 23, 2017 at 3:44 PM, Christoffer Dall <cdall@linaro.org> wrote:
> On Wed, Feb 08, 2017 at 12:45:41PM +0530, linucherian at gmail.com wrote:
>> 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 508, so that KVM_MEM_SLOTS_NUM is
>> 512 as done in other archs like x86 and powerpc.
>
> Actually on powerpc they just define KVM_USER_MEM_SLOTS as 512 directly.
>
> On x86 they define them as 509 and have 3 private mem slots.
>
> I don't understand the difference and as far as I can tell we don't have
> any private memslots on arm/arm64, so this is just weird to me.
>
Since the KVM_PRIVATE_MEM_SLOTS was already defined as 4, just kept
it untouched. Should we remove this and keep KVM_USER_MEM_SLOTS as 512 ?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508
2017-02-26 7:06 ` Linu Cherian
@ 2017-03-02 12:29 ` Christoffer Dall
0 siblings, 0 replies; 8+ messages in thread
From: Christoffer Dall @ 2017-03-02 12:29 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Feb 26, 2017 at 12:36:58PM +0530, Linu Cherian wrote:
> On Thu, Feb 23, 2017 at 3:44 PM, Christoffer Dall <cdall@linaro.org> wrote:
> > On Wed, Feb 08, 2017 at 12:45:41PM +0530, linucherian at gmail.com wrote:
> >> 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 508, so that KVM_MEM_SLOTS_NUM is
> >> 512 as done in other archs like x86 and powerpc.
> >
> > Actually on powerpc they just define KVM_USER_MEM_SLOTS as 512 directly.
> >
> > On x86 they define them as 509 and have 3 private mem slots.
> >
> > I don't understand the difference and as far as I can tell we don't have
> > any private memslots on arm/arm64, so this is just weird to me.
> >
>
> Since the KVM_PRIVATE_MEM_SLOTS was already defined as 4, just kept
> it untouched. Should we remove this and keep KVM_USER_MEM_SLOTS as 512 ?
Do we have any use for KVM_PRIVATE_MEM_SLOTSA being 4? I can't seem to
see this.
I think we should either get rid of the definition or at least make sure
we understand why we're doing things this way.
Thanks,
-Christoffer
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-03-02 12:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-08 7:15 [PATCH V2 0/2] KVM: arm64: Increase number of user memslots linucherian at gmail.com
2017-02-08 7:15 ` [PATCH V2 1/2] KVM: arm/arm64: Enable KVM_CAP_NR_MEMSLOTS on arm/arm64 linucherian at gmail.com
2017-02-23 10:10 ` Christoffer Dall
2017-02-26 4:30 ` Linu Cherian
2017-02-08 7:15 ` [PATCH V2 2/2] KVM: arm64: Increase number of user memslots to 508 linucherian at gmail.com
2017-02-23 10:14 ` Christoffer Dall
2017-02-26 7:06 ` Linu Cherian
2017-03-02 12:29 ` Christoffer Dall
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).