Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 309425 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.26-gentoo/arch/alpha/Kconfig (+26 lines)
Lines 624-629 config HZ Link Here
624
	default 1200 if ALPHA_RAWHIDE
624
	default 1200 if ALPHA_RAWHIDE
625
	default 1024
625
	default 1024
626
626
627
config ALPHA_UAC_SYSCTL
628
	bool "Configure UAC policy via sysctl"
629
	depends on SYSCTL
630
	default y
631
	---help---
632
	  Configuring the UAC (unaligned access control) policy on a Linux
633
	  system usually involves setting a compile time define. If you say
634
	  Y here, you will be able to modify the UAC policy at runtime using
635
	  the /proc interface.
636
637
	  The UAC policy defines the action Linux should take when an
638
	  unaligned memory access occurs. The action can include printing a
639
	  warning message (NOPRINT), sending a signal to the offending
640
	  program to help developers debug their applications (SIGBUS), or
641
	  disabling the transparent fixing (NOFIX).
642
643
	  The sysctls will be initialized to the compile-time defined UAC
644
	  policy. You can change these manually, or with the sysctl(8)
645
	  userspace utility.
646
647
	  To disable the warning messages at runtime, you would use
648
649
	    echo 1 > /proc/sys/kernel/uac/noprint
650
651
	  This is pretty harmless. Say Y if you're not sure.
652
627
source "drivers/pci/Kconfig"
653
source "drivers/pci/Kconfig"
628
source "drivers/eisa/Kconfig"
654
source "drivers/eisa/Kconfig"
629
655
(-)linux-2.6.26-gentoo/arch/alpha/kernel/traps.c (+62 lines)
Lines 103-108 static char * ireg_name[] = {"v0", "t0", Link Here
103
			   "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"};
103
			   "t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"};
104
#endif
104
#endif
105
105
106
#ifdef CONFIG_ALPHA_UAC_SYSCTL
107
108
#include <linux/sysctl.h>
109
110
static int enabled_noprint = 0;
111
static int enabled_sigbus = 0;
112
static int enabled_nofix = 0;
113
114
ctl_table uac_table[] = {
115
   	{
116
		.ctl_name 	= CTL_UNNUMBERED,
117
		.procname 	= "noprint", 
118
		.data 		= &enabled_noprint, 
119
		.maxlen 	= sizeof (int), 
120
		.mode 		= 0644, 
121
		.proc_handler = &proc_dointvec,
122
	},
123
   	{
124
		.ctl_name 	= CTL_UNNUMBERED,
125
		.procname 	= "sigbus", 
126
		.data 		= &enabled_sigbus, 
127
		.maxlen 	= sizeof (int), 
128
		.mode 		= 0644, 
129
		.proc_handler = &proc_dointvec,
130
	},
131
   	{
132
		.ctl_name 	= CTL_UNNUMBERED,
133
		.procname 	= "nofix", 
134
		.data 		= &enabled_nofix, 
135
		.maxlen 	= sizeof (int), 
136
		.mode 		= 0644, 
137
		.proc_handler = &proc_dointvec,
138
	},
139
	{ .ctl_name = 0 }
140
};
141
142
static int __init init_uac_sysctl(void)
143
{
144
   /* Initialize sysctls with the #defined UAC policy */
145
   enabled_noprint = (test_thread_flag (TIF_UAC_NOPRINT)) ? 1 : 0;
146
   enabled_sigbus = (test_thread_flag (TIF_UAC_SIGBUS)) ? 1 : 0;
147
   enabled_nofix = (test_thread_flag (TIF_UAC_NOFIX)) ? 1 : 0;
148
   return 0;
149
}
150
#endif
151
106
static void
152
static void
107
dik_show_code(unsigned int *pc)
153
dik_show_code(unsigned int *pc)
108
{
154
{
Lines 782-788 do_entUnaUser(void __user * va, unsigned Link Here
782
	/* Check the UAC bits to decide what the user wants us to do
828
	/* Check the UAC bits to decide what the user wants us to do
783
	   with the unaliged access.  */
829
	   with the unaliged access.  */
784
830
831
#ifndef CONFIG_ALPHA_UAC_SYSCTL
785
	if (!test_thread_flag (TIF_UAC_NOPRINT)) {
832
	if (!test_thread_flag (TIF_UAC_NOPRINT)) {
833
#else  /* CONFIG_ALPHA_UAC_SYSCTL */
834
	if (!(enabled_noprint)) {
835
#endif /* CONFIG_ALPHA_UAC_SYSCTL */
786
		if (cnt >= 5 && time_after(jiffies, last_time + 5 * HZ)) {
836
		if (cnt >= 5 && time_after(jiffies, last_time + 5 * HZ)) {
787
			cnt = 0;
837
			cnt = 0;
788
		}
838
		}
Lines 793-802 do_entUnaUser(void __user * va, unsigned Link Here
793
		}
843
		}
794
		last_time = jiffies;
844
		last_time = jiffies;
795
	}
845
	}
846
#ifndef CONFIG_ALPHA_UAC_SYSCTL
796
	if (test_thread_flag (TIF_UAC_SIGBUS))
847
	if (test_thread_flag (TIF_UAC_SIGBUS))
848
#else  /* CONFIG_ALPHA_UAC_SYSCTL */
849
   if (enabled_sigbus)
850
#endif /* CONFIG_ALPHA_UAC_SYSCTL */
797
		goto give_sigbus;
851
		goto give_sigbus;
798
	/* Not sure why you'd want to use this, but... */
852
	/* Not sure why you'd want to use this, but... */
853
#ifndef CONFIG_ALPHA_UAC_SYSCTL
799
	if (test_thread_flag (TIF_UAC_NOFIX))
854
	if (test_thread_flag (TIF_UAC_NOFIX))
855
#else  /* CONFIG_ALPHA_UAC_SYSCTL */
856
   if (enabled_nofix)
857
#endif /* CONFIG_ALPHA_UAC_SYSCTL */
800
		return;
858
		return;
801
859
802
	/* Don't bother reading ds in the access check since we already
860
	/* Don't bother reading ds in the access check since we already
Lines 1091-1093 trap_init(void) Link Here
1091
	wrent(entSys, 5);
1149
	wrent(entSys, 5);
1092
	wrent(entDbg, 6);
1150
	wrent(entDbg, 6);
1093
}
1151
}
1152
1153
#ifdef CONFIG_ALPHA_UAC_SYSCTL
1154
	__initcall(init_uac_sysctl);
1155
#endif
(-)a/kernel/sysctl.c (+9 lines)
Lines 239-244 static struct ctl_table root_table[] = { Link Here
239
	{ }
239
	{ }
240
};
240
};
241
241
242
#ifdef CONFIG_ALPHA_UAC_SYSCTL
243
    {
244
        .ctl_name   = CTL_UNNUMBERED,
245
        .procname   = "uac",
246
        .mode       = 0555,
247
        .child      = uac_table,
248
    },
249
#endif /* CONFIG_ALPHA_UAC_SYSCTL */
250
242
#ifdef CONFIG_SCHED_DEBUG
251
#ifdef CONFIG_SCHED_DEBUG
243
static int min_sched_granularity_ns = 100000;		/* 100 usecs */
252
static int min_sched_granularity_ns = 100000;		/* 100 usecs */
244
static int max_sched_granularity_ns = NSEC_PER_SEC;	/* 1 second */
253
static int max_sched_granularity_ns = NSEC_PER_SEC;	/* 1 second */

Return to bug 309425