aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/acpi/boot.c5
-rw-r--r--arch/i386/kernel/apic.c4
-rw-r--r--arch/i386/kernel/setup.c4
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c4
-rw-r--r--arch/powerpc/kernel/sysfs.c18
-rw-r--r--arch/powerpc/mm/numa.c32
-rw-r--r--arch/powerpc/platforms/cell/Kconfig3
-rw-r--r--arch/powerpc/platforms/cell/setup.c78
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c91
-rw-r--r--arch/s390/kernel/signal.c5
-rw-r--r--arch/sparc64/mm/tlb.c5
-rw-r--r--arch/um/Kconfig14
-rw-r--r--arch/um/Kconfig.i38619
-rw-r--r--arch/um/Makefile19
-rw-r--r--arch/um/defconfig240
-rw-r--r--arch/um/drivers/cow_user.c2
-rw-r--r--arch/um/kernel/irq.c93
-rw-r--r--arch/um/kernel/physmem.c2
-rw-r--r--arch/um/kernel/skas/Makefile10
-rw-r--r--arch/um/os-Linux/file.c2
-rw-r--r--arch/um/os-Linux/irq.c47
-rw-r--r--arch/um/os-Linux/main.c30
-rw-r--r--arch/um/os-Linux/process.c17
-rw-r--r--arch/um/os-Linux/skas/process.c6
-rw-r--r--arch/um/os-Linux/sys-i386/registers.c4
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c4
-rw-r--r--arch/um/os-Linux/umid.c4
-rw-r--r--arch/um/os-Linux/user_syms.c7
-rw-r--r--arch/um/scripts/Makefile.rules12
-rw-r--r--arch/um/sys-i386/Makefile13
-rw-r--r--arch/um/sys-x86_64/Makefile13
-rw-r--r--arch/x86_64/ia32/ia32entry.S1
-rw-r--r--arch/x86_64/kernel/setup.c19
33 files changed, 503 insertions, 324 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 049a25583793..4c785a67d585 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -215,7 +215,7 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
215{ 215{
216 struct acpi_table_madt *madt = NULL; 216 struct acpi_table_madt *madt = NULL;
217 217
218 if (!phys_addr || !size || !cpu_has_apic) 218 if (!phys_addr || !size)
219 return -EINVAL; 219 return -EINVAL;
220 220
221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size); 221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
@@ -1151,6 +1151,9 @@ int __init acpi_boot_init(void)
1151 1151
1152 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); 1152 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
1153 1153
1154 if (!cpu_has_apic)
1155 return -ENODEV;
1156
1154 /* 1157 /*
1155 * set sci_int and PM timer address 1158 * set sci_int and PM timer address
1156 */ 1159 */
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 254cee9f0b7b..013b85df18c6 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -757,10 +757,6 @@ static int __init apic_set_verbosity(char *str)
757 apic_verbosity = APIC_DEBUG; 757 apic_verbosity = APIC_DEBUG;
758 else if (strcmp("verbose", str) == 0) 758 else if (strcmp("verbose", str) == 0)
759 apic_verbosity = APIC_VERBOSE; 759 apic_verbosity = APIC_VERBOSE;
760 else
761 printk(KERN_WARNING "APIC Verbosity level %s not recognised"
762 " use apic=verbose or apic=debug\n", str);
763
764 return 1; 760 return 1;
765} 761}
766 762
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 80cb3b2d0997..d77e89ac0d54 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -970,8 +970,10 @@ efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
970 * not-overlapping, which is the case 970 * not-overlapping, which is the case
971 */ 971 */
972int __init 972int __init
973e820_all_mapped(unsigned long start, unsigned long end, unsigned type) 973e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
974{ 974{
975 u64 start = s;
976 u64 end = e;
975 int i; 977 int i;
976 for (i = 0; i < e820.nr_map; i++) { 978 for (i = 0; i < e820.nr_map; i++) {
977 struct e820entry *ei = &e820.map[i]; 979 struct e820entry *ei = &e820.map[i];
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 5e41ee29c8cf..f1187ddb0d0f 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
279{ 279{
280 struct cpufreq_freqs *freq = data; 280 struct cpufreq_freqs *freq = data;
281 281
282 if (val != CPUFREQ_RESUMECHANGE) 282 if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
283 write_seqlock_irq(&xtime_lock); 283 write_seqlock_irq(&xtime_lock);
284 if (!ref_freq) { 284 if (!ref_freq) {
285 if (!freq->old){ 285 if (!freq->old){
@@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
312 } 312 }
313 313
314end: 314end:
315 if (val != CPUFREQ_RESUMECHANGE) 315 if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
316 write_sequnlock_irq(&xtime_lock); 316 write_sequnlock_irq(&xtime_lock);
317 317
318 return 0; 318 return 0;
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index ed737cacf92d..5bc2585c8036 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -322,13 +322,31 @@ static void register_nodes(void)
322 } 322 }
323 } 323 }
324} 324}
325
326int sysfs_add_device_to_node(struct sys_device *dev, int nid)
327{
328 struct node *node = &node_devices[nid];
329 return sysfs_create_link(&node->sysdev.kobj, &dev->kobj,
330 kobject_name(&dev->kobj));
331}
332
333void sysfs_remove_device_from_node(struct sys_device *dev, int nid)
334{
335 struct node *node = &node_devices[nid];
336 sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj));
337}
338
325#else 339#else
326static void register_nodes(void) 340static void register_nodes(void)
327{ 341{
328 return; 342 return;
329} 343}
344
330#endif 345#endif
331 346
347EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
348EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
349
332/* Only valid if CPU is present. */ 350/* Only valid if CPU is present. */
333static ssize_t show_physical_id(struct sys_device *dev, char *buf) 351static ssize_t show_physical_id(struct sys_device *dev, char *buf)
334{ 352{
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 0a335f34974c..092355f37399 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -194,7 +194,7 @@ static int *of_get_associativity(struct device_node *dev)
194/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa 194/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
195 * info is found. 195 * info is found.
196 */ 196 */
197static int of_node_to_nid(struct device_node *device) 197static int of_node_to_nid_single(struct device_node *device)
198{ 198{
199 int nid = -1; 199 int nid = -1;
200 unsigned int *tmp; 200 unsigned int *tmp;
@@ -216,6 +216,28 @@ out:
216 return nid; 216 return nid;
217} 217}
218 218
219/* Walk the device tree upwards, looking for an associativity id */
220int of_node_to_nid(struct device_node *device)
221{
222 struct device_node *tmp;
223 int nid = -1;
224
225 of_node_get(device);
226 while (device) {
227 nid = of_node_to_nid_single(device);
228 if (nid != -1)
229 break;
230
231 tmp = device;
232 device = of_get_parent(tmp);
233 of_node_put(tmp);
234 }
235 of_node_put(device);
236
237 return nid;
238}
239EXPORT_SYMBOL_GPL(of_node_to_nid);
240
219/* 241/*
220 * In theory, the "ibm,associativity" property may contain multiple 242 * In theory, the "ibm,associativity" property may contain multiple
221 * associativity lists because a resource may be multiply connected 243 * associativity lists because a resource may be multiply connected
@@ -300,7 +322,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
300 goto out; 322 goto out;
301 } 323 }
302 324
303 nid = of_node_to_nid(cpu); 325 nid = of_node_to_nid_single(cpu);
304 326
305 if (nid < 0 || !node_online(nid)) 327 if (nid < 0 || !node_online(nid))
306 nid = any_online_node(NODE_MASK_ALL); 328 nid = any_online_node(NODE_MASK_ALL);
@@ -393,7 +415,7 @@ static int __init parse_numa_properties(void)
393 415
394 cpu = find_cpu_node(i); 416 cpu = find_cpu_node(i);
395 BUG_ON(!cpu); 417 BUG_ON(!cpu);
396 nid = of_node_to_nid(cpu); 418 nid = of_node_to_nid_single(cpu);
397 of_node_put(cpu); 419 of_node_put(cpu);
398 420
399 /* 421 /*
@@ -437,7 +459,7 @@ new_range:
437 * have associativity properties. If none, then 459 * have associativity properties. If none, then
438 * everything goes to default_nid. 460 * everything goes to default_nid.
439 */ 461 */
440 nid = of_node_to_nid(memory); 462 nid = of_node_to_nid_single(memory);
441 if (nid < 0) 463 if (nid < 0)
442 nid = default_nid; 464 nid = default_nid;
443 node_set_online(nid); 465 node_set_online(nid);
@@ -776,7 +798,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
776ha_new_range: 798ha_new_range:
777 start = read_n_cells(n_mem_addr_cells, &memcell_buf); 799 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
778 size = read_n_cells(n_mem_size_cells, &memcell_buf); 800 size = read_n_cells(n_mem_size_cells, &memcell_buf);
779 nid = of_node_to_nid(memory); 801 nid = of_node_to_nid_single(memory);
780 802
781 /* Domains not present at boot default to 0 */ 803 /* Domains not present at boot default to 0 */
782 if (nid < 0 || !node_online(nid)) 804 if (nid < 0 || !node_online(nid))
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index c2a3db8edb0c..6a02d51086c8 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -12,7 +12,8 @@ config SPU_FS
12 12
13config SPUFS_MMAP 13config SPUFS_MMAP
14 bool 14 bool
15 depends on SPU_FS && SPARSEMEM && !PPC_64K_PAGES 15 depends on SPU_FS && SPARSEMEM
16 select MEMORY_HOTPLUG
16 default y 17 default y
17 18
18endmenu 19endmenu
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index dac5d0365fde..6574b22b3cf3 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -29,6 +29,8 @@
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
30#include <linux/root_dev.h> 30#include <linux/root_dev.h>
31#include <linux/console.h> 31#include <linux/console.h>
32#include <linux/mutex.h>
33#include <linux/memory_hotplug.h>
32 34
33#include <asm/mmu.h> 35#include <asm/mmu.h>
34#include <asm/processor.h> 36#include <asm/processor.h>
@@ -46,6 +48,7 @@
46#include <asm/cputable.h> 48#include <asm/cputable.h>
47#include <asm/ppc-pci.h> 49#include <asm/ppc-pci.h>
48#include <asm/irq.h> 50#include <asm/irq.h>
51#include <asm/spu.h>
49 52
50#include "interrupt.h" 53#include "interrupt.h"
51#include "iommu.h" 54#include "iommu.h"
@@ -69,77 +72,6 @@ static void cell_show_cpuinfo(struct seq_file *m)
69 of_node_put(root); 72 of_node_put(root);
70} 73}
71 74
72#ifdef CONFIG_SPARSEMEM
73static int __init find_spu_node_id(struct device_node *spe)
74{
75 unsigned int *id;
76#ifdef CONFIG_NUMA
77 struct device_node *cpu;
78 cpu = spe->parent->parent;
79 id = (unsigned int *)get_property(cpu, "node-id", NULL);
80#else
81 id = NULL;
82#endif
83 return id ? *id : 0;
84}
85
86static void __init cell_spuprop_present(struct device_node *spe,
87 const char *prop, int early)
88{
89 struct address_prop {
90 unsigned long address;
91 unsigned int len;
92 } __attribute__((packed)) *p;
93 int proplen;
94
95 unsigned long start_pfn, end_pfn, pfn;
96 int node_id;
97
98 p = (void*)get_property(spe, prop, &proplen);
99 WARN_ON(proplen != sizeof (*p));
100
101 node_id = find_spu_node_id(spe);
102
103 start_pfn = p->address >> PAGE_SHIFT;
104 end_pfn = (p->address + p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
105
106 /* We need to call memory_present *before* the call to sparse_init,
107 but we can initialize the page structs only *after* that call.
108 Thus, we're being called twice. */
109 if (early)
110 memory_present(node_id, start_pfn, end_pfn);
111 else {
112 /* As the pages backing SPU LS and I/O are outside the range
113 of regular memory, their page structs were not initialized
114 by free_area_init. Do it here instead. */
115 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
116 struct page *page = pfn_to_page(pfn);
117 set_page_links(page, ZONE_DMA, node_id, pfn);
118 init_page_count(page);
119 reset_page_mapcount(page);
120 SetPageReserved(page);
121 INIT_LIST_HEAD(&page->lru);
122 }
123 }
124}
125
126static void __init cell_spumem_init(int early)
127{
128 struct device_node *node;
129 for (node = of_find_node_by_type(NULL, "spe");
130 node; node = of_find_node_by_type(node, "spe")) {
131 cell_spuprop_present(node, "local-store", early);
132 cell_spuprop_present(node, "problem", early);
133 cell_spuprop_present(node, "priv1", early);
134 cell_spuprop_present(node, "priv2", early);
135 }
136}
137#else
138static void __init cell_spumem_init(int early)
139{
140}
141#endif
142
143static void cell_progress(char *s, unsigned short hex) 75static void cell_progress(char *s, unsigned short hex)
144{ 76{
145 printk("*** %04x : %s\n", hex, s ? s : ""); 77 printk("*** %04x : %s\n", hex, s ? s : "");
@@ -172,8 +104,6 @@ static void __init cell_setup_arch(void)
172#endif 104#endif
173 105
174 mmio_nvram_init(); 106 mmio_nvram_init();
175
176 cell_spumem_init(0);
177} 107}
178 108
179/* 109/*
@@ -189,8 +119,6 @@ static void __init cell_init_early(void)
189 119
190 ppc64_interrupt_controller = IC_CELL_PIC; 120 ppc64_interrupt_controller = IC_CELL_PIC;
191 121
192 cell_spumem_init(1);
193
194 DBG(" <- cell_init_early()\n"); 122 DBG(" <- cell_init_early()\n");
195} 123}
196 124
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index ef47a6239d48..ad141fe8d52d 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -520,8 +520,50 @@ void spu_irq_setaffinity(struct spu *spu, int cpu)
520} 520}
521EXPORT_SYMBOL_GPL(spu_irq_setaffinity); 521EXPORT_SYMBOL_GPL(spu_irq_setaffinity);
522 522
523static void __iomem * __init map_spe_prop(struct device_node *n, 523static int __init find_spu_node_id(struct device_node *spe)
524 const char *name) 524{
525 unsigned int *id;
526 struct device_node *cpu;
527 cpu = spe->parent->parent;
528 id = (unsigned int *)get_property(cpu, "node-id", NULL);
529 return id ? *id : 0;
530}
531
532static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
533 const char *prop)
534{
535 static DEFINE_MUTEX(add_spumem_mutex);
536
537 struct address_prop {
538 unsigned long address;
539 unsigned int len;
540 } __attribute__((packed)) *p;
541 int proplen;
542
543 unsigned long start_pfn, nr_pages;
544 struct pglist_data *pgdata;
545 struct zone *zone;
546 int ret;
547
548 p = (void*)get_property(spe, prop, &proplen);
549 WARN_ON(proplen != sizeof (*p));
550
551 start_pfn = p->address >> PAGE_SHIFT;
552 nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
553
554 pgdata = NODE_DATA(spu->nid);
555 zone = pgdata->node_zones;
556
557 /* XXX rethink locking here */
558 mutex_lock(&add_spumem_mutex);
559 ret = __add_pages(zone, start_pfn, nr_pages);
560 mutex_unlock(&add_spumem_mutex);
561
562 return ret;
563}
564
565static void __iomem * __init map_spe_prop(struct spu *spu,
566 struct device_node *n, const char *name)
525{ 567{
526 struct address_prop { 568 struct address_prop {
527 unsigned long address; 569 unsigned long address;
@@ -530,6 +572,8 @@ static void __iomem * __init map_spe_prop(struct device_node *n,
530 572
531 void *p; 573 void *p;
532 int proplen; 574 int proplen;
575 void* ret = NULL;
576 int err = 0;
533 577
534 p = get_property(n, name, &proplen); 578 p = get_property(n, name, &proplen);
535 if (proplen != sizeof (struct address_prop)) 579 if (proplen != sizeof (struct address_prop))
@@ -537,7 +581,14 @@ static void __iomem * __init map_spe_prop(struct device_node *n,
537 581
538 prop = p; 582 prop = p;
539 583
540 return ioremap(prop->address, prop->len); 584 err = cell_spuprop_present(spu, n, name);
585 if (err && (err != -EEXIST))
586 goto out;
587
588 ret = ioremap(prop->address, prop->len);
589
590 out:
591 return ret;
541} 592}
542 593
543static void spu_unmap(struct spu *spu) 594static void spu_unmap(struct spu *spu)
@@ -548,44 +599,45 @@ static void spu_unmap(struct spu *spu)
548 iounmap((u8 __iomem *)spu->local_store); 599 iounmap((u8 __iomem *)spu->local_store);
549} 600}
550 601
551static int __init spu_map_device(struct spu *spu, struct device_node *spe) 602static int __init spu_map_device(struct spu *spu, struct device_node *node)
552{ 603{
553 char *prop; 604 char *prop;
554 int ret; 605 int ret;
555 606
556 ret = -ENODEV; 607 ret = -ENODEV;
557 prop = get_property(spe, "isrc", NULL); 608 prop = get_property(node, "isrc", NULL);
558 if (!prop) 609 if (!prop)
559 goto out; 610 goto out;
560 spu->isrc = *(unsigned int *)prop; 611 spu->isrc = *(unsigned int *)prop;
561 612
562 spu->name = get_property(spe, "name", NULL); 613 spu->name = get_property(node, "name", NULL);
563 if (!spu->name) 614 if (!spu->name)
564 goto out; 615 goto out;
565 616
566 prop = get_property(spe, "local-store", NULL); 617 prop = get_property(node, "local-store", NULL);
567 if (!prop) 618 if (!prop)
568 goto out; 619 goto out;
569 spu->local_store_phys = *(unsigned long *)prop; 620 spu->local_store_phys = *(unsigned long *)prop;
570 621
571 /* we use local store as ram, not io memory */ 622 /* we use local store as ram, not io memory */
572 spu->local_store = (void __force *)map_spe_prop(spe, "local-store"); 623 spu->local_store = (void __force *)
624 map_spe_prop(spu, node, "local-store");
573 if (!spu->local_store) 625 if (!spu->local_store)
574 goto out; 626 goto out;
575 627
576 prop = get_property(spe, "problem", NULL); 628 prop = get_property(node, "problem", NULL);
577 if (!prop) 629 if (!prop)
578 goto out_unmap; 630 goto out_unmap;
579 spu->problem_phys = *(unsigned long *)prop; 631 spu->problem_phys = *(unsigned long *)prop;
580 632
581 spu->problem= map_spe_prop(spe, "problem"); 633 spu->problem= map_spe_prop(spu, node, "problem");
582 if (!spu->problem) 634 if (!spu->problem)
583 goto out_unmap; 635 goto out_unmap;
584 636
585 spu->priv1= map_spe_prop(spe, "priv1"); 637 spu->priv1= map_spe_prop(spu, node, "priv1");
586 /* priv1 is not available on a hypervisor */ 638 /* priv1 is not available on a hypervisor */
587 639
588 spu->priv2= map_spe_prop(spe, "priv2"); 640 spu->priv2= map_spe_prop(spu, node, "priv2");
589 if (!spu->priv2) 641 if (!spu->priv2)
590 goto out_unmap; 642 goto out_unmap;
591 ret = 0; 643 ret = 0;
@@ -597,17 +649,6 @@ out:
597 return ret; 649 return ret;
598} 650}
599 651
600static int __init find_spu_node_id(struct device_node *spe)
601{
602 unsigned int *id;
603 struct device_node *cpu;
604
605 cpu = spe->parent->parent;
606 id = (unsigned int *)get_property(cpu, "node-id", NULL);
607
608 return id ? *id : 0;
609}
610
611static int __init create_spu(struct device_node *spe) 652static int __init create_spu(struct device_node *spe)
612{ 653{
613 struct spu *spu; 654 struct spu *spu;
@@ -624,6 +665,10 @@ static int __init create_spu(struct device_node *spe)
624 goto out_free; 665 goto out_free;
625 666
626 spu->node = find_spu_node_id(spe); 667 spu->node = find_spu_node_id(spe);
668 spu->nid = of_node_to_nid(spe);
669 if (spu->nid == -1)
670 spu->nid = 0;
671
627 spu->stop_code = 0; 672 spu->stop_code = 0;
628 spu->slb_replace = 0; 673 spu->slb_replace = 0;
629 spu->mm = NULL; 674 spu->mm = NULL;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index ae1927e48cfb..d48cfc726b68 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -358,8 +358,9 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
358 } else { 358 } else {
359 regs->gprs[14] = (unsigned long) 359 regs->gprs[14] = (unsigned long)
360 frame->retcode | PSW_ADDR_AMODE; 360 frame->retcode | PSW_ADDR_AMODE;
361 err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn, 361 if (__put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
362 (u16 __user *)(frame->retcode)); 362 (u16 __user *)(frame->retcode)))
363 goto give_sigsegv;
363 } 364 }
364 365
365 /* Set up backchain. */ 366 /* Set up backchain. */
diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c
index a079cf42505e..3f10fc921b00 100644
--- a/arch/sparc64/mm/tlb.c
+++ b/arch/sparc64/mm/tlb.c
@@ -8,6 +8,7 @@
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/swap.h> 10#include <linux/swap.h>
11#include <linux/preempt.h>
11 12
12#include <asm/pgtable.h> 13#include <asm/pgtable.h>
13#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
@@ -24,6 +25,8 @@ void flush_tlb_pending(void)
24{ 25{
25 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers); 26 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
26 27
28 preempt_disable();
29
27 if (mp->tlb_nr) { 30 if (mp->tlb_nr) {
28 flush_tsb_user(mp); 31 flush_tsb_user(mp);
29 32
@@ -38,6 +41,8 @@ void flush_tlb_pending(void)
38 } 41 }
39 mp->tlb_nr = 0; 42 mp->tlb_nr = 0;
40 } 43 }
44
45 preempt_enable();
41} 46}
42 47
43void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig) 48void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig)
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 05fbb20636cb..76e85bbaea55 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -57,20 +57,6 @@ config STATIC_LINK
57 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y 57 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y
58 here. 58 here.
59 59
60config HOST_2G_2G
61 bool "2G/2G host address space split"
62 default n
63 depends on MODE_TT
64 help
65 This is needed when the host on which you run has a 2G/2G memory
66 split, instead of the customary 3G/1G.
67
68 Note that to enable such a host
69 configuration, which makes sense only in some cases, you need special
70 host patches.
71
72 So, if you do not know what to do here, say 'N'.
73
74config KERNEL_HALF_GIGS 60config KERNEL_HALF_GIGS
75 int "Kernel address space size (in .5G units)" 61 int "Kernel address space size (in .5G units)"
76 default "1" 62 default "1"
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386
index 85e6a55b3b59..f6eb72d117b9 100644
--- a/arch/um/Kconfig.i386
+++ b/arch/um/Kconfig.i386
@@ -16,6 +16,19 @@ config SEMAPHORE_SLEEPERS
16 bool 16 bool
17 default y 17 default y
18 18
19config HOST_2G_2G
20 bool "2G/2G host address space split"
21 default n
22 help
23 This is needed when the host on which you run has a 2G/2G memory
24 split, instead of the customary 3G/1G.
25
26 Note that to enable such a host
27 configuration, which makes sense only in some cases, you need special
28 host patches.
29
30 So, if you do not know what to do here, say 'N'.
31
19config TOP_ADDR 32config TOP_ADDR
20 hex 33 hex
21 default 0xc0000000 if !HOST_2G_2G 34 default 0xc0000000 if !HOST_2G_2G
@@ -35,11 +48,13 @@ config 3_LEVEL_PGTABLES
35 48
36config STUB_CODE 49config STUB_CODE
37 hex 50 hex
38 default 0xbfffe000 51 default 0xbfffe000 if !HOST_2G_2G
52 default 0x7fffe000 if HOST_2G_2G
39 53
40config STUB_DATA 54config STUB_DATA
41 hex 55 hex
42 default 0xbffff000 56 default 0xbffff000 if !HOST_2G_2G
57 default 0x7ffff000 if HOST_2G_2G
43 58
44config STUB_START 59config STUB_START
45 hex 60 hex
diff --git a/arch/um/Makefile b/arch/um/Makefile
index a508e7a02891..f6ad832faf13 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -96,7 +96,8 @@ PHONY += linux
96all: linux 96all: linux
97 97
98linux: vmlinux 98linux: vmlinux
99 ln -f $< $@ 99 @echo ' LINK $@'
100 $(Q)ln -f $< $@
100 101
101define archhelp 102define archhelp
102 echo '* linux - Binary kernel image (./linux) - for backward' 103 echo '* linux - Binary kernel image (./linux) - for backward'
@@ -117,6 +118,10 @@ prepare: $(ARCH_DIR)/include/kern_constants.h
117LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 118LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
118LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 119LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
119 120
121CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
122 $(call cc-option, -fno-stack-protector,) \
123 $(call cc-option, -fno-stack-protector-all,)
124
120CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT 125CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT
121CONFIG_KERNEL_STACK_ORDER ?= 2 126CONFIG_KERNEL_STACK_ORDER ?= 2
122STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 127STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
@@ -203,8 +208,8 @@ endef
203$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h 208$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
204 $(call filechk,umlconfig) 209 $(call filechk,umlconfig)
205 210
206$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c 211$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
207 $(CC) $(USER_CFLAGS) -S -o $@ $< 212 $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
208 213
209define filechk_gen-asm-offsets 214define filechk_gen-asm-offsets
210 (set -e; \ 215 (set -e; \
@@ -219,13 +224,11 @@ define filechk_gen-asm-offsets
219 echo ""; ) 224 echo ""; )
220endef 225endef
221 226
222$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s 227$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
223 $(call filechk,gen-asm-offsets) 228 $(call filechk,gen-asm-offsets)
224 229
225CLEAN_FILES += $(ARCH_DIR)/user-offsets.s
226
227$(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include 230$(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include
228 @echo ' SYMLINK $@' 231 @echo ' SYMLINK $@'
229 $(Q) ln -sf ../../../include/asm-um/asm-offsets.h $@ 232 $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@
230 233
231export SUBARCH USER_CFLAGS OS 234export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS
diff --git a/arch/um/defconfig b/arch/um/defconfig
index 80d30d19d750..402a74dc5026 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -1,14 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc6-mm1 3# Linux kernel version: 2.6.17-rc3
4# Tue Jun 14 18:22:21 2005 4# Fri Apr 28 09:31:20 2006
5# 5#
6CONFIG_GENERIC_HARDIRQS=y 6CONFIG_GENERIC_HARDIRQS=y
7CONFIG_UML=y 7CONFIG_UML=y
8CONFIG_MMU=y 8CONFIG_MMU=y
9CONFIG_UID16=y
10CONFIG_RWSEM_GENERIC_SPINLOCK=y
11CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_IRQ_RELEASE_METHOD=y
12 11
13# 12#
14# UML-specific options 13# UML-specific options
@@ -16,8 +15,50 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
16# CONFIG_MODE_TT is not set 15# CONFIG_MODE_TT is not set
17# CONFIG_STATIC_LINK is not set 16# CONFIG_STATIC_LINK is not set
18CONFIG_MODE_SKAS=y 17CONFIG_MODE_SKAS=y
18
19#
20# Host processor type and features
21#
22# CONFIG_M386 is not set
23# CONFIG_M486 is not set
24# CONFIG_M586 is not set
25# CONFIG_M586TSC is not set
26# CONFIG_M586MMX is not set
27CONFIG_M686=y
28# CONFIG_MPENTIUMII is not set
29# CONFIG_MPENTIUMIII is not set
30# CONFIG_MPENTIUMM is not set
31# CONFIG_MPENTIUM4 is not set
32# CONFIG_MK6 is not set
33# CONFIG_MK7 is not set
34# CONFIG_MK8 is not set
35# CONFIG_MCRUSOE is not set
36# CONFIG_MEFFICEON is not set
37# CONFIG_MWINCHIPC6 is not set
38# CONFIG_MWINCHIP2 is not set
39# CONFIG_MWINCHIP3D is not set
40# CONFIG_MGEODEGX1 is not set
41# CONFIG_MGEODE_LX is not set
42# CONFIG_MCYRIXIII is not set
43# CONFIG_MVIAC3_2 is not set
44# CONFIG_X86_GENERIC is not set
45CONFIG_X86_CMPXCHG=y
46CONFIG_X86_XADD=y
47CONFIG_X86_L1_CACHE_SHIFT=5
48CONFIG_RWSEM_XCHGADD_ALGORITHM=y
49CONFIG_X86_PPRO_FENCE=y
50CONFIG_X86_WP_WORKS_OK=y
51CONFIG_X86_INVLPG=y
52CONFIG_X86_BSWAP=y
53CONFIG_X86_POPAD_OK=y
54CONFIG_X86_CMPXCHG64=y
55CONFIG_X86_GOOD_APIC=y
56CONFIG_X86_USE_PPRO_CHECKSUM=y
57CONFIG_X86_TSC=y
19CONFIG_UML_X86=y 58CONFIG_UML_X86=y
20# CONFIG_64BIT is not set 59# CONFIG_64BIT is not set
60CONFIG_SEMAPHORE_SLEEPERS=y
61# CONFIG_HOST_2G_2G is not set
21CONFIG_TOP_ADDR=0xc0000000 62CONFIG_TOP_ADDR=0xc0000000
22# CONFIG_3_LEVEL_PGTABLES is not set 63# CONFIG_3_LEVEL_PGTABLES is not set
23CONFIG_STUB_CODE=0xbfffe000 64CONFIG_STUB_CODE=0xbfffe000
@@ -25,22 +66,24 @@ CONFIG_STUB_DATA=0xbffff000
25CONFIG_STUB_START=0xbfffe000 66CONFIG_STUB_START=0xbfffe000
26CONFIG_ARCH_HAS_SC_SIGNALS=y 67CONFIG_ARCH_HAS_SC_SIGNALS=y
27CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y 68CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
69CONFIG_GENERIC_HWEIGHT=y
28CONFIG_SELECT_MEMORY_MODEL=y 70CONFIG_SELECT_MEMORY_MODEL=y
29CONFIG_FLATMEM_MANUAL=y 71CONFIG_FLATMEM_MANUAL=y
30# CONFIG_DISCONTIGMEM_MANUAL is not set 72# CONFIG_DISCONTIGMEM_MANUAL is not set
31# CONFIG_SPARSEMEM_MANUAL is not set 73# CONFIG_SPARSEMEM_MANUAL is not set
32CONFIG_FLATMEM=y 74CONFIG_FLATMEM=y
33CONFIG_FLAT_NODE_MEM_MAP=y 75CONFIG_FLAT_NODE_MEM_MAP=y
76# CONFIG_SPARSEMEM_STATIC is not set
77CONFIG_SPLIT_PTLOCK_CPUS=4
34CONFIG_LD_SCRIPT_DYN=y 78CONFIG_LD_SCRIPT_DYN=y
35CONFIG_NET=y 79CONFIG_NET=y
36CONFIG_BINFMT_ELF=y 80CONFIG_BINFMT_ELF=y
37CONFIG_BINFMT_MISC=m 81CONFIG_BINFMT_MISC=m
38# CONFIG_HOSTFS is not set 82# CONFIG_HOSTFS is not set
83# CONFIG_HPPFS is not set
39CONFIG_MCONSOLE=y 84CONFIG_MCONSOLE=y
40# CONFIG_MAGIC_SYSRQ is not set 85# CONFIG_MAGIC_SYSRQ is not set
41# CONFIG_HOST_2G_2G is not set
42CONFIG_NEST_LEVEL=0 86CONFIG_NEST_LEVEL=0
43CONFIG_KERNEL_HALF_GIGS=1
44# CONFIG_HIGHMEM is not set 87# CONFIG_HIGHMEM is not set
45CONFIG_KERNEL_STACK_ORDER=2 88CONFIG_KERNEL_STACK_ORDER=2
46CONFIG_UML_REAL_TIME_CLOCK=y 89CONFIG_UML_REAL_TIME_CLOCK=y
@@ -49,7 +92,6 @@ CONFIG_UML_REAL_TIME_CLOCK=y
49# Code maturity level options 92# Code maturity level options
50# 93#
51CONFIG_EXPERIMENTAL=y 94CONFIG_EXPERIMENTAL=y
52CONFIG_CLEAN_COMPILE=y
53CONFIG_BROKEN_ON_SMP=y 95CONFIG_BROKEN_ON_SMP=y
54CONFIG_INIT_ENV_ARG_LIMIT=32 96CONFIG_INIT_ENV_ARG_LIMIT=32
55 97
@@ -57,6 +99,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
57# General setup 99# General setup
58# 100#
59CONFIG_LOCALVERSION="" 101CONFIG_LOCALVERSION=""
102CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y 103CONFIG_SWAP=y
61CONFIG_SYSVIPC=y 104CONFIG_SYSVIPC=y
62CONFIG_POSIX_MQUEUE=y 105CONFIG_POSIX_MQUEUE=y
@@ -64,26 +107,28 @@ CONFIG_BSD_PROCESS_ACCT=y
64# CONFIG_BSD_PROCESS_ACCT_V3 is not set 107# CONFIG_BSD_PROCESS_ACCT_V3 is not set
65CONFIG_SYSCTL=y 108CONFIG_SYSCTL=y
66# CONFIG_AUDIT is not set 109# CONFIG_AUDIT is not set
67# CONFIG_HOTPLUG is not set
68CONFIG_KOBJECT_UEVENT=y
69CONFIG_IKCONFIG=y 110CONFIG_IKCONFIG=y
70CONFIG_IKCONFIG_PROC=y 111CONFIG_IKCONFIG_PROC=y
112# CONFIG_RELAY is not set
113CONFIG_INITRAMFS_SOURCE=""
114CONFIG_UID16=y
115CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71# CONFIG_EMBEDDED is not set 116# CONFIG_EMBEDDED is not set
72CONFIG_KALLSYMS=y 117CONFIG_KALLSYMS=y
73# CONFIG_KALLSYMS_ALL is not set 118# CONFIG_KALLSYMS_ALL is not set
74CONFIG_KALLSYMS_EXTRA_PASS=y 119CONFIG_KALLSYMS_EXTRA_PASS=y
120CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y 121CONFIG_PRINTK=y
76CONFIG_BUG=y 122CONFIG_BUG=y
123CONFIG_ELF_CORE=y
77CONFIG_BASE_FULL=y 124CONFIG_BASE_FULL=y
78CONFIG_FUTEX=y 125CONFIG_FUTEX=y
79CONFIG_EPOLL=y 126CONFIG_EPOLL=y
80CONFIG_SHMEM=y 127CONFIG_SHMEM=y
81CONFIG_CC_ALIGN_FUNCTIONS=0 128CONFIG_SLAB=y
82CONFIG_CC_ALIGN_LABELS=0
83CONFIG_CC_ALIGN_LOOPS=0
84CONFIG_CC_ALIGN_JUMPS=0
85# CONFIG_TINY_SHMEM is not set 129# CONFIG_TINY_SHMEM is not set
86CONFIG_BASE_SMALL=0 130CONFIG_BASE_SMALL=0
131# CONFIG_SLOB is not set
87 132
88# 133#
89# Loadable module support 134# Loadable module support
@@ -91,18 +136,43 @@ CONFIG_BASE_SMALL=0
91CONFIG_MODULES=y 136CONFIG_MODULES=y
92CONFIG_MODULE_UNLOAD=y 137CONFIG_MODULE_UNLOAD=y
93# CONFIG_MODULE_FORCE_UNLOAD is not set 138# CONFIG_MODULE_FORCE_UNLOAD is not set
94CONFIG_OBSOLETE_MODPARM=y
95# CONFIG_MODVERSIONS is not set 139# CONFIG_MODVERSIONS is not set
96# CONFIG_MODULE_SRCVERSION_ALL is not set 140# CONFIG_MODULE_SRCVERSION_ALL is not set
97CONFIG_KMOD=y 141CONFIG_KMOD=y
98 142
99# 143#
100# Generic Driver Options 144# Block layer
101# 145#
102CONFIG_STANDALONE=y 146# CONFIG_LBD is not set
103CONFIG_PREVENT_FIRMWARE_BUILD=y 147# CONFIG_BLK_DEV_IO_TRACE is not set
104# CONFIG_FW_LOADER is not set 148# CONFIG_LSF is not set
105# CONFIG_DEBUG_DRIVER is not set 149
150#
151# IO Schedulers
152#
153CONFIG_IOSCHED_NOOP=y
154CONFIG_IOSCHED_AS=y
155CONFIG_IOSCHED_DEADLINE=y
156CONFIG_IOSCHED_CFQ=y
157CONFIG_DEFAULT_AS=y
158# CONFIG_DEFAULT_DEADLINE is not set
159# CONFIG_DEFAULT_CFQ is not set
160# CONFIG_DEFAULT_NOOP is not set
161CONFIG_DEFAULT_IOSCHED="anticipatory"
162
163#
164# Block devices
165#
166CONFIG_BLK_DEV_UBD=y
167# CONFIG_BLK_DEV_UBD_SYNC is not set
168CONFIG_BLK_DEV_COW_COMMON=y
169# CONFIG_MMAPPER is not set
170CONFIG_BLK_DEV_LOOP=m
171# CONFIG_BLK_DEV_CRYPTOLOOP is not set
172CONFIG_BLK_DEV_NBD=m
173# CONFIG_BLK_DEV_RAM is not set
174# CONFIG_BLK_DEV_INITRD is not set
175# CONFIG_ATA_OVER_ETH is not set
106 176
107# 177#
108# Character Devices 178# Character Devices
@@ -127,50 +197,23 @@ CONFIG_UML_SOUND=m
127CONFIG_SOUND=m 197CONFIG_SOUND=m
128CONFIG_HOSTAUDIO=m 198CONFIG_HOSTAUDIO=m
129CONFIG_UML_RANDOM=y 199CONFIG_UML_RANDOM=y
130# CONFIG_MMAPPER is not set
131
132#
133# Block devices
134#
135CONFIG_BLK_DEV_UBD=y
136CONFIG_BLK_DEV_UBD_SYNC=y
137CONFIG_BLK_DEV_COW_COMMON=y
138CONFIG_BLK_DEV_LOOP=m
139# CONFIG_BLK_DEV_CRYPTOLOOP is not set
140CONFIG_BLK_DEV_NBD=m
141# CONFIG_BLK_DEV_RAM is not set
142CONFIG_BLK_DEV_RAM_COUNT=16
143CONFIG_INITRAMFS_SOURCE=""
144# CONFIG_LBD is not set
145
146#
147# IO Schedulers
148#
149CONFIG_IOSCHED_NOOP=y
150CONFIG_IOSCHED_AS=y
151CONFIG_IOSCHED_DEADLINE=y
152CONFIG_IOSCHED_CFQ=y
153# CONFIG_ATA_OVER_ETH is not set
154CONFIG_NETDEVICES=y
155 200
156# 201#
157# UML Network Devices 202# Generic Driver Options
158# 203#
159CONFIG_UML_NET=y 204CONFIG_STANDALONE=y
160CONFIG_UML_NET_ETHERTAP=y 205CONFIG_PREVENT_FIRMWARE_BUILD=y
161CONFIG_UML_NET_TUNTAP=y 206# CONFIG_FW_LOADER is not set
162CONFIG_UML_NET_SLIP=y 207# CONFIG_DEBUG_DRIVER is not set
163CONFIG_UML_NET_DAEMON=y
164CONFIG_UML_NET_MCAST=y
165CONFIG_UML_NET_SLIRP=y
166 208
167# 209#
168# Networking support 210# Networking
169# 211#
170 212
171# 213#
172# Networking options 214# Networking options
173# 215#
216# CONFIG_NETDEBUG is not set
174CONFIG_PACKET=y 217CONFIG_PACKET=y
175CONFIG_PACKET_MMAP=y 218CONFIG_PACKET_MMAP=y
176CONFIG_UNIX=y 219CONFIG_UNIX=y
@@ -178,6 +221,7 @@ CONFIG_UNIX=y
178CONFIG_INET=y 221CONFIG_INET=y
179# CONFIG_IP_MULTICAST is not set 222# CONFIG_IP_MULTICAST is not set
180# CONFIG_IP_ADVANCED_ROUTER is not set 223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
181# CONFIG_IP_PNP is not set 225# CONFIG_IP_PNP is not set
182# CONFIG_NET_IPIP is not set 226# CONFIG_NET_IPIP is not set
183# CONFIG_NET_IPGRE is not set 227# CONFIG_NET_IPGRE is not set
@@ -186,27 +230,31 @@ CONFIG_INET=y
186# CONFIG_INET_AH is not set 230# CONFIG_INET_AH is not set
187# CONFIG_INET_ESP is not set 231# CONFIG_INET_ESP is not set
188# CONFIG_INET_IPCOMP is not set 232# CONFIG_INET_IPCOMP is not set
233# CONFIG_INET_XFRM_TUNNEL is not set
189# CONFIG_INET_TUNNEL is not set 234# CONFIG_INET_TUNNEL is not set
190CONFIG_IP_TCPDIAG=y 235CONFIG_INET_DIAG=y
191# CONFIG_IP_TCPDIAG_IPV6 is not set 236CONFIG_INET_TCP_DIAG=y
192 237# CONFIG_TCP_CONG_ADVANCED is not set
193#
194# TCP congestion control
195#
196CONFIG_TCP_CONG_BIC=y 238CONFIG_TCP_CONG_BIC=y
197CONFIG_TCP_CONG_WESTWOOD=y
198CONFIG_TCP_CONG_HTCP=y
199# CONFIG_TCP_CONG_HSTCP is not set
200# CONFIG_TCP_CONG_HYBLA is not set
201# CONFIG_TCP_CONG_VEGAS is not set
202# CONFIG_TCP_CONG_SCALABLE is not set
203# CONFIG_IPV6 is not set 239# CONFIG_IPV6 is not set
240# CONFIG_INET6_XFRM_TUNNEL is not set
241# CONFIG_INET6_TUNNEL is not set
204# CONFIG_NETFILTER is not set 242# CONFIG_NETFILTER is not set
205 243
206# 244#
245# DCCP Configuration (EXPERIMENTAL)
246#
247# CONFIG_IP_DCCP is not set
248
249#
207# SCTP Configuration (EXPERIMENTAL) 250# SCTP Configuration (EXPERIMENTAL)
208# 251#
209# CONFIG_IP_SCTP is not set 252# CONFIG_IP_SCTP is not set
253
254#
255# TIPC Configuration (EXPERIMENTAL)
256#
257# CONFIG_TIPC is not set
210# CONFIG_ATM is not set 258# CONFIG_ATM is not set
211# CONFIG_BRIDGE is not set 259# CONFIG_BRIDGE is not set
212# CONFIG_VLAN_8021Q is not set 260# CONFIG_VLAN_8021Q is not set
@@ -224,27 +272,47 @@ CONFIG_TCP_CONG_HTCP=y
224# QoS and/or fair queueing 272# QoS and/or fair queueing
225# 273#
226# CONFIG_NET_SCHED is not set 274# CONFIG_NET_SCHED is not set
227# CONFIG_NET_CLS_ROUTE is not set
228 275
229# 276#
230# Network testing 277# Network testing
231# 278#
232# CONFIG_NET_PKTGEN is not set 279# CONFIG_NET_PKTGEN is not set
233# CONFIG_KGDBOE is not set
234# CONFIG_NETPOLL is not set
235# CONFIG_NETPOLL_RX is not set
236# CONFIG_NETPOLL_TRAP is not set
237# CONFIG_NET_POLL_CONTROLLER is not set
238# CONFIG_HAMRADIO is not set 280# CONFIG_HAMRADIO is not set
239# CONFIG_IRDA is not set 281# CONFIG_IRDA is not set
240# CONFIG_BT is not set 282# CONFIG_BT is not set
241# CONFIG_IEEE80211 is not set 283# CONFIG_IEEE80211 is not set
284
285#
286# UML Network Devices
287#
288CONFIG_UML_NET=y
289CONFIG_UML_NET_ETHERTAP=y
290CONFIG_UML_NET_TUNTAP=y
291CONFIG_UML_NET_SLIP=y
292CONFIG_UML_NET_DAEMON=y
293CONFIG_UML_NET_MCAST=y
294# CONFIG_UML_NET_PCAP is not set
295CONFIG_UML_NET_SLIRP=y
296
297#
298# Network device support
299#
300CONFIG_NETDEVICES=y
242CONFIG_DUMMY=m 301CONFIG_DUMMY=m
243# CONFIG_BONDING is not set 302# CONFIG_BONDING is not set
244# CONFIG_EQUALIZER is not set 303# CONFIG_EQUALIZER is not set
245CONFIG_TUN=m 304CONFIG_TUN=m
246 305
247# 306#
307# PHY device support
308#
309
310#
311# Wireless LAN (non-hamradio)
312#
313# CONFIG_NET_RADIO is not set
314
315#
248# Wan interfaces 316# Wan interfaces
249# 317#
250# CONFIG_WAN is not set 318# CONFIG_WAN is not set
@@ -263,6 +331,13 @@ CONFIG_SLIP=m
263# CONFIG_SLIP_MODE_SLIP6 is not set 331# CONFIG_SLIP_MODE_SLIP6 is not set
264# CONFIG_SHAPER is not set 332# CONFIG_SHAPER is not set
265# CONFIG_NETCONSOLE is not set 333# CONFIG_NETCONSOLE is not set
334# CONFIG_NETPOLL is not set
335# CONFIG_NET_POLL_CONTROLLER is not set
336
337#
338# Connector - unified userspace <-> kernelspace linker
339#
340# CONFIG_CONNECTOR is not set
266 341
267# 342#
268# File systems 343# File systems
@@ -274,17 +349,14 @@ CONFIG_EXT3_FS=y
274# CONFIG_EXT3_FS_XATTR is not set 349# CONFIG_EXT3_FS_XATTR is not set
275CONFIG_JBD=y 350CONFIG_JBD=y
276# CONFIG_JBD_DEBUG is not set 351# CONFIG_JBD_DEBUG is not set
277# CONFIG_REISER4_FS is not set
278CONFIG_REISERFS_FS=y 352CONFIG_REISERFS_FS=y
279# CONFIG_REISERFS_CHECK is not set 353# CONFIG_REISERFS_CHECK is not set
280# CONFIG_REISERFS_PROC_INFO is not set 354# CONFIG_REISERFS_PROC_INFO is not set
281# CONFIG_REISERFS_FS_XATTR is not set 355# CONFIG_REISERFS_FS_XATTR is not set
282# CONFIG_JFS_FS is not set 356# CONFIG_JFS_FS is not set
283 357# CONFIG_FS_POSIX_ACL is not set
284#
285# XFS support
286#
287# CONFIG_XFS_FS is not set 358# CONFIG_XFS_FS is not set
359# CONFIG_OCFS2_FS is not set
288# CONFIG_MINIX_FS is not set 360# CONFIG_MINIX_FS is not set
289# CONFIG_ROMFS_FS is not set 361# CONFIG_ROMFS_FS is not set
290CONFIG_INOTIFY=y 362CONFIG_INOTIFY=y
@@ -295,11 +367,6 @@ CONFIG_QUOTACTL=y
295CONFIG_DNOTIFY=y 367CONFIG_DNOTIFY=y
296CONFIG_AUTOFS_FS=m 368CONFIG_AUTOFS_FS=m
297CONFIG_AUTOFS4_FS=m 369CONFIG_AUTOFS4_FS=m
298
299#
300# Caches
301#
302# CONFIG_FSCACHE is not set
303# CONFIG_FUSE_FS is not set 370# CONFIG_FUSE_FS is not set
304 371
305# 372#
@@ -323,14 +390,10 @@ CONFIG_JOLIET=y
323CONFIG_PROC_FS=y 390CONFIG_PROC_FS=y
324CONFIG_PROC_KCORE=y 391CONFIG_PROC_KCORE=y
325CONFIG_SYSFS=y 392CONFIG_SYSFS=y
326# CONFIG_DEVFS_FS is not set
327# CONFIG_DEVPTS_FS_XATTR is not set
328CONFIG_TMPFS=y 393CONFIG_TMPFS=y
329# CONFIG_TMPFS_XATTR is not set
330# CONFIG_HUGETLB_PAGE is not set 394# CONFIG_HUGETLB_PAGE is not set
331CONFIG_RAMFS=y 395CONFIG_RAMFS=y
332# CONFIG_CONFIGFS_FS is not set 396# CONFIG_CONFIGFS_FS is not set
333# CONFIG_RELAYFS_FS is not set
334 397
335# 398#
336# Miscellaneous filesystems 399# Miscellaneous filesystems
@@ -430,6 +493,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
430# Library routines 493# Library routines
431# 494#
432# CONFIG_CRC_CCITT is not set 495# CONFIG_CRC_CCITT is not set
496# CONFIG_CRC16 is not set
433CONFIG_CRC32=m 497CONFIG_CRC32=m
434# CONFIG_LIBCRC32C is not set 498# CONFIG_LIBCRC32C is not set
435 499
@@ -448,12 +512,18 @@ CONFIG_LOG_BUF_SHIFT=14
448CONFIG_DETECT_SOFTLOCKUP=y 512CONFIG_DETECT_SOFTLOCKUP=y
449# CONFIG_SCHEDSTATS is not set 513# CONFIG_SCHEDSTATS is not set
450CONFIG_DEBUG_SLAB=y 514CONFIG_DEBUG_SLAB=y
515# CONFIG_DEBUG_SLAB_LEAK is not set
516# CONFIG_DEBUG_MUTEXES is not set
451# CONFIG_DEBUG_SPINLOCK is not set 517# CONFIG_DEBUG_SPINLOCK is not set
452# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 518# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
453# CONFIG_DEBUG_KOBJECT is not set 519# CONFIG_DEBUG_KOBJECT is not set
454CONFIG_DEBUG_INFO=y 520CONFIG_DEBUG_INFO=y
455# CONFIG_DEBUG_FS is not set 521# CONFIG_DEBUG_FS is not set
522# CONFIG_DEBUG_VM is not set
456CONFIG_FRAME_POINTER=y 523CONFIG_FRAME_POINTER=y
524# CONFIG_UNWIND_INFO is not set
525CONFIG_FORCED_INLINING=y
526# CONFIG_RCU_TORTURE_TEST is not set
457# CONFIG_GPROF is not set 527# CONFIG_GPROF is not set
458# CONFIG_GCOV is not set 528# CONFIG_GCOV is not set
459# CONFIG_SYSCALL_DEBUG is not set 529# CONFIG_SYSCALL_DEBUG is not set
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c
index 6ab852bfcd3a..0ec4052db9c5 100644
--- a/arch/um/drivers/cow_user.c
+++ b/arch/um/drivers/cow_user.c
@@ -100,7 +100,7 @@ struct cow_header_v3_broken {
100 __u32 alignment; 100 __u32 alignment;
101 __u32 cow_format; 101 __u32 cow_format;
102 char backing_file[PATH_LEN_V3]; 102 char backing_file[PATH_LEN_V3];
103} __attribute__((packed)); 103};
104 104
105/* COW format definitions - for now, we have only the usual COW bitmap */ 105/* COW format definitions - for now, we have only the usual COW bitmap */
106#define COW_BITMAP 0 106#define COW_BITMAP 0
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index c39ea3abeda4..2ffda012385e 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -89,16 +89,18 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
89 struct irq_fd *irq_fd; 89 struct irq_fd *irq_fd;
90 int n; 90 int n;
91 91
92 if(smp_sigio_handler()) return; 92 if (smp_sigio_handler())
93 while(1){ 93 return;
94
95 while (1) {
94 n = os_waiting_for_events(active_fds); 96 n = os_waiting_for_events(active_fds);
95 if (n <= 0) { 97 if (n <= 0) {
96 if(n == -EINTR) continue; 98 if(n == -EINTR) continue;
97 else break; 99 else break;
98 } 100 }
99 101
100 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ 102 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
101 if(irq_fd->current_events != 0){ 103 if (irq_fd->current_events != 0) {
102 irq_fd->current_events = 0; 104 irq_fd->current_events = 0;
103 do_IRQ(irq_fd->irq, regs); 105 do_IRQ(irq_fd->irq, regs);
104 } 106 }
@@ -110,19 +112,17 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
110 112
111static void maybe_sigio_broken(int fd, int type) 113static void maybe_sigio_broken(int fd, int type)
112{ 114{
113 if(os_isatty(fd)){ 115 if (os_isatty(fd)) {
114 if((type == IRQ_WRITE) && !pty_output_sigio){ 116 if ((type == IRQ_WRITE) && !pty_output_sigio) {
115 write_sigio_workaround(); 117 write_sigio_workaround();
116 add_sigio_fd(fd, 0); 118 add_sigio_fd(fd, 0);
117 } 119 } else if ((type == IRQ_READ) && !pty_close_sigio) {
118 else if((type == IRQ_READ) && !pty_close_sigio){
119 write_sigio_workaround(); 120 write_sigio_workaround();
120 add_sigio_fd(fd, 1); 121 add_sigio_fd(fd, 1);
121 } 122 }
122 } 123 }
123} 124}
124 125
125
126int activate_fd(int irq, int fd, int type, void *dev_id) 126int activate_fd(int irq, int fd, int type, void *dev_id)
127{ 127{
128 struct pollfd *tmp_pfd; 128 struct pollfd *tmp_pfd;
@@ -132,16 +132,18 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
132 132
133 pid = os_getpid(); 133 pid = os_getpid();
134 err = os_set_fd_async(fd, pid); 134 err = os_set_fd_async(fd, pid);
135 if(err < 0) 135 if (err < 0)
136 goto out; 136 goto out;
137 137
138 new_fd = um_kmalloc(sizeof(*new_fd)); 138 new_fd = um_kmalloc(sizeof(*new_fd));
139 err = -ENOMEM; 139 err = -ENOMEM;
140 if(new_fd == NULL) 140 if (new_fd == NULL)
141 goto out; 141 goto out;
142 142
143 if(type == IRQ_READ) events = UM_POLLIN | UM_POLLPRI; 143 if (type == IRQ_READ)
144 else events = UM_POLLOUT; 144 events = UM_POLLIN | UM_POLLPRI;
145 else
146 events = UM_POLLOUT;
145 *new_fd = ((struct irq_fd) { .next = NULL, 147 *new_fd = ((struct irq_fd) { .next = NULL,
146 .id = dev_id, 148 .id = dev_id,
147 .fd = fd, 149 .fd = fd,
@@ -165,8 +167,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
165 * a semaphore. 167 * a semaphore.
166 */ 168 */
167 flags = irq_lock(); 169 flags = irq_lock();
168 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ 170 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
169 if((irq_fd->fd == fd) && (irq_fd->type == type)){ 171 if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
170 printk("Registering fd %d twice\n", fd); 172 printk("Registering fd %d twice\n", fd);
171 printk("Irqs : %d, %d\n", irq_fd->irq, irq); 173 printk("Irqs : %d, %d\n", irq_fd->irq, irq);
172 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); 174 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id);
@@ -175,13 +177,13 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
175 } 177 }
176 178
177 /*-------------*/ 179 /*-------------*/
178 if(type == IRQ_WRITE) 180 if (type == IRQ_WRITE)
179 fd = -1; 181 fd = -1;
180 182
181 tmp_pfd = NULL; 183 tmp_pfd = NULL;
182 n = 0; 184 n = 0;
183 185
184 while(1){ 186 while (1) {
185 n = os_create_pollfd(fd, events, tmp_pfd, n); 187 n = os_create_pollfd(fd, events, tmp_pfd, n);
186 if (n == 0) 188 if (n == 0)
187 break; 189 break;
@@ -198,10 +200,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
198 * then we free the buffer tmp_fds and try again. 200 * then we free the buffer tmp_fds and try again.
199 */ 201 */
200 irq_unlock(flags); 202 irq_unlock(flags);
201 if (tmp_pfd != NULL) { 203 kfree(tmp_pfd);
202 kfree(tmp_pfd); 204 tmp_pfd = NULL;
203 tmp_pfd = NULL;
204 }
205 205
206 tmp_pfd = um_kmalloc(n); 206 tmp_pfd = um_kmalloc(n);
207 if (tmp_pfd == NULL) 207 if (tmp_pfd == NULL)
@@ -249,7 +249,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d)
249{ 249{
250 struct irq_and_dev *data = d; 250 struct irq_and_dev *data = d;
251 251
252 return((irq->irq == data->irq) && (irq->id == data->dev)); 252 return ((irq->irq == data->irq) && (irq->id == data->dev));
253} 253}
254 254
255void free_irq_by_irq_and_dev(unsigned int irq, void *dev) 255void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
@@ -262,7 +262,7 @@ void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
262 262
263static int same_fd(struct irq_fd *irq, void *fd) 263static int same_fd(struct irq_fd *irq, void *fd)
264{ 264{
265 return(irq->fd == *((int *) fd)); 265 return (irq->fd == *((int *)fd));
266} 266}
267 267
268void free_irq_by_fd(int fd) 268void free_irq_by_fd(int fd)
@@ -276,16 +276,17 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
276 int i = 0; 276 int i = 0;
277 int fdi; 277 int fdi;
278 278
279 for(irq=active_fds; irq != NULL; irq = irq->next){ 279 for (irq = active_fds; irq != NULL; irq = irq->next) {
280 if((irq->fd == fd) && (irq->irq == irqnum)) break; 280 if ((irq->fd == fd) && (irq->irq == irqnum))
281 break;
281 i++; 282 i++;
282 } 283 }
283 if(irq == NULL){ 284 if (irq == NULL) {
284 printk("find_irq_by_fd doesn't have descriptor %d\n", fd); 285 printk("find_irq_by_fd doesn't have descriptor %d\n", fd);
285 goto out; 286 goto out;
286 } 287 }
287 fdi = os_get_pollfd(i); 288 fdi = os_get_pollfd(i);
288 if((fdi != -1) && (fdi != fd)){ 289 if ((fdi != -1) && (fdi != fd)) {
289 printk("find_irq_by_fd - mismatch between active_fds and " 290 printk("find_irq_by_fd - mismatch between active_fds and "
290 "pollfds, fd %d vs %d, need %d\n", irq->fd, 291 "pollfds, fd %d vs %d, need %d\n", irq->fd,
291 fdi, fd); 292 fdi, fd);
@@ -294,7 +295,7 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
294 } 295 }
295 *index_out = i; 296 *index_out = i;
296 out: 297 out:
297 return(irq); 298 return irq;
298} 299}
299 300
300void reactivate_fd(int fd, int irqnum) 301void reactivate_fd(int fd, int irqnum)
@@ -305,7 +306,7 @@ void reactivate_fd(int fd, int irqnum)
305 306
306 flags = irq_lock(); 307 flags = irq_lock();
307 irq = find_irq_by_fd(fd, irqnum, &i); 308 irq = find_irq_by_fd(fd, irqnum, &i);
308 if(irq == NULL){ 309 if (irq == NULL) {
309 irq_unlock(flags); 310 irq_unlock(flags);
310 return; 311 return;
311 } 312 }
@@ -326,7 +327,7 @@ void deactivate_fd(int fd, int irqnum)
326 327
327 flags = irq_lock(); 328 flags = irq_lock();
328 irq = find_irq_by_fd(fd, irqnum, &i); 329 irq = find_irq_by_fd(fd, irqnum, &i);
329 if(irq == NULL) 330 if (irq == NULL)
330 goto out; 331 goto out;
331 os_set_pollfd(i, -1); 332 os_set_pollfd(i, -1);
332 out: 333 out:
@@ -338,15 +339,15 @@ int deactivate_all_fds(void)
338 struct irq_fd *irq; 339 struct irq_fd *irq;
339 int err; 340 int err;
340 341
341 for(irq=active_fds;irq != NULL;irq = irq->next){ 342 for (irq = active_fds; irq != NULL; irq = irq->next) {
342 err = os_clear_fd_async(irq->fd); 343 err = os_clear_fd_async(irq->fd);
343 if(err) 344 if (err)
344 return(err); 345 return err;
345 } 346 }
346 /* If there is a signal already queued, after unblocking ignore it */ 347 /* If there is a signal already queued, after unblocking ignore it */
347 os_set_ioignore(); 348 os_set_ioignore();
348 349
349 return(0); 350 return 0;
350} 351}
351 352
352void forward_interrupts(int pid) 353void forward_interrupts(int pid)
@@ -356,9 +357,9 @@ void forward_interrupts(int pid)
356 int err; 357 int err;
357 358
358 flags = irq_lock(); 359 flags = irq_lock();
359 for(irq=active_fds;irq != NULL;irq = irq->next){ 360 for (irq = active_fds; irq != NULL; irq = irq->next) {
360 err = os_set_owner(irq->fd, pid); 361 err = os_set_owner(irq->fd, pid);
361 if(err < 0){ 362 if (err < 0) {
362 /* XXX Just remove the irq rather than 363 /* XXX Just remove the irq rather than
363 * print out an infinite stream of these 364 * print out an infinite stream of these
364 */ 365 */
@@ -379,7 +380,7 @@ void forward_interrupts(int pid)
379unsigned int do_IRQ(int irq, union uml_pt_regs *regs) 380unsigned int do_IRQ(int irq, union uml_pt_regs *regs)
380{ 381{
381 irq_enter(); 382 irq_enter();
382 __do_IRQ(irq, (struct pt_regs *) regs); 383 __do_IRQ(irq, (struct pt_regs *)regs);
383 irq_exit(); 384 irq_exit();
384 return 1; 385 return 1;
385} 386}
@@ -392,12 +393,12 @@ int um_request_irq(unsigned int irq, int fd, int type,
392 int err; 393 int err;
393 394
394 err = request_irq(irq, handler, irqflags, devname, dev_id); 395 err = request_irq(irq, handler, irqflags, devname, dev_id);
395 if(err) 396 if (err)
396 return(err); 397 return err;
397 398
398 if(fd != -1) 399 if (fd != -1)
399 err = activate_fd(irq, fd, type, dev_id); 400 err = activate_fd(irq, fd, type, dev_id);
400 return(err); 401 return err;
401} 402}
402EXPORT_SYMBOL(um_request_irq); 403EXPORT_SYMBOL(um_request_irq);
403EXPORT_SYMBOL(reactivate_fd); 404EXPORT_SYMBOL(reactivate_fd);
@@ -409,7 +410,7 @@ unsigned long irq_lock(void)
409 unsigned long flags; 410 unsigned long flags;
410 411
411 spin_lock_irqsave(&irq_spinlock, flags); 412 spin_lock_irqsave(&irq_spinlock, flags);
412 return(flags); 413 return flags;
413} 414}
414 415
415void irq_unlock(unsigned long flags) 416void irq_unlock(unsigned long flags)
@@ -452,7 +453,7 @@ void __init init_IRQ(void)
452 irq_desc[TIMER_IRQ].depth = 1; 453 irq_desc[TIMER_IRQ].depth = 1;
453 irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type; 454 irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type;
454 enable_irq(TIMER_IRQ); 455 enable_irq(TIMER_IRQ);
455 for(i=1;i<NR_IRQS;i++){ 456 for (i = 1; i < NR_IRQS; i++) {
456 irq_desc[i].status = IRQ_DISABLED; 457 irq_desc[i].status = IRQ_DISABLED;
457 irq_desc[i].action = NULL; 458 irq_desc[i].action = NULL;
458 irq_desc[i].depth = 1; 459 irq_desc[i].depth = 1;
@@ -467,7 +468,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
467 int fds[2], err; 468 int fds[2], err;
468 469
469 err = os_pipe(fds, 1, 1); 470 err = os_pipe(fds, 1, 1);
470 if(err){ 471 if (err) {
471 printk("init_aio_irq - os_pipe failed, err = %d\n", -err); 472 printk("init_aio_irq - os_pipe failed, err = %d\n", -err);
472 goto out; 473 goto out;
473 } 474 }
@@ -475,7 +476,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
475 err = um_request_irq(irq, fds[0], IRQ_READ, handler, 476 err = um_request_irq(irq, fds[0], IRQ_READ, handler,
476 SA_INTERRUPT | SA_SAMPLE_RANDOM, name, 477 SA_INTERRUPT | SA_SAMPLE_RANDOM, name,
477 (void *) (long) fds[0]); 478 (void *) (long) fds[0]);
478 if(err){ 479 if (err) {
479 printk("init_aio_irq - : um_request_irq failed, err = %d\n", 480 printk("init_aio_irq - : um_request_irq failed, err = %d\n",
480 err); 481 err);
481 goto out_close; 482 goto out_close;
@@ -488,5 +489,5 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
488 os_close_file(fds[0]); 489 os_close_file(fds[0]);
489 os_close_file(fds[1]); 490 os_close_file(fds[1]);
490 out: 491 out:
491 return(err); 492 return err;
492} 493}
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 0500800df1c1..fc0f0b085ca7 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -407,6 +407,8 @@ unsigned long find_iomem(char *driver, unsigned long *len_out)
407 *len_out = region->size; 407 *len_out = region->size;
408 return(region->virt); 408 return(region->virt);
409 } 409 }
410
411 region = region->next;
410 } 412 }
411 413
412 return(0); 414 return(0);
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index 57181a920d48..ea3a8e409a6e 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -6,9 +6,11 @@
6obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \ 6obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \
7 syscall.o tlb.o uaccess.o 7 syscall.o tlb.o uaccess.o
8 8
9USER_OBJS := clone.o 9# clone.o is in the stub, so it can't be built with profiling
10# GCC hardened also auto-enables -fpic, but we need %ebx so it can't work ->
11# disable it
10 12
11include arch/um/scripts/Makefile.rules 13CFLAGS_clone.o := $(CFLAGS_NO_HARDENING)
14UNPROFILE_OBJS := clone.o
12 15
13# clone.o is in the stub, so it can't be built with profiling 16include arch/um/scripts/Makefile.rules
14$(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS))
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 3bd10deea280..09251338d99e 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -171,7 +171,7 @@ int os_sigio_async(int master, int slave)
171 171
172 flags = fcntl(master, F_GETFL); 172 flags = fcntl(master, F_GETFL);
173 if(flags < 0) 173 if(flags < 0)
174 return errno; 174 return -errno;
175 175
176 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || 176 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) ||
177 (fcntl(master, F_SETOWN, os_getpid()) < 0)) 177 (fcntl(master, F_SETOWN, os_getpid()) < 0))
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index e599be423da1..3788d4568d33 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -29,21 +29,21 @@ int os_waiting_for_events(struct irq_fd *active_fds)
29 int i, n, err; 29 int i, n, err;
30 30
31 n = poll(pollfds, pollfds_num, 0); 31 n = poll(pollfds, pollfds_num, 0);
32 if(n < 0){ 32 if (n < 0) {
33 err = -errno; 33 err = -errno;
34 if(errno != EINTR) 34 if (errno != EINTR)
35 printk("sigio_handler: os_waiting_for_events:" 35 printk("sigio_handler: os_waiting_for_events:"
36 " poll returned %d, errno = %d\n", n, errno); 36 " poll returned %d, errno = %d\n", n, errno);
37 return err; 37 return err;
38 } 38 }
39 39
40 if(n == 0) 40 if (n == 0)
41 return 0; 41 return 0;
42 42
43 irq_fd = active_fds; 43 irq_fd = active_fds;
44 44
45 for(i = 0; i < pollfds_num; i++){ 45 for (i = 0; i < pollfds_num; i++) {
46 if(pollfds[i].revents != 0){ 46 if (pollfds[i].revents != 0) {
47 irq_fd->current_events = pollfds[i].revents; 47 irq_fd->current_events = pollfds[i].revents;
48 pollfds[i].fd = -1; 48 pollfds[i].fd = -1;
49 } 49 }
@@ -54,7 +54,7 @@ int os_waiting_for_events(struct irq_fd *active_fds)
54 54
55int os_isatty(int fd) 55int os_isatty(int fd)
56{ 56{
57 return(isatty(fd)); 57 return isatty(fd);
58} 58}
59 59
60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) 60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
@@ -65,7 +65,7 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
65 return((pollfds_size + 1) * sizeof(pollfds[0])); 65 return((pollfds_size + 1) * sizeof(pollfds[0]));
66 } 66 }
67 67
68 if(pollfds != NULL){ 68 if (pollfds != NULL) {
69 memcpy(tmp_pfd, pollfds, 69 memcpy(tmp_pfd, pollfds,
70 sizeof(pollfds[0]) * pollfds_size); 70 sizeof(pollfds[0]) * pollfds_size);
71 /* remove old pollfds */ 71 /* remove old pollfds */
@@ -73,18 +73,15 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
73 } 73 }
74 pollfds = tmp_pfd; 74 pollfds = tmp_pfd;
75 pollfds_size++; 75 pollfds_size++;
76 } else { 76 } else
77 /* remove not used tmp_pfd */ 77 kfree(tmp_pfd); /* remove not used tmp_pfd */
78 if (tmp_pfd != NULL)
79 kfree(tmp_pfd);
80 }
81 78
82 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, 79 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
83 .events = events, 80 .events = events,
84 .revents = 0 }); 81 .revents = 0 });
85 pollfds_num++; 82 pollfds_num++;
86 83
87 return(0); 84 return 0;
88} 85}
89 86
90void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, 87void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
@@ -94,11 +91,11 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
94 int i = 0; 91 int i = 0;
95 92
96 prev = &active_fds; 93 prev = &active_fds;
97 while(*prev != NULL){ 94 while (*prev != NULL) {
98 if((*test)(*prev, arg)){ 95 if ((*test)(*prev, arg)) {
99 struct irq_fd *old_fd = *prev; 96 struct irq_fd *old_fd = *prev;
100 if((pollfds[i].fd != -1) && 97 if ((pollfds[i].fd != -1) &&
101 (pollfds[i].fd != (*prev)->fd)){ 98 (pollfds[i].fd != (*prev)->fd)) {
102 printk("os_free_irq_by_cb - mismatch between " 99 printk("os_free_irq_by_cb - mismatch between "
103 "active_fds and pollfds, fd %d vs %d\n", 100 "active_fds and pollfds, fd %d vs %d\n",
104 (*prev)->fd, pollfds[i].fd); 101 (*prev)->fd, pollfds[i].fd);
@@ -110,7 +107,6 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
110 /* This moves the *whole* array after pollfds[i] 107 /* This moves the *whole* array after pollfds[i]
111 * (though it doesn't spot as such)! 108 * (though it doesn't spot as such)!
112 */ 109 */
113
114 memmove(&pollfds[i], &pollfds[i + 1], 110 memmove(&pollfds[i], &pollfds[i + 1],
115 (pollfds_num - i) * sizeof(pollfds[0])); 111 (pollfds_num - i) * sizeof(pollfds[0]));
116 if(*last_irq_ptr2 == &old_fd->next) 112 if(*last_irq_ptr2 == &old_fd->next)
@@ -129,10 +125,9 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
129 return; 125 return;
130} 126}
131 127
132
133int os_get_pollfd(int i) 128int os_get_pollfd(int i)
134{ 129{
135 return(pollfds[i].fd); 130 return pollfds[i].fd;
136} 131}
137 132
138void os_set_pollfd(int i, int fd) 133void os_set_pollfd(int i, int fd)
@@ -151,8 +146,10 @@ void init_irq_signals(int on_sigstack)
151 int flags; 146 int flags;
152 147
153 flags = on_sigstack ? SA_ONSTACK : 0; 148 flags = on_sigstack ? SA_ONSTACK : 0;
154 if(timer_irq_inited) h = (__sighandler_t) alarm_handler; 149 if (timer_irq_inited)
155 else h = boot_timer_handler; 150 h = (__sighandler_t)alarm_handler;
151 else
152 h = boot_timer_handler;
156 153
157 set_handler(SIGVTALRM, h, flags | SA_RESTART, 154 set_handler(SIGVTALRM, h, flags | SA_RESTART,
158 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); 155 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 2878e89a674f..3a0ac38e978b 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -74,6 +74,34 @@ static void last_ditch_exit(int sig)
74 exit(1); 74 exit(1);
75} 75}
76 76
77#define UML_LIB_PATH ":/usr/lib/uml"
78
79static void setup_env_path(void)
80{
81 char *new_path = NULL;
82 char *old_path = NULL;
83 int path_len = 0;
84
85 old_path = getenv("PATH");
86 /* if no PATH variable is set or it has an empty value
87 * just use the default + /usr/lib/uml
88 */
89 if (!old_path || (path_len = strlen(old_path)) == 0) {
90 putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH);
91 return;
92 }
93
94 /* append /usr/lib/uml to the existing path */
95 path_len += strlen("PATH=" UML_LIB_PATH) + 1;
96 new_path = malloc(path_len);
97 if (!new_path) {
98 perror("coudn't malloc to set a new PATH");
99 return;
100 }
101 snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path);
102 putenv(new_path);
103}
104
77extern int uml_exitcode; 105extern int uml_exitcode;
78 106
79extern void scan_elf_aux( char **envp); 107extern void scan_elf_aux( char **envp);
@@ -114,6 +142,8 @@ int main(int argc, char **argv, char **envp)
114 142
115 set_stklim(); 143 set_stklim();
116 144
145 setup_env_path();
146
117 new_argv = malloc((argc + 1) * sizeof(char *)); 147 new_argv = malloc((argc + 1) * sizeof(char *));
118 if(new_argv == NULL){ 148 if(new_argv == NULL){
119 perror("Mallocing argv"); 149 perror("Mallocing argv");
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 3505f44f8a25..233be2f4f8cb 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -206,29 +206,36 @@ int os_drop_memory(void *addr, int length)
206int can_drop_memory(void) 206int can_drop_memory(void)
207{ 207{
208 void *addr; 208 void *addr;
209 int fd; 209 int fd, ok = 0;
210 210
211 printk("Checking host MADV_REMOVE support..."); 211 printk("Checking host MADV_REMOVE support...");
212 fd = create_mem_file(UM_KERN_PAGE_SIZE); 212 fd = create_mem_file(UM_KERN_PAGE_SIZE);
213 if(fd < 0){ 213 if(fd < 0){
214 printk("Creating test memory file failed, err = %d\n", -fd); 214 printk("Creating test memory file failed, err = %d\n", -fd);
215 return 0; 215 goto out;
216 } 216 }
217 217
218 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, 218 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE,
219 MAP_SHARED, fd, 0); 219 MAP_SHARED, fd, 0);
220 if(addr == MAP_FAILED){ 220 if(addr == MAP_FAILED){
221 printk("Mapping test memory file failed, err = %d\n", -errno); 221 printk("Mapping test memory file failed, err = %d\n", -errno);
222 return 0; 222 goto out_close;
223 } 223 }
224 224
225 if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){ 225 if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){
226 printk("MADV_REMOVE failed, err = %d\n", -errno); 226 printk("MADV_REMOVE failed, err = %d\n", -errno);
227 return 0; 227 goto out_unmap;
228 } 228 }
229 229
230 printk("OK\n"); 230 printk("OK\n");
231 return 1; 231 ok = 1;
232
233out_unmap:
234 munmap(addr, UM_KERN_PAGE_SIZE);
235out_close:
236 close(fd);
237out:
238 return ok;
232} 239}
233 240
234void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) 241void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 0776bc18ca85..bd89c6b99d5d 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -344,12 +344,12 @@ int copy_context_skas0(unsigned long new_stack, int pid)
344 err = ptrace_setregs(pid, regs); 344 err = ptrace_setregs(pid, regs);
345 if(err < 0) 345 if(err < 0)
346 panic("copy_context_skas0 : PTRACE_SETREGS failed, " 346 panic("copy_context_skas0 : PTRACE_SETREGS failed, "
347 "pid = %d, errno = %d\n", pid, errno); 347 "pid = %d, errno = %d\n", pid, -err);
348 348
349 err = ptrace_setfpregs(pid, fp_regs); 349 err = ptrace_setfpregs(pid, fp_regs);
350 if(err < 0) 350 if(err < 0)
351 panic("copy_context_skas0 : PTRACE_SETFPREGS failed, " 351 panic("copy_context_skas0 : PTRACE_SETFPREGS failed, "
352 "pid = %d, errno = %d\n", pid, errno); 352 "pid = %d, errno = %d\n", pid, -err);
353 353
354 /* set a well known return code for detection of child write failure */ 354 /* set a well known return code for detection of child write failure */
355 child_data->err = 12345678; 355 child_data->err = 12345678;
@@ -362,7 +362,7 @@ int copy_context_skas0(unsigned long new_stack, int pid)
362 pid = data->err; 362 pid = data->err;
363 if(pid < 0) 363 if(pid < 0)
364 panic("copy_context_skas0 - stub-parent reports error %d\n", 364 panic("copy_context_skas0 - stub-parent reports error %d\n",
365 pid); 365 -pid);
366 366
367 /* Wait, until child has finished too: read child's result from 367 /* Wait, until child has finished too: read child's result from
368 * child's stack and check it. 368 * child's stack and check it.
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c
index 7a6f6b99ceff..516f66dd87e3 100644
--- a/arch/um/os-Linux/sys-i386/registers.c
+++ b/arch/um/os-Linux/sys-i386/registers.c
@@ -104,7 +104,7 @@ void init_registers(int pid)
104 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); 104 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs);
105 if(err) 105 if(err)
106 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", 106 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
107 err); 107 errno);
108 108
109 errno = 0; 109 errno = 0;
110 err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); 110 err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs);
@@ -119,7 +119,7 @@ void init_registers(int pid)
119 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); 119 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs);
120 if(err) 120 if(err)
121 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", 121 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d",
122 err); 122 errno);
123} 123}
124 124
125void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 125void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index 001941fa1a1e..becd898d9398 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -62,12 +62,12 @@ void init_registers(int pid)
62 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); 62 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs);
63 if(err) 63 if(err)
64 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", 64 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
65 err); 65 errno);
66 66
67 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); 67 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs);
68 if(err) 68 if(err)
69 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", 69 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d",
70 err); 70 errno);
71} 71}
72 72
73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index 34bfc1bb9e38..362db059fe30 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -178,14 +178,14 @@ static void __init create_pid_file(void)
178 fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); 178 fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644);
179 if(fd < 0){ 179 if(fd < 0){
180 printk("Open of machine pid file \"%s\" failed: %s\n", 180 printk("Open of machine pid file \"%s\" failed: %s\n",
181 file, strerror(-fd)); 181 file, strerror(errno));
182 return; 182 return;
183 } 183 }
184 184
185 snprintf(pid, sizeof(pid), "%d\n", getpid()); 185 snprintf(pid, sizeof(pid), "%d\n", getpid());
186 n = write(fd, pid, strlen(pid)); 186 n = write(fd, pid, strlen(pid));
187 if(n != strlen(pid)) 187 if(n != strlen(pid))
188 printk("Write of pid file failed - err = %d\n", -n); 188 printk("Write of pid file failed - err = %d\n", errno);
189 189
190 close(fd); 190 close(fd);
191} 191}
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 2598158e1f53..3f33165ada68 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -96,6 +96,13 @@ EXPORT_SYMBOL_PROTO(getuid);
96EXPORT_SYMBOL_PROTO(fsync); 96EXPORT_SYMBOL_PROTO(fsync);
97EXPORT_SYMBOL_PROTO(fdatasync); 97EXPORT_SYMBOL_PROTO(fdatasync);
98 98
99/* Export symbols used by GCC for the stack protector. */
100extern void __stack_smash_handler(void *) __attribute__((weak));
101EXPORT_SYMBOL(__stack_smash_handler);
102
103extern long __guard __attribute__((weak));
104EXPORT_SYMBOL(__guard);
105
99/* 106/*
100 * Overrides for Emacs so that we follow Linus's tabbing style. 107 * Overrides for Emacs so that we follow Linus's tabbing style.
101 * Emacs will notice this stuff at the end of the file and automatically 108 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 5e7a9c310aa5..1347dc6d5218 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -7,11 +7,19 @@ USER_SINGLE_OBJS := \
7USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) 7USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS))
8USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) 8USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
9 9
10$(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \ 10$(USER_OBJS:.o=.%): \
11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) 11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o)
12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ 12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
13 -Dunix -D__unix__ -D__$(SUBARCH)__ 13 -Dunix -D__unix__ -D__$(SUBARCH)__
14 14
15# These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of
16# using it directly.
17UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
18
19$(UNPROFILE_OBJS:.o=.%): \
20 c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o)
21$(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
22 -Dunix -D__unix__ -D__$(SUBARCH)__
15 23
16# The stubs and unmap.o can't try to call mcount or update basic block data 24# The stubs and unmap.o can't try to call mcount or update basic block data
17define unprofile 25define unprofile
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 98b20b7bba4f..374d61a19439 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -8,11 +8,16 @@ subarch-obj-y = lib/bitops.o kernel/semaphore.o
8subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o 8subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o
9subarch-obj-$(CONFIG_MODULES) += kernel/module.o 9subarch-obj-$(CONFIG_MODULES) += kernel/module.o
10 10
11USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o 11USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
12 12
13include arch/um/scripts/Makefile.rules 13USER_OBJS += user-offsets.s
14extra-y += user-offsets.s
14 15
15extra-$(CONFIG_MODE_TT) += unmap.o 16extra-$(CONFIG_MODE_TT) += unmap.o
16 17
17$(obj)/stub_segv.o $(obj)/unmap.o: \ 18UNPROFILE_OBJS := stub_segv.o
18 _c_flags = $(call unprofile,$(CFLAGS)) 19CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
20
21include arch/um/scripts/Makefile.rules
22
23$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index b5fc22babddf..c19794d435d6 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -16,11 +16,16 @@ subarch-obj-$(CONFIG_MODULES) += kernel/module.o
16 16
17ldt-y = ../sys-i386/ldt.o 17ldt-y = ../sys-i386/ldt.o
18 18
19USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o 19USER_OBJS := ptrace_user.o sigcontext.o
20 20
21include arch/um/scripts/Makefile.rules 21USER_OBJS += user-offsets.s
22extra-y += user-offsets.s
22 23
23extra-$(CONFIG_MODE_TT) += unmap.o 24extra-$(CONFIG_MODE_TT) += unmap.o
24 25
25$(obj)/stub_segv.o $(obj)/unmap.o: \ 26UNPROFILE_OBJS := stub_segv.o
26 _c_flags = $(call unprofile,$(CFLAGS)) 27CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
28
29include arch/um/scripts/Makefile.rules
30
31$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 57fc37e0fb9c..5a92fed2d1d5 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -695,4 +695,5 @@ ia32_sys_call_table:
695 .quad sys_splice 695 .quad sys_splice
696 .quad sys_sync_file_range 696 .quad sys_sync_file_range
697 .quad sys_tee 697 .quad sys_tee
698 .quad compat_sys_vmsplice
698ia32_syscall_end: 699ia32_syscall_end:
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 759070c82751..ebc3c33b1c6c 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -1426,3 +1426,22 @@ struct seq_operations cpuinfo_op = {
1426 .show = show_cpuinfo, 1426 .show = show_cpuinfo,
1427}; 1427};
1428 1428
1429#ifdef CONFIG_INPUT_PCSPKR
1430#include <linux/platform_device.h>
1431static __init int add_pcspkr(void)
1432{
1433 struct platform_device *pd;
1434 int ret;
1435
1436 pd = platform_device_alloc("pcspkr", -1);
1437 if (!pd)
1438 return -ENOMEM;
1439
1440 ret = platform_device_add(pd);
1441 if (ret)
1442 platform_device_put(pd);
1443
1444 return ret;
1445}
1446device_initcall(add_pcspkr);
1447#endif