During recent x86 and x86_64 test builds of the LSK-based LNG kernel branches, the compilation phase failed with two different errors in the KVM sources.
I verified that the affected code was uncorrected in the latest version of LSK, and checked the latest upstream stable kernel at kernel.org for patches which might address the failing compilations.
I found two patches upstream which contained fixes and then backported those portions of the upstream patches which were applicable to the sources in the LSK v3.14 tree.
I verified that the upstream v3.14 KVM code and v3.18 KVM code compiled cleanly for x86_64, but the latest LSK v3.14 KVM code failed to compile. The LSK/LNG code compiled cleanly for armv7a and armv8, including both LE and BE variants. It also compiled cleanly for x86 and x86_64 with the patches applied.
This confirmed that the patches were needed only for the LSK v3.14* branches and for the LNG branches derived from them. I was unsure whether the patches should first be submitted to a local KVM tree or simply submitted directly to LSK, so I sent informal email queries asking for some enlightenment.
Thanks to Christoffer Dall for reviewing the patches and pointing me to the documentation for proper patch submission to the LSK project. I have revised the commit log messages to follow best practices for submission to LSK - and with his permission, added acknowledgements by Christoffer - so I am submitting the patches formally as V2, since the commit headers were modified after being sent for informal review.
During compilation for x86 and x86_64, received the following warning:
virt/kvm/eventfd.c:493:2: error: implicit declaration of function 'kvm_vcpu_request_scan_ioapic' [-Werror=implicit-function-declaration] kvm_vcpu_request_scan_ioapic(kvm);
In the kernel.org linux-stable tree, commit 29f1b65 KVM:EVENTFD: Remove inclusion of irq.h by Christoffer Dall addresses this issue. This backport incudes those portions of that patch which are relevant in the 3.14 tree.
Acked-by: Christoffer Dall christoffer.dall@linaro.org Signed-off-by: Gary S. Robertson gary.robertson@linaro.org --- virt/kvm/eventfd.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 0ab1411..ce3ca4c 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -36,6 +36,9 @@ #include <linux/seqlock.h> #include <trace/events/kvm.h>
+#ifdef __KVM_HAVE_IOAPIC +#include "ioapic.h" +#endif #include "iodev.h"
#ifdef CONFIG_HAVE_KVM_IRQFD
Compilation for x86 /x86_64 resulted in the following error:
virt/kvm/vfio.c:238:30: error: static declaration of 'kvm_vfio_ops' follows non-static declaration static struct kvm_device_ops kvm_vfio_ops include/linux/kvm_host.h:1057:30: note: previous declaration of 'kvm_vfio_ops' was here extern struct kvm_device_ops kvm_vfio_ops;
In the kernel.org linux-stable tree, commit 80ce163 KVM: VFIO: register kvm_device_ops dynamically by Will Deacon includes the removal of the declaration from include/linux/kvm_host.h, but that portion of the change does not seem to have made it into the 3.14 tree - while the rest of that commit does seem to have been backported. This patch resolves that omission to fix the x86 compilation problems.
Acked-by: Christoffer Dall christoffer.dall@linaro.org Signed-off-by: Gary S. Robertson gary.robertson@linaro.org --- include/linux/kvm_host.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 55d75a7..bf933ba 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1054,7 +1054,6 @@ int kvm_register_device_ops(struct kvm_device_ops *ops, u32 type);
extern struct kvm_device_ops kvm_mpic_ops; extern struct kvm_device_ops kvm_xics_ops; -extern struct kvm_device_ops kvm_vfio_ops;
#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
"Gary S. Robertson" gary.robertson@linaro.org writes:
During recent x86 and x86_64 test builds of the LSK-based LNG kernel branches, the compilation phase failed with two different errors in the KVM sources.
I verified that the affected code was uncorrected in the latest version of LSK, and checked the latest upstream stable kernel at kernel.org for patches which might address the failing compilations.
I found two patches upstream which contained fixes and then backported those portions of the upstream patches which were applicable to the sources in the LSK v3.14 tree.
I verified that the upstream v3.14 KVM code and v3.18 KVM code compiled cleanly for x86_64, but the latest LSK v3.14 KVM code failed to compile. The LSK/LNG code compiled cleanly for armv7a and armv8, including both LE and BE variants. It also compiled cleanly for x86 and x86_64 with the patches applied.
This confirmed that the patches were needed only for the LSK v3.14* branches and for the LNG branches derived from them. I was unsure whether the patches should first be submitted to a local KVM tree or simply submitted directly to LSK, so I sent informal email queries asking for some enlightenment.
Thanks to Christoffer Dall for reviewing the patches and pointing me to the documentation for proper patch submission to the LSK project. I have revised the commit log messages to follow best practices for submission to LSK - and with his permission, added acknowledgements by Christoffer - so I am submitting the patches formally as V2, since the commit headers were modified after being sent for informal review.
Applied to LSK branch v3.14/topic/kvm and merged into linux-linaro-lsk-v3.14.
Thanks,
Kevin
linaro-kernel@lists.linaro.org