[tip:tools/kvm] kvm tools: powerpc: Fix init order for xics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  1219d2837bbf2a86e32aab976d9d0d7bf12767f5
Gitweb:     http://git.kernel.org/tip/1219d2837bbf2a86e32aab976d9d0d7bf12767f5
Author:     Michael Neuling <mikey@xxxxxxxxxxx>
AuthorDate: Tue, 20 Aug 2013 13:28:34 +1000
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Tue, 27 Aug 2013 14:50:49 +0300

kvm tools: powerpc: Fix init order for xics

xics_init() assumes kvm->nrcpus is already setup.  kvm->nrcpus is setup
in kvm_cpu_init()

Unfortunately xics_init() and kvm_cpu_init() both use base_init().  So
depending on the order randomly determined by the compiler, xics_init()
may initialised see kvm->nrcpus as 0 and not setup any of the icp VCPU
pointers.  This manifests itself later in boot when trying to raise an
IRQ resulting in a null pointer deference/segv.

This moves xics_init() to use dev_base_init() to ensure it happens after
kvm_cpu_init().

Signed-off-by: Michael Neuling <mikey@xxxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/powerpc/xics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kvm/powerpc/xics.c b/tools/kvm/powerpc/xics.c
index cf64a08..c1ef35b 100644
--- a/tools/kvm/powerpc/xics.c
+++ b/tools/kvm/powerpc/xics.c
@@ -505,7 +505,7 @@ static int xics_init(struct kvm *kvm)
 
 	return 0;
 }
-base_init(xics_init);
+dev_base_init(xics_init);
 
 
 void kvm__irq_line(struct kvm *kvm, int irq, int level)
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux