[kvm-unit-tests PATCH 2/4] arm64: start_usr: no default vectors

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

 



Don't install default vector handlers on the usermode stack, as
they'll override handlers installed on the kernel stack.

Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 lib/arm64/processor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/arm64/processor.c b/lib/arm64/processor.c
index f0ce882527262..7f84fe3a09fb1 100644
--- a/lib/arm64/processor.c
+++ b/lib/arm64/processor.c
@@ -221,11 +221,16 @@ void install_vector_handler(enum vector v, vector_fn fn)
 		ti->vector_handlers[v] = fn;
 }
 
-void thread_info_init(struct thread_info *ti, unsigned int flags)
+static void __thread_info_init(struct thread_info *ti, unsigned int flags)
 {
 	memset(ti, 0, sizeof(struct thread_info));
 	ti->cpu = mpidr_to_cpu(get_mpidr());
 	ti->flags = flags;
+}
+
+void thread_info_init(struct thread_info *ti, unsigned int flags)
+{
+	__thread_info_init(ti, flags);
 	vector_handlers_default_init(ti->vector_handlers);
 }
 
@@ -233,7 +238,7 @@ void start_usr(void (*func)(void *arg), void *arg, unsigned long sp_usr)
 {
 	sp_usr &= (~15UL); /* stack ptr needs 16-byte alignment */
 
-	thread_info_init(thread_info_sp(sp_usr), TIF_USER_MODE);
+	__thread_info_init(thread_info_sp(sp_usr), TIF_USER_MODE);
 
 	asm volatile(
 		"mov	x0, %0\n"
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux