diff options
-rw-r--r-- | arch/arm/kernel/ptrace.c | 24 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/sys_arm.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 14 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 42 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 7 | ||||
-rw-r--r-- | drivers/video/xen-fbfront.c | 27 | ||||
-rw-r--r-- | drivers/xen/Kconfig | 22 | ||||
-rw-r--r-- | mm/percpu.c | 10 |
9 files changed, 103 insertions, 49 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 80abafb9bf33..9650c143afc1 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request, | |||
906 | return ret; | 906 | return ret; |
907 | } | 907 | } |
908 | 908 | ||
909 | #ifdef __ARMEB__ | ||
910 | #define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB | ||
911 | #else | ||
912 | #define AUDIT_ARCH_NR AUDIT_ARCH_ARM | ||
913 | #endif | ||
914 | |||
915 | asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | 909 | asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) |
916 | { | 910 | { |
917 | unsigned long ip; | 911 | unsigned long ip; |
918 | 912 | ||
919 | /* | 913 | if (why) |
920 | * Save IP. IP is used to denote syscall entry/exit: | ||
921 | * IP = 0 -> entry, = 1 -> exit | ||
922 | */ | ||
923 | ip = regs->ARM_ip; | ||
924 | regs->ARM_ip = why; | ||
925 | |||
926 | if (!ip) | ||
927 | audit_syscall_exit(regs); | 914 | audit_syscall_exit(regs); |
928 | else | 915 | else |
929 | audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, | 916 | audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, |
930 | regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); | 917 | regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); |
931 | 918 | ||
932 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 919 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
@@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) | |||
936 | 923 | ||
937 | current_thread_info()->syscall = scno; | 924 | current_thread_info()->syscall = scno; |
938 | 925 | ||
926 | /* | ||
927 | * IP is used to denote syscall entry/exit: | ||
928 | * IP = 0 -> entry, =1 -> exit | ||
929 | */ | ||
930 | ip = regs->ARM_ip; | ||
931 | regs->ARM_ip = why; | ||
932 | |||
939 | /* the 0x80 provides a way for the tracing parent to distinguish | 933 | /* the 0x80 provides a way for the tracing parent to distinguish |
940 | between a syscall stop and SIGTRAP delivery */ | 934 | between a syscall stop and SIGTRAP delivery */ |
941 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 935 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index f6a4d32b0421..8f4644659777 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
251 | struct mm_struct *mm = &init_mm; | 251 | struct mm_struct *mm = &init_mm; |
252 | unsigned int cpu = smp_processor_id(); | 252 | unsigned int cpu = smp_processor_id(); |
253 | 253 | ||
254 | printk("CPU%u: Booted secondary processor\n", cpu); | ||
255 | |||
256 | /* | 254 | /* |
257 | * All kernel threads share the same mm context; grab a | 255 | * All kernel threads share the same mm context; grab a |
258 | * reference and switch to it. | 256 | * reference and switch to it. |
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
264 | enter_lazy_tlb(mm, current); | 262 | enter_lazy_tlb(mm, current); |
265 | local_flush_tlb_all(); | 263 | local_flush_tlb_all(); |
266 | 264 | ||
265 | printk("CPU%u: Booted secondary processor\n", cpu); | ||
266 | |||
267 | cpu_init(); | 267 | cpu_init(); |
268 | preempt_disable(); | 268 | preempt_disable(); |
269 | trace_hardirqs_off(); | 269 | trace_hardirqs_off(); |
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index d2b177905cdb..76cbb055dd05 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c | |||
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename, | |||
115 | "Ir" (THREAD_START_SP - sizeof(regs)), | 115 | "Ir" (THREAD_START_SP - sizeof(regs)), |
116 | "r" (®s), | 116 | "r" (®s), |
117 | "Ir" (sizeof(regs)) | 117 | "Ir" (sizeof(regs)) |
118 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); | 118 | : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory"); |
119 | 119 | ||
120 | out: | 120 | out: |
121 | return ret; | 121 | return ret; |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 71f4727da373..5a98aa272184 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void) | |||
185 | #endif | 185 | #endif |
186 | rc = -EINVAL; | 186 | rc = -EINVAL; |
187 | if (pcpu_chosen_fc != PCPU_FC_PAGE) { | 187 | if (pcpu_chosen_fc != PCPU_FC_PAGE) { |
188 | const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE; | ||
189 | const size_t dyn_size = PERCPU_MODULE_RESERVE + | 188 | const size_t dyn_size = PERCPU_MODULE_RESERVE + |
190 | PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; | 189 | PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; |
190 | size_t atom_size; | ||
191 | 191 | ||
192 | /* | ||
193 | * On 64bit, use PMD_SIZE for atom_size so that embedded | ||
194 | * percpu areas are aligned to PMD. This, in the future, | ||
195 | * can also allow using PMD mappings in vmalloc area. Use | ||
196 | * PAGE_SIZE on 32bit as vmalloc space is highly contended | ||
197 | * and large vmalloc area allocs can easily fail. | ||
198 | */ | ||
199 | #ifdef CONFIG_X86_64 | ||
200 | atom_size = PMD_SIZE; | ||
201 | #else | ||
202 | atom_size = PAGE_SIZE; | ||
203 | #endif | ||
192 | rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, | 204 | rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, |
193 | dyn_size, atom_size, | 205 | dyn_size, atom_size, |
194 | pcpu_cpu_distance, | 206 | pcpu_cpu_distance, |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a8f8844b8d32..95dccce8e979 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <asm/stackprotector.h> | 63 | #include <asm/stackprotector.h> |
64 | #include <asm/hypervisor.h> | 64 | #include <asm/hypervisor.h> |
65 | #include <asm/mwait.h> | 65 | #include <asm/mwait.h> |
66 | #include <asm/pci_x86.h> | ||
66 | 67 | ||
67 | #ifdef CONFIG_ACPI | 68 | #ifdef CONFIG_ACPI |
68 | #include <linux/acpi.h> | 69 | #include <linux/acpi.h> |
@@ -809,9 +810,40 @@ static void xen_io_delay(void) | |||
809 | } | 810 | } |
810 | 811 | ||
811 | #ifdef CONFIG_X86_LOCAL_APIC | 812 | #ifdef CONFIG_X86_LOCAL_APIC |
813 | static unsigned long xen_set_apic_id(unsigned int x) | ||
814 | { | ||
815 | WARN_ON(1); | ||
816 | return x; | ||
817 | } | ||
818 | static unsigned int xen_get_apic_id(unsigned long x) | ||
819 | { | ||
820 | return ((x)>>24) & 0xFFu; | ||
821 | } | ||
812 | static u32 xen_apic_read(u32 reg) | 822 | static u32 xen_apic_read(u32 reg) |
813 | { | 823 | { |
814 | return 0; | 824 | struct xen_platform_op op = { |
825 | .cmd = XENPF_get_cpuinfo, | ||
826 | .interface_version = XENPF_INTERFACE_VERSION, | ||
827 | .u.pcpu_info.xen_cpuid = 0, | ||
828 | }; | ||
829 | int ret = 0; | ||
830 | |||
831 | /* Shouldn't need this as APIC is turned off for PV, and we only | ||
832 | * get called on the bootup processor. But just in case. */ | ||
833 | if (!xen_initial_domain() || smp_processor_id()) | ||
834 | return 0; | ||
835 | |||
836 | if (reg == APIC_LVR) | ||
837 | return 0x10; | ||
838 | |||
839 | if (reg != APIC_ID) | ||
840 | return 0; | ||
841 | |||
842 | ret = HYPERVISOR_dom0_op(&op); | ||
843 | if (ret) | ||
844 | return 0; | ||
845 | |||
846 | return op.u.pcpu_info.apic_id << 24; | ||
815 | } | 847 | } |
816 | 848 | ||
817 | static void xen_apic_write(u32 reg, u32 val) | 849 | static void xen_apic_write(u32 reg, u32 val) |
@@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void) | |||
849 | apic->icr_write = xen_apic_icr_write; | 881 | apic->icr_write = xen_apic_icr_write; |
850 | apic->wait_icr_idle = xen_apic_wait_icr_idle; | 882 | apic->wait_icr_idle = xen_apic_wait_icr_idle; |
851 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; | 883 | apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; |
884 | apic->set_apic_id = xen_set_apic_id; | ||
885 | apic->get_apic_id = xen_get_apic_id; | ||
852 | } | 886 | } |
853 | 887 | ||
854 | #endif | 888 | #endif |
@@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
1365 | /* Make sure ACS will be enabled */ | 1399 | /* Make sure ACS will be enabled */ |
1366 | pci_request_acs(); | 1400 | pci_request_acs(); |
1367 | } | 1401 | } |
1368 | 1402 | #ifdef CONFIG_PCI | |
1369 | 1403 | /* PCI BIOS service won't work from a PV guest. */ | |
1404 | pci_probe &= ~PCI_PROBE_BIOS; | ||
1405 | #endif | ||
1370 | xen_raw_console_write("about to get started...\n"); | 1406 | xen_raw_console_write("about to get started...\n"); |
1371 | 1407 | ||
1372 | xen_setup_runstate_info(0); | 1408 | xen_setup_runstate_info(0); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index b8e279479a6b..69f5857660ac 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
353 | { | 353 | { |
354 | if (val & _PAGE_PRESENT) { | 354 | if (val & _PAGE_PRESENT) { |
355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 355 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
356 | unsigned long pfn = mfn_to_pfn(mfn); | ||
357 | |||
356 | pteval_t flags = val & PTE_FLAGS_MASK; | 358 | pteval_t flags = val & PTE_FLAGS_MASK; |
357 | val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; | 359 | if (unlikely(pfn == ~0)) |
360 | val = flags & ~_PAGE_PRESENT; | ||
361 | else | ||
362 | val = ((pteval_t)pfn << PAGE_SHIFT) | flags; | ||
358 | } | 363 | } |
359 | 364 | ||
360 | return val; | 365 | return val; |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index cb4529c40d74..b7f5173ff9e9 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
365 | struct fb_info *fb_info; | 365 | struct fb_info *fb_info; |
366 | int fb_size; | 366 | int fb_size; |
367 | int val; | 367 | int val; |
368 | int ret; | 368 | int ret = 0; |
369 | 369 | ||
370 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 370 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
371 | if (info == NULL) { | 371 | if (info == NULL) { |
@@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
458 | xenfb_init_shared_page(info, fb_info); | 458 | xenfb_init_shared_page(info, fb_info); |
459 | 459 | ||
460 | ret = xenfb_connect_backend(dev, info); | 460 | ret = xenfb_connect_backend(dev, info); |
461 | if (ret < 0) | 461 | if (ret < 0) { |
462 | goto error; | 462 | xenbus_dev_fatal(dev, ret, "xenfb_connect_backend"); |
463 | goto error_fb; | ||
464 | } | ||
463 | 465 | ||
464 | ret = register_framebuffer(fb_info); | 466 | ret = register_framebuffer(fb_info); |
465 | if (ret) { | 467 | if (ret) { |
466 | fb_deferred_io_cleanup(fb_info); | ||
467 | fb_dealloc_cmap(&fb_info->cmap); | ||
468 | framebuffer_release(fb_info); | ||
469 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); | 468 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); |
470 | goto error; | 469 | goto error_fb; |
471 | } | 470 | } |
472 | info->fb_info = fb_info; | 471 | info->fb_info = fb_info; |
473 | 472 | ||
474 | xenfb_make_preferred_console(); | 473 | xenfb_make_preferred_console(); |
475 | return 0; | 474 | return 0; |
476 | 475 | ||
477 | error_nomem: | 476 | error_fb: |
478 | ret = -ENOMEM; | 477 | fb_deferred_io_cleanup(fb_info); |
479 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | 478 | fb_dealloc_cmap(&fb_info->cmap); |
480 | error: | 479 | framebuffer_release(fb_info); |
480 | error_nomem: | ||
481 | if (!ret) { | ||
482 | ret = -ENOMEM; | ||
483 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | ||
484 | } | ||
485 | error: | ||
481 | xenfb_remove(dev); | 486 | xenfb_remove(dev); |
482 | return ret; | 487 | return ret; |
483 | } | 488 | } |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 94243136f6bf..ea20c51d24c7 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR | |||
183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ | 183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ |
184 | default m | 184 | default m |
185 | help | 185 | help |
186 | This ACPI processor uploads Power Management information to the Xen hypervisor. | 186 | This ACPI processor uploads Power Management information to the Xen |
187 | 187 | hypervisor. | |
188 | To do that the driver parses the Power Management data and uploads said | 188 | |
189 | information to the Xen hypervisor. Then the Xen hypervisor can select the | 189 | To do that the driver parses the Power Management data and uploads |
190 | proper Cx and Pxx states. It also registers itslef as the SMM so that | 190 | said information to the Xen hypervisor. Then the Xen hypervisor can |
191 | other drivers (such as ACPI cpufreq scaling driver) will not load. | 191 | select the proper Cx and Pxx states. It also registers itslef as the |
192 | 192 | SMM so that other drivers (such as ACPI cpufreq scaling driver) will | |
193 | To compile this driver as a module, choose M here: the | 193 | not load. |
194 | module will be called xen_acpi_processor If you do not know what to choose, | 194 | |
195 | select M here. If the CPUFREQ drivers are built in, select Y here. | 195 | To compile this driver as a module, choose M here: the module will be |
196 | called xen_acpi_processor If you do not know what to choose, select | ||
197 | M here. If the CPUFREQ drivers are built in, select Y here. | ||
196 | 198 | ||
197 | endmenu | 199 | endmenu |
diff --git a/mm/percpu.c b/mm/percpu.c index f47af9123af7..f921fdfb5430 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1132,20 +1132,20 @@ static void pcpu_dump_alloc_info(const char *lvl, | |||
1132 | for (alloc_end += gi->nr_units / upa; | 1132 | for (alloc_end += gi->nr_units / upa; |
1133 | alloc < alloc_end; alloc++) { | 1133 | alloc < alloc_end; alloc++) { |
1134 | if (!(alloc % apl)) { | 1134 | if (!(alloc % apl)) { |
1135 | printk("\n"); | 1135 | printk(KERN_CONT "\n"); |
1136 | printk("%spcpu-alloc: ", lvl); | 1136 | printk("%spcpu-alloc: ", lvl); |
1137 | } | 1137 | } |
1138 | printk("[%0*d] ", group_width, group); | 1138 | printk(KERN_CONT "[%0*d] ", group_width, group); |
1139 | 1139 | ||
1140 | for (unit_end += upa; unit < unit_end; unit++) | 1140 | for (unit_end += upa; unit < unit_end; unit++) |
1141 | if (gi->cpu_map[unit] != NR_CPUS) | 1141 | if (gi->cpu_map[unit] != NR_CPUS) |
1142 | printk("%0*d ", cpu_width, | 1142 | printk(KERN_CONT "%0*d ", cpu_width, |
1143 | gi->cpu_map[unit]); | 1143 | gi->cpu_map[unit]); |
1144 | else | 1144 | else |
1145 | printk("%s ", empty_str); | 1145 | printk(KERN_CONT "%s ", empty_str); |
1146 | } | 1146 | } |
1147 | } | 1147 | } |
1148 | printk("\n"); | 1148 | printk(KERN_CONT "\n"); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | /** | 1151 | /** |