[kernel] r21849 - in dists/sid/linux/debian: . config/kernelarch-powerpc patches patches/features/powerpc

Aurelien Jarno aurel32 at moszumanska.debian.org
Tue Sep 16 07:21:54 UTC 2014


Author: aurel32
Date: Tue Sep 16 07:21:54 2014
New Revision: 21849

Log:
[powerpc/powerpc64,ppc64el] Backport more KVM patches from 3.17. Enable
KVM_BOOK3S_64_HV, KVM_BOOK3S_64_PR and KVM_XICS, but keep KVM_BOOK3S_64
disabled for now as it would trigger an ABI change (Partially addresses:
#761656).
usb/gadget: Enable USB_NET2280 as module

Added:
   dists/sid/linux/debian/patches/features/powerpc/KVM-Move-more-code-under-CONFIG_HAVE_KVM_IRQFD.patch
   dists/sid/linux/debian/patches/features/powerpc/KVM-PPC-Book3S-Move-vcore-definition-to-end-of-kvm_a.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/config/kernelarch-powerpc/config-arch-64
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Mon Sep 15 16:36:44 2014	(r21848)
+++ dists/sid/linux/debian/changelog	Tue Sep 16 07:21:54 2014	(r21849)
@@ -12,6 +12,12 @@
   [ Ian Campbell ]
   * [armhf] Enable support for Exynos5 systems. (Closes: #759291)
 
+  [ Aurelien Jarno ]
+  * [powerpc/powerpc64,ppc64el] Backport more KVM patches from 3.17. Enable
+    KVM_BOOK3S_64_HV, KVM_BOOK3S_64_PR and KVM_XICS, but keep KVM_BOOK3S_64
+    disabled for now as it would trigger an ABI change (Partially addresses:
+    #761656).
+
  -- Ben Hutchings <ben at decadent.org.uk>  Sat, 13 Sep 2014 22:28:05 +0100
 
 linux (3.16.2-3) unstable; urgency=medium
@@ -39,7 +45,7 @@
   * media/pci/cx23885: Enable MEDIA_ALTERA_CI as module
   * sound/usb: Enable SND_USB_HIFACE, SND_BCD2000 as modules
   * usb/misc: Enable USB_EHSET_TEST_FIXTURE as module
-  * usb/gadget: Enable USB_NET2280 as module
+   usb/gadget: Enable USB_NET2280 as module
   * leds: Enable LEDS_TRIGGER_CPU as built-in and LEDS_TRIGGER_ONESHOT,
     LEDS_TRIGGER_GPIO, LEDS_TRIGGER_TRANSIENT, LEDS_TRIGGER_CAMERA as modules
   * uio: Enable UIO_MF624 as module

Modified: dists/sid/linux/debian/config/kernelarch-powerpc/config-arch-64
==============================================================================
--- dists/sid/linux/debian/config/kernelarch-powerpc/config-arch-64	Mon Sep 15 16:36:44 2014	(r21848)
+++ dists/sid/linux/debian/config/kernelarch-powerpc/config-arch-64	Tue Sep 16 07:21:54 2014	(r21849)
@@ -13,6 +13,14 @@
 CONFIG_KERNEL_START=0xc000000000000000
 
 ##
+## file: arch/powerpc/kvm/Kconfig
+##
+# CONFIG_KVM_BOOK3S_64 is not set
+CONFIG_KVM_BOOK3S_64_HV=m
+CONFIG_KVM_BOOK3S_64_PR=m
+CONFIG_KVM_XICS=y
+
+##
 ## file: arch/powerpc/platforms/Kconfig
 ##
 CONFIG_RTAS_PROC=y

Added: dists/sid/linux/debian/patches/features/powerpc/KVM-Move-more-code-under-CONFIG_HAVE_KVM_IRQFD.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/features/powerpc/KVM-Move-more-code-under-CONFIG_HAVE_KVM_IRQFD.patch	Tue Sep 16 07:21:54 2014	(r21849)
@@ -0,0 +1,231 @@
+From: Paolo Bonzini <pbonzini at redhat.com>
+Date: Wed, 6 Aug 2014 14:24:45 +0200
+Subject: KVM: Move more code under CONFIG_HAVE_KVM_IRQFD
+Origin: https://git.kernel.org/linus/c77dcacb397519b6ade8f08201a4a90a7f4f751e
+
+Commits e4d57e1ee1ab (KVM: Move irq notifier implementation into
+eventfd.c, 2014-06-30) included the irq notifier code unconditionally
+in eventfd.c, while it was under CONFIG_HAVE_KVM_IRQCHIP before.
+
+Similarly, commit 297e21053a52 (KVM: Give IRQFD its own separate enabling
+Kconfig option, 2014-06-30) moved code from CONFIG_HAVE_IRQ_ROUTING
+to CONFIG_HAVE_KVM_IRQFD but forgot to move the pieces that used to be
+under CONFIG_HAVE_KVM_IRQCHIP.
+
+Together, this broke compilation without CONFIG_KVM_XICS.  Fix by adding
+or changing the #ifdefs so that they point at CONFIG_HAVE_KVM_IRQFD.
+
+Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
+---
+ include/linux/kvm_host.h   |   2 +
+ include/trace/events/kvm.h |   8 +--
+ virt/kvm/eventfd.c         | 122 ++++++++++++++++++++++-----------------------
+ virt/kvm/kvm_main.c        |   2 +
+ 4 files changed, 69 insertions(+), 65 deletions(-)
+
+diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
+index 8593d2e..a4c33b3 100644
+--- a/include/linux/kvm_host.h
++++ b/include/linux/kvm_host.h
+@@ -388,6 +388,8 @@ struct kvm {
+ 	 */
+ 	struct kvm_irq_routing_table __rcu *irq_routing;
+ 	struct hlist_head mask_notifier_list;
++#endif
++#ifdef CONFIG_HAVE_KVM_IRQFD
+ 	struct hlist_head irq_ack_notifier_list;
+ #endif
+ 
+diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
+index 131a0bd..908925a 100644
+--- a/include/trace/events/kvm.h
++++ b/include/trace/events/kvm.h
+@@ -37,7 +37,7 @@ TRACE_EVENT(kvm_userspace_exit,
+ 		  __entry->errno < 0 ? -__entry->errno : __entry->reason)
+ );
+ 
+-#if defined(CONFIG_HAVE_KVM_IRQCHIP)
++#if defined(CONFIG_HAVE_KVM_IRQFD)
+ TRACE_EVENT(kvm_set_irq,
+ 	TP_PROTO(unsigned int gsi, int level, int irq_source_id),
+ 	TP_ARGS(gsi, level, irq_source_id),
+@@ -57,7 +57,7 @@ TRACE_EVENT(kvm_set_irq,
+ 	TP_printk("gsi %u level %d source %d",
+ 		  __entry->gsi, __entry->level, __entry->irq_source_id)
+ );
+-#endif
++#endif /* defined(CONFIG_HAVE_KVM_IRQFD) */
+ 
+ #if defined(__KVM_HAVE_IOAPIC)
+ #define kvm_deliver_mode		\
+@@ -124,7 +124,7 @@ TRACE_EVENT(kvm_msi_set_irq,
+ 
+ #endif /* defined(__KVM_HAVE_IOAPIC) */
+ 
+-#if defined(CONFIG_HAVE_KVM_IRQCHIP)
++#if defined(CONFIG_HAVE_KVM_IRQFD)
+ 
+ TRACE_EVENT(kvm_ack_irq,
+ 	TP_PROTO(unsigned int irqchip, unsigned int pin),
+@@ -149,7 +149,7 @@ TRACE_EVENT(kvm_ack_irq,
+ #endif
+ );
+ 
+-#endif /* defined(CONFIG_HAVE_KVM_IRQCHIP) */
++#endif /* defined(CONFIG_HAVE_KVM_IRQFD) */
+ 
+ 
+ 
+diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
+index f5f6154..3c5981c 100644
+--- a/virt/kvm/eventfd.c
++++ b/virt/kvm/eventfd.c
+@@ -445,6 +445,67 @@ out:
+ 	kfree(irqfd);
+ 	return ret;
+ }
++
++bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin)
++{
++	struct kvm_irq_ack_notifier *kian;
++	int gsi, idx;
++
++	idx = srcu_read_lock(&kvm->irq_srcu);
++	gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
++	if (gsi != -1)
++		hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
++					 link)
++			if (kian->gsi == gsi) {
++				srcu_read_unlock(&kvm->irq_srcu, idx);
++				return true;
++			}
++
++	srcu_read_unlock(&kvm->irq_srcu, idx);
++
++	return false;
++}
++EXPORT_SYMBOL_GPL(kvm_irq_has_notifier);
++
++void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
++{
++	struct kvm_irq_ack_notifier *kian;
++	int gsi, idx;
++
++	trace_kvm_ack_irq(irqchip, pin);
++
++	idx = srcu_read_lock(&kvm->irq_srcu);
++	gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
++	if (gsi != -1)
++		hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
++					 link)
++			if (kian->gsi == gsi)
++				kian->irq_acked(kian);
++	srcu_read_unlock(&kvm->irq_srcu, idx);
++}
++
++void kvm_register_irq_ack_notifier(struct kvm *kvm,
++				   struct kvm_irq_ack_notifier *kian)
++{
++	mutex_lock(&kvm->irq_lock);
++	hlist_add_head_rcu(&kian->link, &kvm->irq_ack_notifier_list);
++	mutex_unlock(&kvm->irq_lock);
++#ifdef __KVM_HAVE_IOAPIC
++	kvm_vcpu_request_scan_ioapic(kvm);
++#endif
++}
++
++void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
++				    struct kvm_irq_ack_notifier *kian)
++{
++	mutex_lock(&kvm->irq_lock);
++	hlist_del_init_rcu(&kian->link);
++	mutex_unlock(&kvm->irq_lock);
++	synchronize_srcu(&kvm->irq_srcu);
++#ifdef __KVM_HAVE_IOAPIC
++	kvm_vcpu_request_scan_ioapic(kvm);
++#endif
++}
+ #endif
+ 
+ void
+@@ -867,64 +928,3 @@ kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
+ 
+ 	return kvm_assign_ioeventfd(kvm, args);
+ }
+-
+-bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin)
+-{
+-	struct kvm_irq_ack_notifier *kian;
+-	int gsi, idx;
+-
+-	idx = srcu_read_lock(&kvm->irq_srcu);
+-	gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
+-	if (gsi != -1)
+-		hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
+-					 link)
+-			if (kian->gsi == gsi) {
+-				srcu_read_unlock(&kvm->irq_srcu, idx);
+-				return true;
+-			}
+-
+-	srcu_read_unlock(&kvm->irq_srcu, idx);
+-
+-	return false;
+-}
+-EXPORT_SYMBOL_GPL(kvm_irq_has_notifier);
+-
+-void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
+-{
+-	struct kvm_irq_ack_notifier *kian;
+-	int gsi, idx;
+-
+-	trace_kvm_ack_irq(irqchip, pin);
+-
+-	idx = srcu_read_lock(&kvm->irq_srcu);
+-	gsi = kvm_irq_map_chip_pin(kvm, irqchip, pin);
+-	if (gsi != -1)
+-		hlist_for_each_entry_rcu(kian, &kvm->irq_ack_notifier_list,
+-					 link)
+-			if (kian->gsi == gsi)
+-				kian->irq_acked(kian);
+-	srcu_read_unlock(&kvm->irq_srcu, idx);
+-}
+-
+-void kvm_register_irq_ack_notifier(struct kvm *kvm,
+-				   struct kvm_irq_ack_notifier *kian)
+-{
+-	mutex_lock(&kvm->irq_lock);
+-	hlist_add_head_rcu(&kian->link, &kvm->irq_ack_notifier_list);
+-	mutex_unlock(&kvm->irq_lock);
+-#ifdef __KVM_HAVE_IOAPIC
+-	kvm_vcpu_request_scan_ioapic(kvm);
+-#endif
+-}
+-
+-void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
+-				    struct kvm_irq_ack_notifier *kian)
+-{
+-	mutex_lock(&kvm->irq_lock);
+-	hlist_del_init_rcu(&kian->link);
+-	mutex_unlock(&kvm->irq_lock);
+-	synchronize_srcu(&kvm->irq_srcu);
+-#ifdef __KVM_HAVE_IOAPIC
+-	kvm_vcpu_request_scan_ioapic(kvm);
+-#endif
+-}
+diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
+index a69a623..33712fb 100644
+--- a/virt/kvm/kvm_main.c
++++ b/virt/kvm/kvm_main.c
+@@ -465,6 +465,8 @@ static struct kvm *kvm_create_vm(unsigned long type)
+ 
+ #ifdef CONFIG_HAVE_KVM_IRQCHIP
+ 	INIT_HLIST_HEAD(&kvm->mask_notifier_list);
++#endif
++#ifdef CONFIG_HAVE_KVM_IRQFD
+ 	INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list);
+ #endif
+ 
+-- 
+2.0.0
+

Added: dists/sid/linux/debian/patches/features/powerpc/KVM-PPC-Book3S-Move-vcore-definition-to-end-of-kvm_a.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/features/powerpc/KVM-PPC-Book3S-Move-vcore-definition-to-end-of-kvm_a.patch	Tue Sep 16 07:21:54 2014	(r21849)
@@ -0,0 +1,42 @@
+From: Alexander Graf <agraf at suse.de>
+Date: Fri, 4 Jul 2014 12:52:51 +0200
+Subject: KVM: PPC: Book3S: Move vcore definition to end of kvm_arch struct
+Origin: https://git.kernel.org/linus/1287cb3fa85cd4a0d18402f6a23e1d4c6a9d7b8b
+
+When building KVM with a lot of vcores (NR_CPUS is big), we can potentially
+get out of the ld immediate range for dereferences inside that struct.
+
+Move the array to the end of our kvm_arch struct. This fixes compilation
+issues with NR_CPUS=2048 for me.
+
+Signed-off-by: Alexander Graf <agraf at suse.de>
+---
+ arch/powerpc/include/asm/kvm_host.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
+index faf2f0e..855ba4d 100644
+--- a/arch/powerpc/include/asm/kvm_host.h
++++ b/arch/powerpc/include/asm/kvm_host.h
+@@ -255,7 +255,6 @@ struct kvm_arch {
+ 	atomic_t hpte_mod_interest;
+ 	spinlock_t slot_phys_lock;
+ 	cpumask_t need_tlb_flush;
+-	struct kvmppc_vcore *vcores[KVM_MAX_VCORES];
+ 	int hpt_cma_alloc;
+ #endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
+ #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
+@@ -273,6 +272,10 @@ struct kvm_arch {
+ 	struct kvmppc_xics *xics;
+ #endif
+ 	struct kvmppc_ops *kvm_ops;
++#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
++	/* This array can grow quite large, keep it at the end */
++	struct kvmppc_vcore *vcores[KVM_MAX_VCORES];
++#endif
+ };
+ 
+ /*
+-- 
+2.0.0
+

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Mon Sep 15 16:36:44 2014	(r21848)
+++ dists/sid/linux/debian/patches/series	Tue Sep 16 07:21:54 2014	(r21849)
@@ -84,6 +84,7 @@
 features/powerpc/KVM-PPC-Book3S-HV-Access-XICS-in-BE.patch
 features/powerpc/KVM-PPC-Book3S-HV-Fix-ABIv2-on-LE.patch
 features/powerpc/KVM-PPC-Book3S-HV-Enable-for-little-endian-hosts.patch
+features/powerpc/KVM-PPC-Book3S-Move-vcore-definition-to-end-of-kvm_a.patch
 features/powerpc/KVM-Rename-and-add-argument-to-check_extension.patch
 features/powerpc/KVM-Allow-KVM_CHECK_EXTENSION-on-the-vm-fd.patch
 features/powerpc/KVM-Don-t-keep-reference-to-irq-routing-table-in-irq.patch
@@ -92,6 +93,7 @@
 features/powerpc/KVM-Move-irq-notifier-implementation-into-eventfd.c.patch
 features/powerpc/KVM-Give-IRQFD-its-own-separate-enabling-Kconfig-opt.patch
 features/powerpc/KVM-PPC-Enable-IRQFD-support-for-the-XICS-interrupt-.patch
+features/powerpc/KVM-Move-more-code-under-CONFIG_HAVE_KVM_IRQFD.patch
 features/powerpc/deb-pkg-add-support-for-powerpc-little-endian.patch
 features/x86/x86-memtest-WARN-if-bad-RAM-found.patch
 features/x86/x86-make-x32-syscall-support-conditional.patch



More information about the Kernel-svn-changes mailing list