Skip to content

Commit 2471dc6

Browse files
committed
Linux Kernel 3.10.2 compiles and runs (mods done; .rej cleaned up)
Applied: /LineageOS/android/kernel/sony/msm8994$ patch -p1 -R < /home/dj/Downloads/linuxkernelpatches/patch-3.10.2-3 1) arch/arm64/mm/fault.c - #defines adapted because those from patch missing: ESR_WRITE -> ESR_EL1_WRITE ESR_CM -> ESR_EL1_CM 2) not reverted since functions nowhere defined: @@ -183,8 +183,10 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, */ __gov_queue_work(raw_smp_processor_id(), dbs_data, delay); } else { + get_online_cpus(); for_each_cpu(i, policy->cpus) __gov_queue_work(i, dbs_data, delay); + put_online_cpus(); } } EXPORT_SYMBOL_GPL(gov_queue_work); Change-Id: Idbc72cbf82fdae16a65ee595a3c4739b58634d2e
1 parent 353e614 commit 2471dc6

File tree

98 files changed

+406
-1110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+406
-1110
lines changed

Documentation/i2c/busses/i2c-piix4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Supported adapters:
1313
* AMD SP5100 (SB700 derivative found on some server mainboards)
1414
Datasheet: Publicly available at the AMD website
1515
http://support.amd.com/us/Embedded_TechDocs/44413.pdf
16-
* AMD Hudson-2, CZ
16+
* AMD Hudson-2
1717
Datasheet: Not publicly available
1818
* Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
1919
Datasheet: Publicly available at the SMSC website http://www.smsc.com

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 3
22
PATCHLEVEL = 10
3-
SUBLEVEL = 3
3+
SUBLEVEL = 2
44
EXTRAVERSION =
55
NAME = Unicycling Gorilla
66

arch/arm64/mm/fault.c

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,25 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
157157

158158
#define ESR_LNX_EXEC (1 << 24)
159159

160+
/*
161+
* Check that the permissions on the VMA allow for the fault which occurred.
162+
* If we encountered a write fault, we must have write permission, otherwise
163+
* we allow any permission.
164+
*/
165+
static inline bool access_error(unsigned int esr, struct vm_area_struct *vma)
166+
{
167+
unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
168+
169+
if (esr & ESR_EL1_WRITE)
170+
mask = VM_WRITE;
171+
if (esr & ESR_LNX_EXEC)
172+
mask = VM_EXEC;
173+
174+
return vma->vm_flags & mask ? false : true;
175+
}
176+
160177
static int __do_page_fault(struct mm_struct *mm, unsigned long addr,
161-
unsigned int mm_flags, unsigned long vm_flags,
178+
unsigned int esr, unsigned int flags,
162179
struct task_struct *tsk)
163180
{
164181
struct vm_area_struct *vma;
@@ -176,17 +193,12 @@ static int __do_page_fault(struct mm_struct *mm, unsigned long addr,
176193
* it.
177194
*/
178195
good_area:
179-
/*
180-
* Check that the permissions on the VMA allow for the fault which
181-
* occurred. If we encountered a write or exec fault, we must have
182-
* appropriate permissions, otherwise we allow any permission.
183-
*/
184-
if (!(vma->vm_flags & vm_flags)) {
196+
if (access_error(esr, vma)) {
185197
fault = VM_FAULT_BADACCESS;
186198
goto out;
187199
}
188200

189-
return handle_mm_fault(mm, vma, addr & PAGE_MASK, mm_flags);
201+
return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
190202

191203
check_stack:
192204
if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
@@ -201,16 +213,10 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
201213
struct task_struct *tsk;
202214
struct mm_struct *mm;
203215
int fault, sig, code;
204-
unsigned long vm_flags = VM_READ | VM_WRITE | VM_EXEC;
205-
unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
206-
207-
if (esr & ESR_LNX_EXEC) {
208-
vm_flags = VM_EXEC;
209-
} else if (((esr & ESR_EL1_WRITE) && !(esr & ESR_EL1_CM)) ||
210-
((esr & ESR_EL1_CM))) {
211-
vm_flags = VM_WRITE;
212-
mm_flags |= FAULT_FLAG_WRITE;
213-
}
216+
217+
bool write = (esr & ESR_EL1_WRITE) && !(esr & ESR_EL1_CM);
218+
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
219+
(write ? FAULT_FLAG_WRITE : 0);
214220

215221
tsk = current;
216222
mm = tsk->mm;
@@ -248,7 +254,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
248254
#endif
249255
}
250256

251-
fault = __do_page_fault(mm, addr, mm_flags, vm_flags, tsk);
257+
fault = __do_page_fault(mm, addr, esr, flags, tsk);
252258

253259
/*
254260
* If we need to retry but a fatal signal is pending, handle the
@@ -265,7 +271,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
265271
*/
266272

267273
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
268-
if (mm_flags & FAULT_FLAG_ALLOW_RETRY) {
274+
if (flags & FAULT_FLAG_ALLOW_RETRY) {
269275
if (fault & VM_FAULT_MAJOR) {
270276
tsk->maj_flt++;
271277
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs,
@@ -280,7 +286,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
280286
* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk of
281287
* starvation.
282288
*/
283-
mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;
289+
flags &= ~FAULT_FLAG_ALLOW_RETRY;
284290
goto retry;
285291
}
286292
}

arch/mips/cavium-octeon/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ void __init plat_mem_setup(void)
996996
cvmx_bootmem_unlock();
997997
/* Add the memory region for the kernel. */
998998
kernel_start = (unsigned long) _text;
999-
kernel_size = _end - _text;
999+
kernel_size = ALIGN(_end - _text, 0x100000);
10001000

10011001
/* Adjust for physical offset. */
10021002
kernel_start &= ~0xffffffff80000000ULL;

arch/powerpc/include/asm/exception-64s.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ label##_relon_pSeries: \
358358
/* No guest interrupts come through here */ \
359359
SET_SCRATCH0(r13); /* save r13 */ \
360360
EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \
361-
EXC_STD, NOTEST, vec)
361+
EXC_STD, KVMTEST_PR, vec)
362362

363363
#define STD_RELON_EXCEPTION_PSERIES_OOL(vec, label) \
364364
.globl label##_relon_pSeries; \
365365
label##_relon_pSeries: \
366-
EXCEPTION_PROLOG_1(PACA_EXGEN, NOTEST, vec); \
366+
EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST_PR, vec); \
367367
EXCEPTION_RELON_PROLOG_PSERIES_1(label##_common, EXC_STD)
368368

369369
#define STD_RELON_EXCEPTION_HV(loc, vec, label) \
@@ -374,12 +374,12 @@ label##_relon_hv: \
374374
/* No guest interrupts come through here */ \
375375
SET_SCRATCH0(r13); /* save r13 */ \
376376
EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \
377-
EXC_HV, NOTEST, vec)
377+
EXC_HV, KVMTEST, vec)
378378

379379
#define STD_RELON_EXCEPTION_HV_OOL(vec, label) \
380380
.globl label##_relon_hv; \
381381
label##_relon_hv: \
382-
EXCEPTION_PROLOG_1(PACA_EXGEN, NOTEST, vec); \
382+
EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST, vec); \
383383
EXCEPTION_RELON_PROLOG_PSERIES_1(label##_common, EXC_HV)
384384

385385
/* This associate vector numbers with bits in paca->irq_happened */

arch/powerpc/include/asm/reg.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@
626626
#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */
627627
#define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */
628628
#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */
629-
#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */
630629
#define MMCR0_FCTI 0x00000008UL /* freeze counters in tags inactive mode */
631630
#define MMCR0_FCTA 0x00000004UL /* freeze counters in tags active mode */
632631
#define MMCR0_FCWAIT 0x00000002UL /* freeze counter in WAIT state */

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,10 @@ vsx_unavailable_pSeries_1:
341341
EXCEPTION_PROLOG_0(PACA_EXGEN)
342342
b vsx_unavailable_pSeries
343343

344-
facility_unavailable_trampoline:
345344
. = 0xf60
346345
SET_SCRATCH0(r13)
347346
EXCEPTION_PROLOG_0(PACA_EXGEN)
348-
b facility_unavailable_pSeries
349-
350-
hv_facility_unavailable_trampoline:
351-
. = 0xf80
352-
SET_SCRATCH0(r13)
353-
EXCEPTION_PROLOG_0(PACA_EXGEN)
354-
b facility_unavailable_hv
347+
b tm_unavailable_pSeries
355348

356349
#ifdef CONFIG_CBE_RAS
357350
STD_EXCEPTION_HV(0x1200, 0x1202, cbe_system_error)
@@ -529,10 +522,8 @@ denorm_done:
529522
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf20)
530523
STD_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable)
531524
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf40)
532-
STD_EXCEPTION_PSERIES_OOL(0xf60, facility_unavailable)
525+
STD_EXCEPTION_PSERIES_OOL(0xf60, tm_unavailable)
533526
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf60)
534-
STD_EXCEPTION_HV_OOL(0xf82, facility_unavailable)
535-
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xf82)
536527

537528
/*
538529
* An interrupt came in while soft-disabled. We set paca->irq_happened, then:
@@ -802,18 +793,24 @@ system_call_relon_pSeries:
802793
STD_RELON_EXCEPTION_PSERIES(0x4d00, 0xd00, single_step)
803794

804795
. = 0x4e00
805-
b . /* Can't happen, see v2.07 Book III-S section 6.5 */
796+
SET_SCRATCH0(r13)
797+
EXCEPTION_PROLOG_0(PACA_EXGEN)
798+
b h_data_storage_relon_hv
806799

807800
. = 0x4e20
808-
b . /* Can't happen, see v2.07 Book III-S section 6.5 */
801+
SET_SCRATCH0(r13)
802+
EXCEPTION_PROLOG_0(PACA_EXGEN)
803+
b h_instr_storage_relon_hv
809804

810805
. = 0x4e40
811806
SET_SCRATCH0(r13)
812807
EXCEPTION_PROLOG_0(PACA_EXGEN)
813808
b emulation_assist_relon_hv
814809

815810
. = 0x4e60
816-
b . /* Can't happen, see v2.07 Book III-S section 6.5 */
811+
SET_SCRATCH0(r13)
812+
EXCEPTION_PROLOG_0(PACA_EXGEN)
813+
b hmi_exception_relon_hv
817814

818815
. = 0x4e80
819816
SET_SCRATCH0(r13)
@@ -838,17 +835,11 @@ vsx_unavailable_relon_pSeries_1:
838835
EXCEPTION_PROLOG_0(PACA_EXGEN)
839836
b vsx_unavailable_relon_pSeries
840837

841-
facility_unavailable_relon_trampoline:
838+
tm_unavailable_relon_pSeries_1:
842839
. = 0x4f60
843840
SET_SCRATCH0(r13)
844841
EXCEPTION_PROLOG_0(PACA_EXGEN)
845-
b facility_unavailable_relon_pSeries
846-
847-
hv_facility_unavailable_relon_trampoline:
848-
. = 0x4f80
849-
SET_SCRATCH0(r13)
850-
EXCEPTION_PROLOG_0(PACA_EXGEN)
851-
b facility_unavailable_relon_hv
842+
b tm_unavailable_relon_pSeries
852843

853844
STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint)
854845
#ifdef CONFIG_PPC_DENORMALISATION
@@ -1174,21 +1165,36 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
11741165
bl .vsx_unavailable_exception
11751166
b .ret_from_except
11761167

1177-
STD_EXCEPTION_COMMON(0xf60, facility_unavailable, .facility_unavailable_exception)
1168+
.align 7
1169+
.globl tm_unavailable_common
1170+
tm_unavailable_common:
1171+
EXCEPTION_PROLOG_COMMON(0xf60, PACA_EXGEN)
1172+
bl .save_nvgprs
1173+
DISABLE_INTS
1174+
addi r3,r1,STACK_FRAME_OVERHEAD
1175+
bl .tm_unavailable_exception
1176+
b .ret_from_except
11781177

11791178
.align 7
11801179
.globl __end_handlers
11811180
__end_handlers:
11821181

11831182
/* Equivalents to the above handlers for relocation-on interrupt vectors */
1183+
STD_RELON_EXCEPTION_HV_OOL(0xe00, h_data_storage)
1184+
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe00)
1185+
STD_RELON_EXCEPTION_HV_OOL(0xe20, h_instr_storage)
1186+
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe20)
11841187
STD_RELON_EXCEPTION_HV_OOL(0xe40, emulation_assist)
1188+
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe40)
1189+
STD_RELON_EXCEPTION_HV_OOL(0xe60, hmi_exception)
1190+
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe60)
11851191
MASKABLE_RELON_EXCEPTION_HV_OOL(0xe80, h_doorbell)
1192+
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe80)
11861193

11871194
STD_RELON_EXCEPTION_PSERIES_OOL(0xf00, performance_monitor)
11881195
STD_RELON_EXCEPTION_PSERIES_OOL(0xf20, altivec_unavailable)
11891196
STD_RELON_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable)
1190-
STD_RELON_EXCEPTION_PSERIES_OOL(0xf60, facility_unavailable)
1191-
STD_RELON_EXCEPTION_HV_OOL(0xf80, facility_unavailable)
1197+
STD_RELON_EXCEPTION_PSERIES_OOL(0xf60, tm_unavailable)
11921198

11931199
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
11941200
/*

arch/powerpc/kernel/hw_breakpoint.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
176176
length_max = 512 ; /* 64 doublewords */
177177
/* DAWR region can't cross 512 boundary */
178178
if ((bp->attr.bp_addr >> 10) !=
179-
((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 10))
179+
((bp->attr.bp_addr + bp->attr.bp_len) >> 10))
180180
return -EINVAL;
181181
}
182182
if (info->len >
@@ -250,7 +250,6 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
250250
* we still need to single-step the instruction, but we don't
251251
* generate an event.
252252
*/
253-
info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ;
254253
if (!((bp->attr.bp_addr <= dar) &&
255254
(dar - bp->attr.bp_addr < bp->attr.bp_len)))
256255
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;

arch/powerpc/kernel/ptrace.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,9 +1449,7 @@ static long ppc_set_hwdebug(struct task_struct *child,
14491449
*/
14501450
if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) {
14511451
len = bp_info->addr2 - bp_info->addr;
1452-
} else if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT)
1453-
len = 1;
1454-
else {
1452+
} else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) {
14551453
ptrace_put_breakpoints(child);
14561454
return -EINVAL;
14571455
}

arch/powerpc/kernel/setup_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#endif
7777

7878
int boot_cpuid = 0;
79-
int spinning_secondaries;
79+
int __initdata spinning_secondaries;
8080
u64 ppc64_pft_size;
8181

8282
/* Pick defaults since we might want to patch instructions

0 commit comments

Comments
 (0)