aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/acpi/boot.c2
-rw-r--r--arch/x86/kernel/cpu/amd_64.c10
-rw-r--r--arch/x86/kernel/cpu/centaur_64.c2
-rw-r--r--arch/x86/kernel/cpu/common_64.c3
-rw-r--r--arch/x86/kernel/cpu/intel_64.c2
-rw-r--r--arch/x86/kernel/e820.c34
-rw-r--r--arch/x86/kernel/efi.c2
-rw-r--r--arch/x86/kernel/entry_32.S1
-rw-r--r--arch/x86/kernel/io_apic_32.c40
-rw-r--r--arch/x86/kernel/io_apic_64.c54
-rw-r--r--arch/x86/kernel/nmi.c3
-rw-r--r--arch/x86/kernel/setup.c22
-rw-r--r--arch/x86/kernel/tsc.c1
-rw-r--r--arch/x86/lib/copy_user_64.S4
-rw-r--r--arch/x86/lib/copy_user_nocache_64.S2
-rw-r--r--arch/x86/mm/init_32.c1
-rw-r--r--arch/x86/mm/init_64.c1
-rw-r--r--arch/x86/mm/pageattr.c19
-rw-r--r--arch/x86/mm/pat.c3
-rw-r--r--arch/x86/mm/srat_64.c14
-rw-r--r--arch/x86/pci/i386.c4
-rw-r--r--arch/x86/vdso/vdso32-setup.c11
-rw-r--r--include/asm-x86/cpufeature.h4
-rw-r--r--include/asm-x86/dwarf2.h62
-rw-r--r--include/asm-x86/dwarf2_32.h61
-rw-r--r--include/asm-x86/dwarf2_64.h56
-rw-r--r--include/asm-x86/e820.h3
-rw-r--r--include/asm-x86/page.h1
-rw-r--r--include/asm-x86/system.h2
30 files changed, 228 insertions, 198 deletions
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index f77dd6774bba..55ff016e9f69 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -13,7 +13,7 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
13nostackp := $(call cc-option, -fno-stack-protector) 13nostackp := $(call cc-option, -fno-stack-protector)
14CFLAGS_vsyscall_64.o := $(PROFILING) -g0 $(nostackp) 14CFLAGS_vsyscall_64.o := $(PROFILING) -g0 $(nostackp)
15CFLAGS_hpet.o := $(nostackp) 15CFLAGS_hpet.o := $(nostackp)
16CFLAGS_tsc_64.o := $(nostackp) 16CFLAGS_tsc.o := $(nostackp)
17 17
18obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o 18obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o
19obj-y += traps_$(BITS).o irq_$(BITS).o 19obj-y += traps_$(BITS).o irq_$(BITS).o
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index a31a579a47ca..9c981c4a3644 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -130,7 +130,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
130 if (!phys || !size) 130 if (!phys || !size)
131 return NULL; 131 return NULL;
132 132
133 if (phys+size <= (max_pfn_mapped << PAGE_SHIFT)) 133 if (phys+size <= (max_low_pfn_mapped << PAGE_SHIFT))
134 return __va(phys); 134 return __va(phys);
135 135
136 offset = phys & (PAGE_SIZE - 1); 136 offset = phys & (PAGE_SIZE - 1);
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c
index 958526d6a74a..bd182b7616ee 100644
--- a/arch/x86/kernel/cpu/amd_64.c
+++ b/arch/x86/kernel/cpu/amd_64.c
@@ -199,10 +199,14 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
199 * Don't do it for gbpages because there seems very little 199 * Don't do it for gbpages because there seems very little
200 * benefit in doing so. 200 * benefit in doing so.
201 */ 201 */
202 if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg) && 202 if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg)) {
203 (tseg >> PMD_SHIFT) < 203 if ((tseg>>PMD_SHIFT) <
204 (max_pfn_mapped >> (PMD_SHIFT-PAGE_SHIFT))) 204 (max_low_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) ||
205 ((tseg>>PMD_SHIFT) <
206 (max_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) &&
207 (tseg>>PMD_SHIFT) >= (1ULL<<(32 - PMD_SHIFT))))
205 set_memory_4k((unsigned long)__va(tseg), 1); 208 set_memory_4k((unsigned long)__va(tseg), 1);
209 }
206 } 210 }
207} 211}
208 212
diff --git a/arch/x86/kernel/cpu/centaur_64.c b/arch/x86/kernel/cpu/centaur_64.c
index 13526fd5cce1..2026d2119cdb 100644
--- a/arch/x86/kernel/cpu/centaur_64.c
+++ b/arch/x86/kernel/cpu/centaur_64.c
@@ -10,6 +10,8 @@ static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
10{ 10{
11 if (c->x86 == 0x6 && c->x86_model >= 0xf) 11 if (c->x86 == 0x6 && c->x86_model >= 0xf)
12 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 12 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
13
14 set_cpu_cap(c, X86_FEATURE_SYSENTER32);
13} 15}
14 16
15static void __cpuinit init_centaur(struct cpuinfo_x86 *c) 17static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index 751850235291..36537ab9e56a 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -314,6 +314,9 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
314 if (c->extended_cpuid_level >= 0x80000007) 314 if (c->extended_cpuid_level >= 0x80000007)
315 c->x86_power = cpuid_edx(0x80000007); 315 c->x86_power = cpuid_edx(0x80000007);
316 316
317 /* Assume all 64-bit CPUs support 32-bit syscall */
318 set_cpu_cap(c, X86_FEATURE_SYSCALL32);
319
317 if (c->x86_vendor != X86_VENDOR_UNKNOWN && 320 if (c->x86_vendor != X86_VENDOR_UNKNOWN &&
318 cpu_devs[c->x86_vendor]->c_early_init) 321 cpu_devs[c->x86_vendor]->c_early_init)
319 cpu_devs[c->x86_vendor]->c_early_init(c); 322 cpu_devs[c->x86_vendor]->c_early_init(c);
diff --git a/arch/x86/kernel/cpu/intel_64.c b/arch/x86/kernel/cpu/intel_64.c
index fcb1cc9d75ca..02f773399e39 100644
--- a/arch/x86/kernel/cpu/intel_64.c
+++ b/arch/x86/kernel/cpu/intel_64.c
@@ -12,6 +12,8 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
12 if ((c->x86 == 0xf && c->x86_model >= 0x03) || 12 if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
13 (c->x86 == 0x6 && c->x86_model >= 0x0e)) 13 (c->x86 == 0x6 && c->x86_model >= 0x0e))
14 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 14 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
15
16 set_cpu_cap(c, X86_FEATURE_SYSENTER32);
15} 17}
16 18
17/* 19/*
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 269d367d2ace..a5383ae2cbe3 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1056,7 +1056,7 @@ unsigned long __initdata end_user_pfn = MAX_ARCH_PFN;
1056/* 1056/*
1057 * Find the highest page frame number we have available 1057 * Find the highest page frame number we have available
1058 */ 1058 */
1059unsigned long __init e820_end(void) 1059static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
1060{ 1060{
1061 int i; 1061 int i;
1062 unsigned long last_pfn = 0; 1062 unsigned long last_pfn = 0;
@@ -1064,12 +1064,21 @@ unsigned long __init e820_end(void)
1064 1064
1065 for (i = 0; i < e820.nr_map; i++) { 1065 for (i = 0; i < e820.nr_map; i++) {
1066 struct e820entry *ei = &e820.map[i]; 1066 struct e820entry *ei = &e820.map[i];
1067 unsigned long start_pfn;
1067 unsigned long end_pfn; 1068 unsigned long end_pfn;
1068 1069
1069 if (ei->type != E820_RAM) 1070 if (ei->type != type)
1070 continue; 1071 continue;
1071 1072
1073 start_pfn = ei->addr >> PAGE_SHIFT;
1072 end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT; 1074 end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT;
1075
1076 if (start_pfn >= limit_pfn)
1077 continue;
1078 if (end_pfn > limit_pfn) {
1079 last_pfn = limit_pfn;
1080 break;
1081 }
1073 if (end_pfn > last_pfn) 1082 if (end_pfn > last_pfn)
1074 last_pfn = end_pfn; 1083 last_pfn = end_pfn;
1075 } 1084 }
@@ -1083,7 +1092,15 @@ unsigned long __init e820_end(void)
1083 last_pfn, max_arch_pfn); 1092 last_pfn, max_arch_pfn);
1084 return last_pfn; 1093 return last_pfn;
1085} 1094}
1095unsigned long __init e820_end_of_ram_pfn(void)
1096{
1097 return e820_end_pfn(MAX_ARCH_PFN, E820_RAM);
1098}
1086 1099
1100unsigned long __init e820_end_of_low_ram_pfn(void)
1101{
1102 return e820_end_pfn(1UL<<(32 - PAGE_SHIFT), E820_RAM);
1103}
1087/* 1104/*
1088 * Finds an active region in the address range from start_pfn to last_pfn and 1105 * Finds an active region in the address range from start_pfn to last_pfn and
1089 * returns its range in ei_startpfn and ei_endpfn for the e820 entry. 1106 * returns its range in ei_startpfn and ei_endpfn for the e820 entry.
@@ -1165,6 +1182,8 @@ static void early_panic(char *msg)
1165 panic(msg); 1182 panic(msg);
1166} 1183}
1167 1184
1185static int userdef __initdata;
1186
1168/* "mem=nopentium" disables the 4MB page tables. */ 1187/* "mem=nopentium" disables the 4MB page tables. */
1169static int __init parse_memopt(char *p) 1188static int __init parse_memopt(char *p)
1170{ 1189{
@@ -1180,17 +1199,15 @@ static int __init parse_memopt(char *p)
1180 } 1199 }
1181#endif 1200#endif
1182 1201
1202 userdef = 1;
1183 mem_size = memparse(p, &p); 1203 mem_size = memparse(p, &p);
1184 end_user_pfn = mem_size>>PAGE_SHIFT; 1204 end_user_pfn = mem_size>>PAGE_SHIFT;
1185 e820_update_range(mem_size, ULLONG_MAX - mem_size, 1205 e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
1186 E820_RAM, E820_RESERVED);
1187 1206
1188 return 0; 1207 return 0;
1189} 1208}
1190early_param("mem", parse_memopt); 1209early_param("mem", parse_memopt);
1191 1210
1192static int userdef __initdata;
1193
1194static int __init parse_memmap_opt(char *p) 1211static int __init parse_memmap_opt(char *p)
1195{ 1212{
1196 char *oldp; 1213 char *oldp;
@@ -1206,7 +1223,7 @@ static int __init parse_memmap_opt(char *p)
1206 * the real mem size before original memory map is 1223 * the real mem size before original memory map is
1207 * reset. 1224 * reset.
1208 */ 1225 */
1209 saved_max_pfn = e820_end(); 1226 saved_max_pfn = e820_end_of_ram_pfn();
1210#endif 1227#endif
1211 e820.nr_map = 0; 1228 e820.nr_map = 0;
1212 userdef = 1; 1229 userdef = 1;
@@ -1230,8 +1247,7 @@ static int __init parse_memmap_opt(char *p)
1230 e820_add_region(start_at, mem_size, E820_RESERVED); 1247 e820_add_region(start_at, mem_size, E820_RESERVED);
1231 } else { 1248 } else {
1232 end_user_pfn = (mem_size >> PAGE_SHIFT); 1249 end_user_pfn = (mem_size >> PAGE_SHIFT);
1233 e820_update_range(mem_size, ULLONG_MAX - mem_size, 1250 e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
1234 E820_RAM, E820_RESERVED);
1235 } 1251 }
1236 return *p == '\0' ? 0 : -EINVAL; 1252 return *p == '\0' ? 0 : -EINVAL;
1237} 1253}
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 94382faeadb6..06cc8d4254b1 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -473,7 +473,7 @@ void __init efi_enter_virtual_mode(void)
473 size = md->num_pages << EFI_PAGE_SHIFT; 473 size = md->num_pages << EFI_PAGE_SHIFT;
474 end = md->phys_addr + size; 474 end = md->phys_addr + size;
475 475
476 if (PFN_UP(end) <= max_pfn_mapped) 476 if (PFN_UP(end) <= max_low_pfn_mapped)
477 va = __va(md->phys_addr); 477 va = __va(md->phys_addr);
478 else 478 else
479 va = efi_ioremap(md->phys_addr, size); 479 va = efi_ioremap(md->phys_addr, size);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 53393c306e11..cfe28a715434 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1024,6 +1024,7 @@ ENTRY(xen_sysenter_target)
1024 RING0_INT_FRAME 1024 RING0_INT_FRAME
1025 addl $5*4, %esp /* remove xen-provided frame */ 1025 addl $5*4, %esp /* remove xen-provided frame */
1026 jmp sysenter_past_esp 1026 jmp sysenter_past_esp
1027 CFI_ENDPROC
1027 1028
1028ENTRY(xen_hypervisor_callback) 1029ENTRY(xen_hypervisor_callback)
1029 CFI_STARTPROC 1030 CFI_STARTPROC
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 6b220b9dcbb3..c50adb84ea6f 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2027,7 +2027,7 @@ static inline void init_IO_APIC_traps(void)
2027 * The local APIC irq-chip implementation: 2027 * The local APIC irq-chip implementation:
2028 */ 2028 */
2029 2029
2030static void ack_apic(unsigned int irq) 2030static void ack_lapic_irq(unsigned int irq)
2031{ 2031{
2032 ack_APIC_irq(); 2032 ack_APIC_irq();
2033} 2033}
@@ -2052,9 +2052,17 @@ static struct irq_chip lapic_chip __read_mostly = {
2052 .name = "local-APIC", 2052 .name = "local-APIC",
2053 .mask = mask_lapic_irq, 2053 .mask = mask_lapic_irq,
2054 .unmask = unmask_lapic_irq, 2054 .unmask = unmask_lapic_irq,
2055 .eoi = ack_apic, 2055 .ack = ack_lapic_irq,
2056}; 2056};
2057 2057
2058static void lapic_register_intr(int irq, int vector)
2059{
2060 irq_desc[irq].status &= ~IRQ_LEVEL;
2061 set_irq_chip_and_handler_name(irq, &lapic_chip, handle_edge_irq,
2062 "edge");
2063 set_intr_gate(vector, interrupt[irq]);
2064}
2065
2058static void __init setup_nmi(void) 2066static void __init setup_nmi(void)
2059{ 2067{
2060 /* 2068 /*
@@ -2257,8 +2265,7 @@ static inline void __init check_timer(void)
2257 2265
2258 printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); 2266 printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ...");
2259 2267
2260 set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq, 2268 lapic_register_intr(0, vector);
2261 "fasteoi");
2262 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ 2269 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
2263 enable_8259A_irq(0); 2270 enable_8259A_irq(0);
2264 2271
@@ -2290,11 +2297,21 @@ out:
2290} 2297}
2291 2298
2292/* 2299/*
2293 * 2300 * Traditionally ISA IRQ2 is the cascade IRQ, and is not available
2294 * IRQ's that are handled by the PIC in the MPS IOAPIC case. 2301 * to devices. However there may be an I/O APIC pin available for
2295 * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. 2302 * this interrupt regardless. The pin may be left unconnected, but
2296 * Linux doesn't really care, as it's not actually used 2303 * typically it will be reused as an ExtINT cascade interrupt for
2297 * for any interrupt handling anyway. 2304 * the master 8259A. In the MPS case such a pin will normally be
2305 * reported as an ExtINT interrupt in the MP table. With ACPI
2306 * there is no provision for ExtINT interrupts, and in the absence
2307 * of an override it would be treated as an ordinary ISA I/O APIC
2308 * interrupt, that is edge-triggered and unmasked by default. We
2309 * used to do this, but it caused problems on some systems because
2310 * of the NMI watchdog and sometimes IRQ0 of the 8254 timer using
2311 * the same ExtINT cascade interrupt to drive the local APIC of the
2312 * bootstrap processor. Therefore we refrain from routing IRQ2 to
2313 * the I/O APIC in all cases now. No actual device should request
2314 * it anyway. --macro
2298 */ 2315 */
2299#define PIC_IRQS (1 << PIC_CASCADE_IR) 2316#define PIC_IRQS (1 << PIC_CASCADE_IR)
2300 2317
@@ -2308,10 +2325,7 @@ void __init setup_IO_APIC(void)
2308 2325
2309 enable_IO_APIC(); 2326 enable_IO_APIC();
2310 2327
2311 if (acpi_ioapic) 2328 io_apic_irqs = ~PIC_IRQS;
2312 io_apic_irqs = ~0; /* all IRQs go through IOAPIC */
2313 else
2314 io_apic_irqs = ~PIC_IRQS;
2315 2329
2316 printk("ENABLING IO-APIC IRQs\n"); 2330 printk("ENABLING IO-APIC IRQs\n");
2317 2331
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
index 848411753c7c..9e645cba11c4 100644
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -1561,7 +1561,7 @@ static inline void init_IO_APIC_traps(void)
1561 } 1561 }
1562} 1562}
1563 1563
1564static void enable_lapic_irq (unsigned int irq) 1564static void unmask_lapic_irq(unsigned int irq)
1565{ 1565{
1566 unsigned long v; 1566 unsigned long v;
1567 1567
@@ -1569,7 +1569,7 @@ static void enable_lapic_irq (unsigned int irq)
1569 apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED); 1569 apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED);
1570} 1570}
1571 1571
1572static void disable_lapic_irq (unsigned int irq) 1572static void mask_lapic_irq(unsigned int irq)
1573{ 1573{
1574 unsigned long v; 1574 unsigned long v;
1575 1575
@@ -1582,19 +1582,20 @@ static void ack_lapic_irq (unsigned int irq)
1582 ack_APIC_irq(); 1582 ack_APIC_irq();
1583} 1583}
1584 1584
1585static void end_lapic_irq (unsigned int i) { /* nothing */ } 1585static struct irq_chip lapic_chip __read_mostly = {
1586 1586 .name = "local-APIC",
1587static struct hw_interrupt_type lapic_irq_type __read_mostly = { 1587 .mask = mask_lapic_irq,
1588 .name = "local-APIC", 1588 .unmask = unmask_lapic_irq,
1589 .typename = "local-APIC-edge", 1589 .ack = ack_lapic_irq,
1590 .startup = NULL, /* startup_irq() not used for IRQ0 */
1591 .shutdown = NULL, /* shutdown_irq() not used for IRQ0 */
1592 .enable = enable_lapic_irq,
1593 .disable = disable_lapic_irq,
1594 .ack = ack_lapic_irq,
1595 .end = end_lapic_irq,
1596}; 1590};
1597 1591
1592static void lapic_register_intr(int irq)
1593{
1594 irq_desc[irq].status &= ~IRQ_LEVEL;
1595 set_irq_chip_and_handler_name(irq, &lapic_chip, handle_edge_irq,
1596 "edge");
1597}
1598
1598static void __init setup_nmi(void) 1599static void __init setup_nmi(void)
1599{ 1600{
1600 /* 1601 /*
@@ -1784,7 +1785,7 @@ static inline void __init check_timer(void)
1784 1785
1785 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); 1786 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as Virtual Wire IRQ...");
1786 1787
1787 irq_desc[0].chip = &lapic_irq_type; 1788 lapic_register_intr(0);
1788 apic_write(APIC_LVT0, APIC_DM_FIXED | cfg->vector); /* Fixed mode */ 1789 apic_write(APIC_LVT0, APIC_DM_FIXED | cfg->vector); /* Fixed mode */
1789 enable_8259A_irq(0); 1790 enable_8259A_irq(0);
1790 1791
@@ -1822,11 +1823,21 @@ static int __init notimercheck(char *s)
1822__setup("no_timer_check", notimercheck); 1823__setup("no_timer_check", notimercheck);
1823 1824
1824/* 1825/*
1825 * 1826 * Traditionally ISA IRQ2 is the cascade IRQ, and is not available
1826 * IRQs that are handled by the PIC in the MPS IOAPIC case. 1827 * to devices. However there may be an I/O APIC pin available for
1827 * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. 1828 * this interrupt regardless. The pin may be left unconnected, but
1828 * Linux doesn't really care, as it's not actually used 1829 * typically it will be reused as an ExtINT cascade interrupt for
1829 * for any interrupt handling anyway. 1830 * the master 8259A. In the MPS case such a pin will normally be
1831 * reported as an ExtINT interrupt in the MP table. With ACPI
1832 * there is no provision for ExtINT interrupts, and in the absence
1833 * of an override it would be treated as an ordinary ISA I/O APIC
1834 * interrupt, that is edge-triggered and unmasked by default. We
1835 * used to do this, but it caused problems on some systems because
1836 * of the NMI watchdog and sometimes IRQ0 of the 8254 timer using
1837 * the same ExtINT cascade interrupt to drive the local APIC of the
1838 * bootstrap processor. Therefore we refrain from routing IRQ2 to
1839 * the I/O APIC in all cases now. No actual device should request
1840 * it anyway. --macro
1830 */ 1841 */
1831#define PIC_IRQS (1<<2) 1842#define PIC_IRQS (1<<2)
1832 1843
@@ -1837,10 +1848,7 @@ void __init setup_IO_APIC(void)
1837 * calling enable_IO_APIC() is moved to setup_local_APIC for BP 1848 * calling enable_IO_APIC() is moved to setup_local_APIC for BP
1838 */ 1849 */
1839 1850
1840 if (acpi_ioapic) 1851 io_apic_irqs = ~PIC_IRQS;
1841 io_apic_irqs = ~0; /* all IRQs go through IOAPIC */
1842 else
1843 io_apic_irqs = ~PIC_IRQS;
1844 1852
1845 apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n"); 1853 apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n");
1846 1854
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 8dfe9db87a9e..716b89284be0 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -171,6 +171,9 @@ int __init check_nmi_watchdog(void)
171error: 171error:
172 if (nmi_watchdog == NMI_IO_APIC && !timer_through_8259) 172 if (nmi_watchdog == NMI_IO_APIC && !timer_through_8259)
173 disable_8259A_irq(0); 173 disable_8259A_irq(0);
174#ifdef CONFIG_X86_32
175 timer_ack = 0;
176#endif
174 return -1; 177 return -1;
175} 178}
176 179
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index cb3db406247c..987b6fde3a99 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -714,14 +714,14 @@ void __init setup_arch(char **cmdline_p)
714 * partially used pages are not usable - thus 714 * partially used pages are not usable - thus
715 * we are rounding upwards: 715 * we are rounding upwards:
716 */ 716 */
717 max_pfn = e820_end(); 717 max_pfn = e820_end_of_ram_pfn();
718 718
719 /* preallocate 4k for mptable mpc */ 719 /* preallocate 4k for mptable mpc */
720 early_reserve_e820_mpc_new(); 720 early_reserve_e820_mpc_new();
721 /* update e820 for memory not covered by WB MTRRs */ 721 /* update e820 for memory not covered by WB MTRRs */
722 mtrr_bp_init(); 722 mtrr_bp_init();
723 if (mtrr_trim_uncached_memory(max_pfn)) 723 if (mtrr_trim_uncached_memory(max_pfn))
724 max_pfn = e820_end(); 724 max_pfn = e820_end_of_ram_pfn();
725 725
726#ifdef CONFIG_X86_32 726#ifdef CONFIG_X86_32
727 /* max_low_pfn get updated here */ 727 /* max_low_pfn get updated here */
@@ -733,12 +733,26 @@ void __init setup_arch(char **cmdline_p)
733 733
734 /* How many end-of-memory variables you have, grandma! */ 734 /* How many end-of-memory variables you have, grandma! */
735 /* need this before calling reserve_initrd */ 735 /* need this before calling reserve_initrd */
736 max_low_pfn = max_pfn; 736 if (max_pfn > (1UL<<(32 - PAGE_SHIFT)))
737 max_low_pfn = e820_end_of_low_ram_pfn();
738 else
739 max_low_pfn = max_pfn;
740
737 high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1; 741 high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
738#endif 742#endif
739 743
740 /* max_pfn_mapped is updated here */ 744 /* max_pfn_mapped is updated here */
741 max_pfn_mapped = init_memory_mapping(0, (max_low_pfn << PAGE_SHIFT)); 745 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
746 max_pfn_mapped = max_low_pfn_mapped;
747
748#ifdef CONFIG_X86_64
749 if (max_pfn > max_low_pfn) {
750 max_pfn_mapped = init_memory_mapping(1UL<<32,
751 max_pfn<<PAGE_SHIFT);
752 /* can we preseve max_low_pfn ?*/
753 max_low_pfn = max_pfn;
754 }
755#endif
742 756
743 /* 757 /*
744 * NOTE: On x86-32, only from this point on, fixmaps are ready for use. 758 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 4a775d001957..3c36f92160c9 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -513,7 +513,6 @@ void __init tsc_init(void)
513 */ 513 */
514 for_each_possible_cpu(cpu) 514 for_each_possible_cpu(cpu)
515 set_cyc2ns_scale(cpu_khz, cpu); 515 set_cyc2ns_scale(cpu_khz, cpu);
516 use_tsc_delay();
517 516
518 if (tsc_disabled > 0) 517 if (tsc_disabled > 0)
519 return; 518 return;
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index e5afb4ad3f1c..dfdf428975c0 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -185,7 +185,7 @@ ENTRY(copy_user_generic_unrolled)
18530: shll $6,%ecx 18530: shll $6,%ecx
186 addl %ecx,%edx 186 addl %ecx,%edx
187 jmp 60f 187 jmp 60f
18840: leal (%edx,%ecx,8),%edx 18840: lea (%rdx,%rcx,8),%rdx
189 jmp 60f 189 jmp 60f
19050: movl %ecx,%edx 19050: movl %ecx,%edx
19160: jmp copy_user_handle_tail /* ecx is zerorest also */ 19160: jmp copy_user_handle_tail /* ecx is zerorest also */
@@ -254,7 +254,7 @@ ENTRY(copy_user_generic_string)
254 ret 254 ret
255 255
256 .section .fixup,"ax" 256 .section .fixup,"ax"
25711: leal (%edx,%ecx,8),%ecx 25711: lea (%rdx,%rcx,8),%rcx
25812: movl %ecx,%edx /* ecx is zerorest also */ 25812: movl %ecx,%edx /* ecx is zerorest also */
259 jmp copy_user_handle_tail 259 jmp copy_user_handle_tail
260 .previous 260 .previous
diff --git a/arch/x86/lib/copy_user_nocache_64.S b/arch/x86/lib/copy_user_nocache_64.S
index 93353d6a5263..40e0e309d27e 100644
--- a/arch/x86/lib/copy_user_nocache_64.S
+++ b/arch/x86/lib/copy_user_nocache_64.S
@@ -104,7 +104,7 @@ ENTRY(__copy_user_nocache)
10430: shll $6,%ecx 10430: shll $6,%ecx
105 addl %ecx,%edx 105 addl %ecx,%edx
106 jmp 60f 106 jmp 60f
10740: leal (%edx,%ecx,8),%edx 10740: lea (%rdx,%rcx,8),%rdx
108 jmp 60f 108 jmp 60f
10950: movl %ecx,%edx 10950: movl %ecx,%edx
11060: sfence 11060: sfence
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index b5a0fd5f4c5f..029e8cffca9e 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -50,6 +50,7 @@
50 50
51unsigned int __VMALLOC_RESERVE = 128 << 20; 51unsigned int __VMALLOC_RESERVE = 128 << 20;
52 52
53unsigned long max_low_pfn_mapped;
53unsigned long max_pfn_mapped; 54unsigned long max_pfn_mapped;
54 55
55DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 56DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 48548ef7ddf8..122bcef222fc 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -53,6 +53,7 @@
53 * The direct mapping extends to max_pfn_mapped, so that we can directly access 53 * The direct mapping extends to max_pfn_mapped, so that we can directly access
54 * apertures, ACPI and other tables without having to play with fixmaps. 54 * apertures, ACPI and other tables without having to play with fixmaps.
55 */ 55 */
56unsigned long max_low_pfn_mapped;
56unsigned long max_pfn_mapped; 57unsigned long max_pfn_mapped;
57 58
58static unsigned long dma_reserve __initdata; 59static unsigned long dma_reserve __initdata;
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index afd40054d157..0389cb8f6b1a 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -536,8 +536,14 @@ static int split_large_page(pte_t *kpte, unsigned long address)
536 set_pte(&pbase[i], pfn_pte(pfn, ref_prot)); 536 set_pte(&pbase[i], pfn_pte(pfn, ref_prot));
537 537
538 if (address >= (unsigned long)__va(0) && 538 if (address >= (unsigned long)__va(0) &&
539 address < (unsigned long)__va(max_low_pfn_mapped << PAGE_SHIFT))
540 split_page_count(level);
541
542#ifdef CONFIG_X86_64
543 if (address >= (unsigned long)__va(1UL<<32) &&
539 address < (unsigned long)__va(max_pfn_mapped << PAGE_SHIFT)) 544 address < (unsigned long)__va(max_pfn_mapped << PAGE_SHIFT))
540 split_page_count(level); 545 split_page_count(level);
546#endif
541 547
542 /* 548 /*
543 * Install the new, split up pagetable. Important details here: 549 * Install the new, split up pagetable. Important details here:
@@ -655,12 +661,21 @@ static int cpa_process_alias(struct cpa_data *cpa)
655 if (cpa->pfn > max_pfn_mapped) 661 if (cpa->pfn > max_pfn_mapped)
656 return 0; 662 return 0;
657 663
664#ifdef CONFIG_X86_64
665 if (cpa->pfn > max_low_pfn_mapped && cpa->pfn < (1UL<<(32-PAGE_SHIFT)))
666 return 0;
667#endif
658 /* 668 /*
659 * No need to redo, when the primary call touched the direct 669 * No need to redo, when the primary call touched the direct
660 * mapping already: 670 * mapping already:
661 */ 671 */
662 if (!within(cpa->vaddr, PAGE_OFFSET, 672 if (!(within(cpa->vaddr, PAGE_OFFSET,
663 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))) { 673 PAGE_OFFSET + (max_low_pfn_mapped << PAGE_SHIFT))
674#ifdef CONFIG_X86_64
675 || within(cpa->vaddr, PAGE_OFFSET + (1UL<<32),
676 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))
677#endif
678 )) {
664 679
665 alias_cpa = *cpa; 680 alias_cpa = *cpa;
666 alias_cpa.vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); 681 alias_cpa.vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT);
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index a885a1019b8a..749766c3c5cd 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -449,7 +449,8 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
449 if (retval < 0) 449 if (retval < 0)
450 return 0; 450 return 0;
451 451
452 if (pfn <= max_pfn_mapped && 452 if (((pfn <= max_low_pfn_mapped) ||
453 (pfn >= (1UL<<(32 - PAGE_SHIFT)) && pfn <= max_pfn_mapped)) &&
453 ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) { 454 ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) {
454 free_memtype(offset, offset + size); 455 free_memtype(offset, offset + size);
455 printk(KERN_INFO 456 printk(KERN_INFO
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 0fd67b81a8b6..1b4763e26ea9 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -100,7 +100,19 @@ static __init inline int srat_disabled(void)
100/* Callback for SLIT parsing */ 100/* Callback for SLIT parsing */
101void __init acpi_numa_slit_init(struct acpi_table_slit *slit) 101void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
102{ 102{
103 acpi_slit = slit; 103 unsigned length;
104 unsigned long phys;
105
106 length = slit->header.length;
107 phys = find_e820_area(0, max_pfn_mapped<<PAGE_SHIFT, length,
108 PAGE_SIZE);
109
110 if (phys == -1L)
111 panic(" Can not save slit!\n");
112
113 acpi_slit = __va(phys);
114 memcpy(acpi_slit, slit, length);
115 reserve_early(phys, phys + length, "ACPI SLIT");
104} 116}
105 117
106/* Callback for Proximity Domain -> LAPIC mapping */ 118/* Callback for Proximity Domain -> LAPIC mapping */
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 6ccd7a108cd4..5281e343dd9f 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -334,7 +334,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
334 flags = new_flags; 334 flags = new_flags;
335 } 335 }
336 336
337 if (vma->vm_pgoff <= max_pfn_mapped && 337 if (((vma->vm_pgoff <= max_low_pfn_mapped) ||
338 (vma->vm_pgoff >= (1UL<<(32 - PAGE_SHIFT)) &&
339 vma->vm_pgoff <= max_pfn_mapped)) &&
338 ioremap_change_attr((unsigned long)__va(addr), len, flags)) { 340 ioremap_change_attr((unsigned long)__va(addr), len, flags)) {
339 free_memtype(addr, addr + len); 341 free_memtype(addr, addr + len);
340 return -EINVAL; 342 return -EINVAL;
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index cf058fecfcee..0bce5429a515 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -203,20 +203,11 @@ static struct page *vdso32_pages[1];
203 203
204#ifdef CONFIG_X86_64 204#ifdef CONFIG_X86_64
205 205
206static int use_sysenter __read_mostly = -1; 206#define vdso32_sysenter() (boot_cpu_has(X86_FEATURE_SYSENTER32))
207
208#define vdso32_sysenter() (use_sysenter > 0)
209 207
210/* May not be __init: called during resume */ 208/* May not be __init: called during resume */
211void syscall32_cpu_init(void) 209void syscall32_cpu_init(void)
212{ 210{
213 if (use_sysenter < 0) {
214 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
215 use_sysenter = 1;
216 if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR)
217 use_sysenter = 1;
218 }
219
220 /* Load these always in case some future AMD CPU supports 211 /* Load these always in case some future AMD CPU supports
221 SYSENTER from compat mode too. */ 212 SYSENTER from compat mode too. */
222 checking_wrmsrl(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS); 213 checking_wrmsrl(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS);
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h
index 84a56da397b1..75ef959db329 100644
--- a/include/asm-x86/cpufeature.h
+++ b/include/asm-x86/cpufeature.h
@@ -74,8 +74,8 @@
74#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ 74#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */
75#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ 75#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */
76#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ 76#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */
77/* 14 free */ 77#define X86_FEATURE_SYSCALL32 (3*32+14) /* syscall in ia32 userspace */
78/* 15 free */ 78#define X86_FEATURE_SYSENTER32 (3*32+15) /* sysenter in ia32 userspace */
79#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ 79#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */
80#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ 80#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */
81#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ 81#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */
diff --git a/include/asm-x86/dwarf2.h b/include/asm-x86/dwarf2.h
index b3cbb0ccae18..0bfe250894f7 100644
--- a/include/asm-x86/dwarf2.h
+++ b/include/asm-x86/dwarf2.h
@@ -1,5 +1,61 @@
1#ifdef CONFIG_X86_32 1#ifndef _DWARF2_H
2# include "dwarf2_32.h" 2#define _DWARF2_H
3
4#ifndef __ASSEMBLY__
5#warning "asm/dwarf2.h should be only included in pure assembly files"
6#endif
7
8/*
9 Macros for dwarf2 CFI unwind table entries.
10 See "as.info" for details on these pseudo ops. Unfortunately
11 they are only supported in very new binutils, so define them
12 away for older version.
13 */
14
15#ifdef CONFIG_AS_CFI
16
17#define CFI_STARTPROC .cfi_startproc
18#define CFI_ENDPROC .cfi_endproc
19#define CFI_DEF_CFA .cfi_def_cfa
20#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
21#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
22#define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
23#define CFI_OFFSET .cfi_offset
24#define CFI_REL_OFFSET .cfi_rel_offset
25#define CFI_REGISTER .cfi_register
26#define CFI_RESTORE .cfi_restore
27#define CFI_REMEMBER_STATE .cfi_remember_state
28#define CFI_RESTORE_STATE .cfi_restore_state
29#define CFI_UNDEFINED .cfi_undefined
30
31#ifdef CONFIG_AS_CFI_SIGNAL_FRAME
32#define CFI_SIGNAL_FRAME .cfi_signal_frame
33#else
34#define CFI_SIGNAL_FRAME
35#endif
36
3#else 37#else
4# include "dwarf2_64.h" 38
39/* Due to the structure of pre-exisiting code, don't use assembler line
40 comment character # to ignore the arguments. Instead, use a dummy macro. */
41.macro ignore a=0, b=0, c=0, d=0
42.endm
43
44#define CFI_STARTPROC ignore
45#define CFI_ENDPROC ignore
46#define CFI_DEF_CFA ignore
47#define CFI_DEF_CFA_REGISTER ignore
48#define CFI_DEF_CFA_OFFSET ignore
49#define CFI_ADJUST_CFA_OFFSET ignore
50#define CFI_OFFSET ignore
51#define CFI_REL_OFFSET ignore
52#define CFI_REGISTER ignore
53#define CFI_RESTORE ignore
54#define CFI_REMEMBER_STATE ignore
55#define CFI_RESTORE_STATE ignore
56#define CFI_UNDEFINED ignore
57#define CFI_SIGNAL_FRAME ignore
58
59#endif
60
5#endif 61#endif
diff --git a/include/asm-x86/dwarf2_32.h b/include/asm-x86/dwarf2_32.h
deleted file mode 100644
index 6d66398a307d..000000000000
--- a/include/asm-x86/dwarf2_32.h
+++ /dev/null
@@ -1,61 +0,0 @@
1#ifndef _DWARF2_H
2#define _DWARF2_H
3
4#ifndef __ASSEMBLY__
5#warning "asm/dwarf2.h should be only included in pure assembly files"
6#endif
7
8/*
9 Macros for dwarf2 CFI unwind table entries.
10 See "as.info" for details on these pseudo ops. Unfortunately
11 they are only supported in very new binutils, so define them
12 away for older version.
13 */
14
15#ifdef CONFIG_UNWIND_INFO
16
17#define CFI_STARTPROC .cfi_startproc
18#define CFI_ENDPROC .cfi_endproc
19#define CFI_DEF_CFA .cfi_def_cfa
20#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
21#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
22#define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
23#define CFI_OFFSET .cfi_offset
24#define CFI_REL_OFFSET .cfi_rel_offset
25#define CFI_REGISTER .cfi_register
26#define CFI_RESTORE .cfi_restore
27#define CFI_REMEMBER_STATE .cfi_remember_state
28#define CFI_RESTORE_STATE .cfi_restore_state
29#define CFI_UNDEFINED .cfi_undefined
30
31#ifdef CONFIG_AS_CFI_SIGNAL_FRAME
32#define CFI_SIGNAL_FRAME .cfi_signal_frame
33#else
34#define CFI_SIGNAL_FRAME
35#endif
36
37#else
38
39/* Due to the structure of pre-exisiting code, don't use assembler line
40 comment character # to ignore the arguments. Instead, use a dummy macro. */
41.macro ignore a=0, b=0, c=0, d=0
42.endm
43
44#define CFI_STARTPROC ignore
45#define CFI_ENDPROC ignore
46#define CFI_DEF_CFA ignore
47#define CFI_DEF_CFA_REGISTER ignore
48#define CFI_DEF_CFA_OFFSET ignore
49#define CFI_ADJUST_CFA_OFFSET ignore
50#define CFI_OFFSET ignore
51#define CFI_REL_OFFSET ignore
52#define CFI_REGISTER ignore
53#define CFI_RESTORE ignore
54#define CFI_REMEMBER_STATE ignore
55#define CFI_RESTORE_STATE ignore
56#define CFI_UNDEFINED ignore
57#define CFI_SIGNAL_FRAME ignore
58
59#endif
60
61#endif
diff --git a/include/asm-x86/dwarf2_64.h b/include/asm-x86/dwarf2_64.h
deleted file mode 100644
index c950519a264d..000000000000
--- a/include/asm-x86/dwarf2_64.h
+++ /dev/null
@@ -1,56 +0,0 @@
1#ifndef _DWARF2_H
2#define _DWARF2_H 1
3
4#ifndef __ASSEMBLY__
5#warning "asm/dwarf2.h should be only included in pure assembly files"
6#endif
7
8/*
9 Macros for dwarf2 CFI unwind table entries.
10 See "as.info" for details on these pseudo ops. Unfortunately
11 they are only supported in very new binutils, so define them
12 away for older version.
13 */
14
15#ifdef CONFIG_AS_CFI
16
17#define CFI_STARTPROC .cfi_startproc
18#define CFI_ENDPROC .cfi_endproc
19#define CFI_DEF_CFA .cfi_def_cfa
20#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
21#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
22#define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
23#define CFI_OFFSET .cfi_offset
24#define CFI_REL_OFFSET .cfi_rel_offset
25#define CFI_REGISTER .cfi_register
26#define CFI_RESTORE .cfi_restore
27#define CFI_REMEMBER_STATE .cfi_remember_state
28#define CFI_RESTORE_STATE .cfi_restore_state
29#define CFI_UNDEFINED .cfi_undefined
30#ifdef CONFIG_AS_CFI_SIGNAL_FRAME
31#define CFI_SIGNAL_FRAME .cfi_signal_frame
32#else
33#define CFI_SIGNAL_FRAME
34#endif
35
36#else
37
38/* use assembler line comment character # to ignore the arguments. */
39#define CFI_STARTPROC #
40#define CFI_ENDPROC #
41#define CFI_DEF_CFA #
42#define CFI_DEF_CFA_REGISTER #
43#define CFI_DEF_CFA_OFFSET #
44#define CFI_ADJUST_CFA_OFFSET #
45#define CFI_OFFSET #
46#define CFI_REL_OFFSET #
47#define CFI_REGISTER #
48#define CFI_RESTORE #
49#define CFI_REMEMBER_STATE #
50#define CFI_RESTORE_STATE #
51#define CFI_UNDEFINED #
52#define CFI_SIGNAL_FRAME #
53
54#endif
55
56#endif
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h
index 78c03d7bf441..33e793e991d0 100644
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -99,7 +99,8 @@ extern void free_early(u64 start, u64 end);
99extern void early_res_to_bootmem(u64 start, u64 end); 99extern void early_res_to_bootmem(u64 start, u64 end);
100extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align); 100extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
101 101
102extern unsigned long e820_end(void); 102extern unsigned long e820_end_of_ram_pfn(void);
103extern unsigned long e820_end_of_low_ram_pfn(void);
103extern int e820_find_active_region(const struct e820entry *ei, 104extern int e820_find_active_region(const struct e820entry *ei,
104 unsigned long start_pfn, 105 unsigned long start_pfn,
105 unsigned long last_pfn, 106 unsigned long last_pfn,
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
index b52ed85f32f5..28d7b4533b1a 100644
--- a/include/asm-x86/page.h
+++ b/include/asm-x86/page.h
@@ -61,6 +61,7 @@ extern void map_devmem(unsigned long pfn, unsigned long size,
61extern void unmap_devmem(unsigned long pfn, unsigned long size, 61extern void unmap_devmem(unsigned long pfn, unsigned long size,
62 pgprot_t vma_prot); 62 pgprot_t vma_prot);
63 63
64extern unsigned long max_low_pfn_mapped;
64extern unsigned long max_pfn_mapped; 65extern unsigned long max_pfn_mapped;
65 66
66struct page; 67struct page;
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index c4946c5964bf..983ce37c491f 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -160,7 +160,7 @@ extern void native_load_gs_index(unsigned);
160 * Save a segment register away 160 * Save a segment register away
161 */ 161 */
162#define savesegment(seg, value) \ 162#define savesegment(seg, value) \
163 asm("mov %%" #seg ",%0":"=rm" (value) : : "memory") 163 asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
164 164
165static inline unsigned long get_limit(unsigned long segment) 165static inline unsigned long get_limit(unsigned long segment)
166{ 166{