+ powerpc-implement-pr_et_unalign-prctls-for-powerpc.patch added to -mm tree

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

 



The patch titled

     powerpc: Implement PR_[GS]ET_UNALIGN prctls for powerpc

has been added to the -mm tree.  Its filename is

     powerpc-implement-pr_et_unalign-prctls-for-powerpc.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: powerpc: Implement PR_[GS]ET_UNALIGN prctls for powerpc
From: Paul Mackerras <paulus@xxxxxxxxx>


This gives the ability to control whether alignment exceptions get fixed up or
reported to the process as a SIGBUS, using the existing PR_SET_UNALIGN and
PR_GET_UNALIGN prctls.  We do not implement the option of logging a message on
alignment exceptions.

Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Anton Blanchard <anton@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/powerpc/kernel/process.c   |   11 +++++++++++
 arch/powerpc/kernel/traps.c     |    6 ++++--
 include/asm-powerpc/processor.h |    7 +++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff -puN arch/powerpc/kernel/process.c~powerpc-implement-pr_et_unalign-prctls-for-powerpc arch/powerpc/kernel/process.c
--- devel/arch/powerpc/kernel/process.c~powerpc-implement-pr_et_unalign-prctls-for-powerpc	2006-06-06 23:23:27.000000000 -0700
+++ devel-akpm/arch/powerpc/kernel/process.c	2006-06-06 23:23:27.000000000 -0700
@@ -752,6 +752,17 @@ int get_endian(struct task_struct *tsk, 
 	return put_user(val, (unsigned int __user *)adr);
 }
 
+int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
+{
+	tsk->thread.align_ctl = val;
+	return 0;
+}
+
+int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
+{
+	return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
+}
+
 #define TRUNC_PTR(x)	((typeof(x))(((unsigned long)(x)) & 0xffffffff))
 
 int sys_clone(unsigned long clone_flags, unsigned long usp,
diff -puN arch/powerpc/kernel/traps.c~powerpc-implement-pr_et_unalign-prctls-for-powerpc arch/powerpc/kernel/traps.c
--- devel/arch/powerpc/kernel/traps.c~powerpc-implement-pr_et_unalign-prctls-for-powerpc	2006-06-06 23:23:27.000000000 -0700
+++ devel-akpm/arch/powerpc/kernel/traps.c	2006-06-06 23:23:27.000000000 -0700
@@ -805,9 +805,11 @@ void __kprobes program_check_exception(s
 
 void alignment_exception(struct pt_regs *regs)
 {
-	int fixed;
+	int fixed = 0;
 
-	fixed = fix_alignment(regs);
+	/* we don't implement logging of alignment exceptions */
+	if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
+		fixed = fix_alignment(regs);
 
 	if (fixed == 1) {
 		regs->nip += 4;	/* skip over emulated instruction */
diff -puN include/asm-powerpc/processor.h~powerpc-implement-pr_et_unalign-prctls-for-powerpc include/asm-powerpc/processor.h
--- devel/include/asm-powerpc/processor.h~powerpc-implement-pr_et_unalign-prctls-for-powerpc	2006-06-06 23:23:27.000000000 -0700
+++ devel-akpm/include/asm-powerpc/processor.h	2006-06-06 23:23:27.000000000 -0700
@@ -149,6 +149,7 @@ struct thread_struct {
 		unsigned int val;	/* Floating point status */
 	} fpscr;
 	int		fpexc_mode;	/* floating-point exception mode */
+	unsigned int	align_ctl;	/* alignment handling control */
 #ifdef CONFIG_PPC64
 	unsigned long	start_tb;	/* Start purr when proc switched in */
 	unsigned long	accum_tb;	/* Total accumilated purr for process */
@@ -217,6 +218,12 @@ extern int set_fpexc_mode(struct task_st
 extern int get_endian(struct task_struct *tsk, unsigned long adr);
 extern int set_endian(struct task_struct *tsk, unsigned int val);
 
+#define GET_UNALIGN_CTL(tsk, adr)	get_unalign_ctl((tsk), (adr))
+#define SET_UNALIGN_CTL(tsk, val)	set_unalign_ctl((tsk), (val))
+
+extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr);
+extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val);
+
 static inline unsigned int __unpack_fe01(unsigned long msr_bits)
 {
 	return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8);
_

Patches currently in -mm which might be from paulus@xxxxxxxxx are

macintosh-mangle-caps-lock-events-on-adb-keyboards.patch
fix-make-rpm-for-powerpc.patch
ppp_async-hang-fix.patch
git-powerpc.patch
powerpc-kbuild-warning-fix.patch
powerpc-vdso-updates.patch
work-around-ppc64-bootup-bug-by-making-mutex-debugging-save-restore-irqs.patch
powerpc-implement-support-for-setting.patch
powerpc-implement-pr_et_unalign-prctls-for-powerpc.patch
add-poisonh-and-patch-primary-users.patch
x86-powerpc-make-hardirq_ctx-and-softirq_ctx-__read_mostly.patch
define-__raw_get_cpu_var-and-use-it.patch
allow-for-per-cpu-data-being-in-tdata-and-tbss-sections.patch
allow-for-per-cpu-data-being-in-tdata-and-tbss-sections-fix.patch
allow-for-per-cpu-data-being-in-tdata-and-tbss-sections-tidy.patch
apple-motion-sensor-driver.patch
drivers-use-list_move.patch
lock-validator-add-per_cpu_offset-fix.patch

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

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux