* [Qemu-devel] [PATCH v2 0/2] s390x: Enable KVM huge page backing support @ 2018-07-31 9:08 Janosch Frank 2018-07-31 9:08 ` [Qemu-devel] [PATCH v2 1/2] kvm: sync linux headers Janosch Frank 2018-07-31 9:09 ` [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support Janosch Frank 0 siblings, 2 replies; 4+ messages in thread From: Janosch Frank @ 2018-07-31 9:08 UTC (permalink / raw) To: qemu-devel; +Cc: borntraeger, david, cohuck Will be available with kernel 4.19. Janosch Frank (2): kvm: sync linux headers s390x: Enable KVM huge page backing support linux-headers/linux/kvm.h | 1 + target/s390x/kvm.c | 6 ++++++ 2 files changed, 7 insertions(+) -- 2.14.3 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] kvm: sync linux headers 2018-07-31 9:08 [Qemu-devel] [PATCH v2 0/2] s390x: Enable KVM huge page backing support Janosch Frank @ 2018-07-31 9:08 ` Janosch Frank 2018-07-31 9:09 ` [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support Janosch Frank 1 sibling, 0 replies; 4+ messages in thread From: Janosch Frank @ 2018-07-31 9:08 UTC (permalink / raw) To: qemu-devel; +Cc: borntraeger, david, cohuck Import KVM_CAP_S390_HPAGE. Placeholder for proper sync. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 98f389a5a3..e3b1e3070c 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -949,6 +949,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_GET_MSR_FEATURES 153 #define KVM_CAP_HYPERV_EVENTFD 154 #define KVM_CAP_HYPERV_TLBFLUSH 155 +#define KVM_CAP_S390_HPAGE 156 #ifdef KVM_CAP_IRQ_ROUTING -- 2.14.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support 2018-07-31 9:08 [Qemu-devel] [PATCH v2 0/2] s390x: Enable KVM huge page backing support Janosch Frank 2018-07-31 9:08 ` [Qemu-devel] [PATCH v2 1/2] kvm: sync linux headers Janosch Frank @ 2018-07-31 9:09 ` Janosch Frank 2018-08-01 9:32 ` Thomas Huth 1 sibling, 1 reply; 4+ messages in thread From: Janosch Frank @ 2018-07-31 9:09 UTC (permalink / raw) To: qemu-devel; +Cc: borntraeger, david, cohuck QEMU has had huge page support for a longer time already, but KVM memory management under s390x needed some changes to work with huge backings. Now that we have support, let's enable it if requested and available. Otherwise we now properly tell the user if there is no support and back out instead of failing to run the VM later on. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> --- target/s390x/kvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index d923cf4240..26e6937498 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -285,6 +285,12 @@ int kvm_arch_init(MachineState *ms, KVMState *s) { MachineClass *mc = MACHINE_GET_CLASS(ms); + if (mem_path && kvm_vm_enable_cap(s, KVM_CAP_S390_HPAGE, 0)) { + error_report("Huge page backing was specified, " + "but this KVM does not support huge pages"); + return -EINVAL; + } + mc->default_cpu_type = S390_CPU_TYPE_NAME("host"); cap_sync_regs = kvm_check_extension(s, KVM_CAP_SYNC_REGS); cap_async_pf = kvm_check_extension(s, KVM_CAP_ASYNC_PF); -- 2.14.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support 2018-07-31 9:09 ` [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support Janosch Frank @ 2018-08-01 9:32 ` Thomas Huth 0 siblings, 0 replies; 4+ messages in thread From: Thomas Huth @ 2018-08-01 9:32 UTC (permalink / raw) To: Janosch Frank, qemu-devel; +Cc: borntraeger, cohuck, david, qemu-s390x On 07/31/2018 11:09 AM, Janosch Frank wrote: > QEMU has had huge page support for a longer time already, but KVM > memory management under s390x needed some changes to work with huge > backings. > > Now that we have support, let's enable it if requested and > available. Otherwise we now properly tell the user if there is no > support and back out instead of failing to run the VM later on. > > Signed-off-by: Janosch Frank <frankja@linux.ibm.com> > --- > target/s390x/kvm.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c > index d923cf4240..26e6937498 100644 > --- a/target/s390x/kvm.c > +++ b/target/s390x/kvm.c > @@ -285,6 +285,12 @@ int kvm_arch_init(MachineState *ms, KVMState *s) > { > MachineClass *mc = MACHINE_GET_CLASS(ms); > > + if (mem_path && kvm_vm_enable_cap(s, KVM_CAP_S390_HPAGE, 0)) { > + error_report("Huge page backing was specified, " > + "but this KVM does not support huge pages"); > + return -EINVAL; > + } I think you should also check the page size of the mem_path (e.g. with qemu_mempath_getpagesize() ?), since a mem_path does not automatically mean huge pages, does it? Thomas PS: Please CC: qemu-s390x@nongnu.org for s390x patches! ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-01 9:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-07-31 9:08 [Qemu-devel] [PATCH v2 0/2] s390x: Enable KVM huge page backing support Janosch Frank 2018-07-31 9:08 ` [Qemu-devel] [PATCH v2 1/2] kvm: sync linux headers Janosch Frank 2018-07-31 9:09 ` [Qemu-devel] [PATCH v2 2/2] s390x: Enable KVM huge page backing support Janosch Frank 2018-08-01 9:32 ` Thomas Huth
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).