Contents of /trunk/kernel-magellan/patches-3.7/0108-3.7.9-all-fixes.patch
Parent Directory | Revision Log
Revision 2077 -
(show annotations)
(download)
Mon Feb 18 12:04:24 2013 UTC (11 years, 7 months ago) by niro
File size: 7718 byte(s)
Mon Feb 18 12:04:24 2013 UTC (11 years, 7 months ago) by niro
File size: 7718 byte(s)
-linux-3.7.9
1 | diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c |
2 | index b5d8a18..252c7e6 100644 |
3 | --- a/arch/s390/kernel/time.c |
4 | +++ b/arch/s390/kernel/time.c |
5 | @@ -120,6 +120,9 @@ static int s390_next_ktime(ktime_t expires, |
6 | nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires)); |
7 | do_div(nsecs, 125); |
8 | S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9); |
9 | + /* Program the maximum value if we have an overflow (== year 2042) */ |
10 | + if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc)) |
11 | + S390_lowcore.clock_comparator = -1ULL; |
12 | set_clock_comparator(S390_lowcore.clock_comparator); |
13 | return 0; |
14 | } |
15 | diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h |
16 | index a1f780d..796ed83 100644 |
17 | --- a/arch/x86/include/asm/pgtable.h |
18 | +++ b/arch/x86/include/asm/pgtable.h |
19 | @@ -142,6 +142,11 @@ static inline unsigned long pmd_pfn(pmd_t pmd) |
20 | return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT; |
21 | } |
22 | |
23 | +static inline unsigned long pud_pfn(pud_t pud) |
24 | +{ |
25 | + return (pud_val(pud) & PTE_PFN_MASK) >> PAGE_SHIFT; |
26 | +} |
27 | + |
28 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) |
29 | |
30 | static inline int pmd_large(pmd_t pte) |
31 | diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c |
32 | index e03a1e1..562a76d 100644 |
33 | --- a/arch/x86/kernel/apic/x2apic_phys.c |
34 | +++ b/arch/x86/kernel/apic/x2apic_phys.c |
35 | @@ -20,18 +20,19 @@ static int set_x2apic_phys_mode(char *arg) |
36 | } |
37 | early_param("x2apic_phys", set_x2apic_phys_mode); |
38 | |
39 | -static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
40 | +static bool x2apic_fadt_phys(void) |
41 | { |
42 | - if (x2apic_phys) |
43 | - return x2apic_enabled(); |
44 | - else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) && |
45 | - (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) && |
46 | - x2apic_enabled()) { |
47 | + if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) && |
48 | + (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) { |
49 | printk(KERN_DEBUG "System requires x2apic physical mode\n"); |
50 | - return 1; |
51 | + return true; |
52 | } |
53 | - else |
54 | - return 0; |
55 | + return false; |
56 | +} |
57 | + |
58 | +static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
59 | +{ |
60 | + return x2apic_enabled() && (x2apic_phys || x2apic_fadt_phys()); |
61 | } |
62 | |
63 | static void |
64 | @@ -82,7 +83,7 @@ static void init_x2apic_ldr(void) |
65 | |
66 | static int x2apic_phys_probe(void) |
67 | { |
68 | - if (x2apic_mode && x2apic_phys) |
69 | + if (x2apic_mode && (x2apic_phys || x2apic_fadt_phys())) |
70 | return 1; |
71 | |
72 | return apic == &apic_x2apic_phys; |
73 | diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c |
74 | index 8e13ecb..79ff7da 100644 |
75 | --- a/arch/x86/mm/fault.c |
76 | +++ b/arch/x86/mm/fault.c |
77 | @@ -748,13 +748,15 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, |
78 | return; |
79 | } |
80 | #endif |
81 | + /* Kernel addresses are always protection faults: */ |
82 | + if (address >= TASK_SIZE) |
83 | + error_code |= PF_PROT; |
84 | |
85 | - if (unlikely(show_unhandled_signals)) |
86 | + if (likely(show_unhandled_signals)) |
87 | show_signal_msg(regs, error_code, address, tsk); |
88 | |
89 | - /* Kernel addresses are always protection faults: */ |
90 | tsk->thread.cr2 = address; |
91 | - tsk->thread.error_code = error_code | (address >= TASK_SIZE); |
92 | + tsk->thread.error_code = error_code; |
93 | tsk->thread.trap_nr = X86_TRAP_PF; |
94 | |
95 | force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0); |
96 | diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c |
97 | index 3baff25..ce42da7 100644 |
98 | --- a/arch/x86/mm/init_64.c |
99 | +++ b/arch/x86/mm/init_64.c |
100 | @@ -829,6 +829,9 @@ int kern_addr_valid(unsigned long addr) |
101 | if (pud_none(*pud)) |
102 | return 0; |
103 | |
104 | + if (pud_large(*pud)) |
105 | + return pfn_valid(pud_pfn(*pud)); |
106 | + |
107 | pmd = pmd_offset(pud, addr); |
108 | if (pmd_none(*pmd)) |
109 | return 0; |
110 | diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c |
111 | index 77cf009..928bf83 100644 |
112 | --- a/arch/x86/platform/efi/efi.c |
113 | +++ b/arch/x86/platform/efi/efi.c |
114 | @@ -87,7 +87,7 @@ EXPORT_SYMBOL(efi_enabled); |
115 | |
116 | static int __init setup_noefi(char *arg) |
117 | { |
118 | - clear_bit(EFI_BOOT, &x86_efi_facility); |
119 | + clear_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility); |
120 | return 0; |
121 | } |
122 | early_param("noefi", setup_noefi); |
123 | diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S |
124 | index f9643fc..33ca6e4 100644 |
125 | --- a/arch/x86/xen/xen-asm_32.S |
126 | +++ b/arch/x86/xen/xen-asm_32.S |
127 | @@ -89,11 +89,11 @@ ENTRY(xen_iret) |
128 | */ |
129 | #ifdef CONFIG_SMP |
130 | GET_THREAD_INFO(%eax) |
131 | - movl TI_cpu(%eax), %eax |
132 | - movl __per_cpu_offset(,%eax,4), %eax |
133 | - mov xen_vcpu(%eax), %eax |
134 | + movl %ss:TI_cpu(%eax), %eax |
135 | + movl %ss:__per_cpu_offset(,%eax,4), %eax |
136 | + mov %ss:xen_vcpu(%eax), %eax |
137 | #else |
138 | - movl xen_vcpu, %eax |
139 | + movl %ss:xen_vcpu, %eax |
140 | #endif |
141 | |
142 | /* check IF state we're restoring */ |
143 | @@ -106,11 +106,11 @@ ENTRY(xen_iret) |
144 | * resuming the code, so we don't have to be worried about |
145 | * being preempted to another CPU. |
146 | */ |
147 | - setz XEN_vcpu_info_mask(%eax) |
148 | + setz %ss:XEN_vcpu_info_mask(%eax) |
149 | xen_iret_start_crit: |
150 | |
151 | /* check for unmasked and pending */ |
152 | - cmpw $0x0001, XEN_vcpu_info_pending(%eax) |
153 | + cmpw $0x0001, %ss:XEN_vcpu_info_pending(%eax) |
154 | |
155 | /* |
156 | * If there's something pending, mask events again so we can |
157 | @@ -118,7 +118,7 @@ xen_iret_start_crit: |
158 | * touch XEN_vcpu_info_mask. |
159 | */ |
160 | jne 1f |
161 | - movb $1, XEN_vcpu_info_mask(%eax) |
162 | + movb $1, %ss:XEN_vcpu_info_mask(%eax) |
163 | |
164 | 1: popl %eax |
165 | |
166 | diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c |
167 | index 513972f..6c5c7c5 100644 |
168 | --- a/drivers/pci/remove.c |
169 | +++ b/drivers/pci/remove.c |
170 | @@ -19,6 +19,8 @@ static void pci_free_resources(struct pci_dev *dev) |
171 | |
172 | static void pci_stop_dev(struct pci_dev *dev) |
173 | { |
174 | + pci_pme_active(dev, false); |
175 | + |
176 | if (dev->is_added) { |
177 | pci_proc_detach_device(dev); |
178 | pci_remove_sysfs_dev_files(dev); |
179 | diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c |
180 | index 10c1a34..81c5077 100644 |
181 | --- a/drivers/rtc/rtc-pl031.c |
182 | +++ b/drivers/rtc/rtc-pl031.c |
183 | @@ -350,7 +350,9 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) |
184 | /* Enable the clockwatch on ST Variants */ |
185 | if (vendor->clockwatch) |
186 | data |= RTC_CR_CWEN; |
187 | - writel(data | RTC_CR_EN, ldata->base + RTC_CR); |
188 | + else |
189 | + data |= RTC_CR_EN; |
190 | + writel(data, ldata->base + RTC_CR); |
191 | |
192 | /* |
193 | * On ST PL031 variants, the RTC reset value does not provide correct |
194 | diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c |
195 | index 58a1f41..4b0b8dd 100644 |
196 | --- a/fs/xfs/xfs_buf.c |
197 | +++ b/fs/xfs/xfs_buf.c |
198 | @@ -487,7 +487,6 @@ _xfs_buf_find( |
199 | struct rb_node *parent; |
200 | xfs_buf_t *bp; |
201 | xfs_daddr_t blkno = map[0].bm_bn; |
202 | - xfs_daddr_t eofs; |
203 | int numblks = 0; |
204 | int i; |
205 | |
206 | @@ -499,23 +498,6 @@ _xfs_buf_find( |
207 | ASSERT(!(numbytes < (1 << btp->bt_sshift))); |
208 | ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask)); |
209 | |
210 | - /* |
211 | - * Corrupted block numbers can get through to here, unfortunately, so we |
212 | - * have to check that the buffer falls within the filesystem bounds. |
213 | - */ |
214 | - eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks); |
215 | - if (blkno >= eofs) { |
216 | - /* |
217 | - * XXX (dgc): we should really be returning EFSCORRUPTED here, |
218 | - * but none of the higher level infrastructure supports |
219 | - * returning a specific error on buffer lookup failures. |
220 | - */ |
221 | - xfs_alert(btp->bt_mount, |
222 | - "%s: Block out of range: block 0x%llx, EOFS 0x%llx ", |
223 | - __func__, blkno, eofs); |
224 | - return NULL; |
225 | - } |
226 | - |
227 | /* get tree root */ |
228 | pag = xfs_perag_get(btp->bt_mount, |
229 | xfs_daddr_to_agno(btp->bt_mount, blkno)); |
230 | diff --git a/mm/mlock.c b/mm/mlock.c |
231 | index f0b9ce5..c9bd528 100644 |
232 | --- a/mm/mlock.c |
233 | +++ b/mm/mlock.c |
234 | @@ -517,11 +517,11 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) |
235 | static int do_mlockall(int flags) |
236 | { |
237 | struct vm_area_struct * vma, * prev = NULL; |
238 | - unsigned int def_flags = 0; |
239 | |
240 | if (flags & MCL_FUTURE) |
241 | - def_flags = VM_LOCKED; |
242 | - current->mm->def_flags = def_flags; |
243 | + current->mm->def_flags |= VM_LOCKED; |
244 | + else |
245 | + current->mm->def_flags &= ~VM_LOCKED; |
246 | if (flags == MCL_FUTURE) |
247 | goto out; |
248 |