Skip to content

Commit

Permalink
Linux Kernel 3.10.25 compiles and runs (lot of reverts left out, they…
Browse files Browse the repository at this point in the history
… lead to bootloop;.rej cleaned up)

Applied:
/LineageOS/android/kernel/sony/msm8994$ patch -p1 -R <
/home/dj/Downloads/linuxkernelpatches/patch-3.10.25-26

Revert
works:
arch/arm/kernel/hyp-stub.S
arch/arm/kvm/interrupts_head.S
arch/arm64/boot/dts/foundation-v8.dts
arch/powerpc/kernel/head_64.S

bootloop:
mm/pgtable-generic.c
arch/arm64/kernel/smp.c
arch/arm64/include/asm/pgtable.h

leftout:
arch/arm64/include/asm/spinlock.h
arch/arm64/include/asm/thread_info.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/smp.c
include/asm-generic/pgtable.h
include/drm/drm_pciids.h
include/linux/auxvec.h
include/linux/ceph/osd_client.h
include/linux/ceph/osd_client.h
include/linux/mm_types.h
include/linux/spinlock.h
include/target/target_core_base.h
mm/pgtable-generic.c

Change-Id: Iff07feab6b98dc357ea0e41eb715e2e55ad62305
  • Loading branch information
djStolen committed Jan 8, 2024
1 parent 8fccb60 commit dc4e0d8
Show file tree
Hide file tree
Showing 108 changed files with 389 additions and 880 deletions.
4 changes: 0 additions & 4 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1466,10 +1466,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

* dump_id: dump IDENTIFY data.

* atapi_dmadir: Enable ATAPI DMADIR bridge support

* disable: Disable this device.

If there are multiple matching configurations changing
the same attribute, the last one is used.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 26
SUBLEVEL = 25
EXTRAVERSION =
NAME = TOSSUG Baby Fish

Expand Down
9 changes: 9 additions & 0 deletions arch/arm/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ static inline u32 arch_timer_get_cntfrq(void)
return val;
}

static inline u64 arch_counter_get_cntpct(void)
{
u64 cval;

isb();
asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval));
return cval;
}

static inline u64 arch_counter_get_cntpct_cp15(void)
{
u64 cval;
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/kernel/hyp-stub.S
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE
mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL
orr r7, r7, #3 @ PL1PCEN | PL1PCTEN
mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL
mov r7, #0
mcrr p15, 4, r7, r7, c14 @ CNTVOFF
1:
#endif

Expand Down
4 changes: 0 additions & 4 deletions arch/arm/kvm/interrupts_head.S
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,6 @@ vcpu .req r0 @ vcpu pointer always in r0
add r5, vcpu, r4
strd r2, r3, [r5]

@ Ensure host CNTVCT == CNTPCT
mov r2, #0
mcrr p15, 4, r2, r2, c14 @ CNTVOFF

1:
#endif
@ Allow physical timer/counter access for the host
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ struct omap_hwmod omap2xxx_counter_32k_hwmod = {

/* gpmc */
static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
{ .irq = 20 + OMAP_INTC_START, },
{ .irq = 20 },
{ .irq = -1 }
};

Expand Down Expand Up @@ -841,7 +841,7 @@ static struct omap_hwmod_class omap2_rng_hwmod_class = {
};

static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
{ .irq = 52 + OMAP_INTC_START, },
{ .irq = 52 },
{ .irq = -1 }
};

Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@ static struct omap_hwmod_class omap3xxx_gpmc_hwmod_class = {
};

static struct omap_hwmod_irq_info omap3xxx_gpmc_irqs[] = {
{ .irq = 20 + OMAP_INTC_START, },
{ .irq = 20 },
{ .irq = -1 }
};

Expand Down Expand Up @@ -2986,7 +2986,7 @@ static struct omap_mmu_dev_attr mmu_isp_dev_attr = {

static struct omap_hwmod omap3xxx_mmu_isp_hwmod;
static struct omap_hwmod_irq_info omap3xxx_mmu_isp_irqs[] = {
{ .irq = 24 + OMAP_INTC_START, },
{ .irq = 24 },
{ .irq = -1 }
};

Expand Down Expand Up @@ -3028,7 +3028,7 @@ static struct omap_mmu_dev_attr mmu_iva_dev_attr = {

static struct omap_hwmod omap3xxx_mmu_iva_hwmod;
static struct omap_hwmod_irq_info omap3xxx_mmu_iva_irqs[] = {
{ .irq = 28 + OMAP_INTC_START, },
{ .irq = 28 },
{ .irq = -1 }
};

Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/boot/dts/foundation-v8.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/dts-v1/;

/memreserve/ 0x80000000 0x00010000;

/ {
model = "Foundation-v8A";
compatible = "arm,foundation-aarch64", "arm,vexpress";
Expand Down
10 changes: 10 additions & 0 deletions arch/arm64/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ static inline void arch_timer_set_cntkctl(u32 cntkctl)
asm volatile("msr cntkctl_el1, %0" : : "r" (cntkctl));
}

//static inline u64 arch_counter_get_cntpct(void)
//{
//u64 cval;

//isb();
//asm volatile("mrs %0, cntpct_el0" : "=r" (cval));

//return cval;
//}

static inline void arch_timer_evtstrm_enable(int divider)
{
u32 cntkctl = arch_timer_get_cntkctl();
Expand Down
6 changes: 0 additions & 6 deletions arch/arm64/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
unsigned int i, unsigned int n,
unsigned long *args)
{
if (n == 0)
return;

if (i + n > SYSCALL_MAX_ARGS) {
unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i;
unsigned int n_bad = n + i - SYSCALL_MAX_ARGS;
Expand All @@ -88,9 +85,6 @@ static inline void syscall_set_arguments(struct task_struct *task,
unsigned int i, unsigned int n,
const unsigned long *args)
{
if (n == 0)
return;

if (i + n > SYSCALL_MAX_ARGS) {
pr_warning("%s called with max args %d, handling only %d\n",
__func__, i + n, SYSCALL_MAX_ARGS);
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/kernel/fpsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ void fpsimd_thread_switch(struct task_struct *next)

void fpsimd_flush_thread(void)
{
preempt_disable();
memset(&current->thread.fpsimd_state, 0, sizeof(struct fpsimd_state));
fpsimd_load_state(&current->thread.fpsimd_state);
preempt_enable();
}

/*
Expand Down
38 changes: 20 additions & 18 deletions arch/arm64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,29 +219,31 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
{
int err, len, type, disabled = !ctrl.enabled;

attr->disabled = disabled;
if (disabled)
return 0;

err = arch_bp_generic_fields(ctrl, &len, &type);
if (err)
return err;

switch (note_type) {
case NT_ARM_HW_BREAK:
if ((type & HW_BREAKPOINT_X) != type)
return -EINVAL;
break;
case NT_ARM_HW_WATCH:
if ((type & HW_BREAKPOINT_RW) != type)
if (disabled) {
len = 0;
type = HW_BREAKPOINT_EMPTY;
} else {
err = arch_bp_generic_fields(ctrl, &len, &type);
if (err)
return err;

switch (note_type) {
case NT_ARM_HW_BREAK:
if ((type & HW_BREAKPOINT_X) != type)
return -EINVAL;
break;
case NT_ARM_HW_WATCH:
if ((type & HW_BREAKPOINT_RW) != type)
return -EINVAL;
break;
default:
return -EINVAL;
break;
default:
return -EINVAL;
}
}

attr->bp_len = len;
attr->bp_type = type;
attr->disabled = disabled;

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/exception-64s.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ do_kvm_##n: \
subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
beq- 1f; \
ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
1: cmpdi cr1,r1,-INT_FRAME_SIZE; /* check if r1 is in userspace */ \
1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
blt+ cr1,3f; /* abort if it is */ \
li r1,(n); /* will be reloaded later */ \
sth r1,PACA_TRAP_SAVE(r13); \
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ _STATIC(__after_prom_start)
mtctr r8
bctr

.balign 8
p_end: .llong _end - _stext

4: /* Now copy the rest of the kernel up to _end */
Expand Down
6 changes: 1 addition & 5 deletions arch/powerpc/kvm/book3s_64_mmu_hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,22 +473,18 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
slb_v = vcpu->kvm->arch.vrma_slb_v;
}

preempt_disable();
/* Find the HPTE in the hash table */
index = kvmppc_hv_find_lock_hpte(kvm, eaddr, slb_v,
HPTE_V_VALID | HPTE_V_ABSENT);
if (index < 0) {
preempt_enable();
if (index < 0)
return -ENOENT;
}
hptep = (unsigned long *)(kvm->arch.hpt_virt + (index << 4));
v = hptep[0] & ~HPTE_V_HVLOCK;
gr = kvm->arch.revmap[index].guest_rpte;

/* Unlock the HPTE */
asm volatile("lwsync" : : : "memory");
hptep[0] = v;
preempt_enable();

gpte->eaddr = eaddr;
gpte->vpage = ((v & HPTE_V_AVPN) << 4) | ((eaddr >> 12) & 0xfff);
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/kvm/book3s_hv_rm_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,6 @@ static int slb_base_page_shift[4] = {
20, /* 1M, unsupported */
};

/* When called from virtmode, this func should be protected by
* preempt_disable(), otherwise, the holding of HPTE_V_HVLOCK
* can trigger deadlock issue.
*/
long kvmppc_hv_find_lock_hpte(struct kvm *kvm, gva_t eaddr, unsigned long slb_v,
unsigned long valid)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/sh/kernel/sh_ksyms_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ EXPORT_SYMBOL(csum_partial_copy_generic);
EXPORT_SYMBOL(copy_page);
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(empty_zero_page);
#ifdef CONFIG_FLATMEM
/* need in pfn_valid macro */
EXPORT_SYMBOL(min_low_pfn);
EXPORT_SYMBOL(max_low_pfn);
#endif

#define DECLARE_EXPORT(name) \
extern void name(void);EXPORT_SYMBOL(name)
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lib-y = delay.o memmove.o memchr.o \
checksum.o strlen.o div64.o div64-generic.o

# Extracted from libgcc
obj-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \
lib-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \
ashlsi3.o ashrsi3.o ashiftrt.o lshrsi3.o \
udiv_qrnnd.o

Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static inline unsigned long pte_present(pte_t pte)
}

#define pte_accessible pte_accessible
static inline unsigned long pte_accessible(struct mm_struct *mm, pte_t a)
static inline unsigned long pte_accessible(pte_t a)
{
return pte_val(a) & _PAGE_VALID;
}
Expand Down Expand Up @@ -806,7 +806,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
* SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U
* and SUN4V pte layout, so this inline test is fine.
*/
if (likely(mm != &init_mm) && pte_accessible(mm, orig))
if (likely(mm != &init_mm) && pte_accessible(orig))
tlb_batch_add(mm, addr, ptep, orig, fullmm);
}

Expand Down
11 changes: 2 additions & 9 deletions arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,9 @@ static inline int pte_present(pte_t a)
}

#define pte_accessible pte_accessible
static inline bool pte_accessible(struct mm_struct *mm, pte_t a)
static inline int pte_accessible(pte_t a)
{
if (pte_flags(a) & _PAGE_PRESENT)
return true;

if ((pte_flags(a) & (_PAGE_PROTNONE | _PAGE_NUMA)) &&
mm_tlb_flush_pending(mm))
return true;

return false;
return pte_flags(a) & _PAGE_PRESENT;
}

static inline int pte_hidden(pte_t pte)
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,8 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
#define arch_read_relax(lock) cpu_relax()
#define arch_write_relax(lock) cpu_relax()

/* The {read|write|spin}_lock() on x86 are full memory barriers. */
static inline void smp_mb__after_lock(void) { }
#define ARCH_HAS_SMP_MB_AFTER_LOCK

#endif /* _ASM_X86_SPINLOCK_H */
3 changes: 1 addition & 2 deletions arch/x86/kernel/cpu/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_PEBS);
}

if (c->x86 == 6 && cpu_has_clflush &&
(c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
if (c->x86 == 6 && c->x86_model == 29 && cpu_has_clflush)
set_cpu_cap(c, X86_FEATURE_CLFLUSH_MONITOR);

#ifdef CONFIG_X86_64
Expand Down
8 changes: 4 additions & 4 deletions arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,10 +1364,6 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
return;
}

if (!kvm_vcpu_is_bsp(apic->vcpu))
value &= ~MSR_IA32_APICBASE_BSP;
vcpu->arch.apic_base = value;

/* update jump label if enable bit changes */
if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) {
if (value & MSR_IA32_APICBASE_ENABLE)
Expand All @@ -1377,6 +1373,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
recalculate_apic_map(vcpu->kvm);
}

if (!kvm_vcpu_is_bsp(apic->vcpu))
value &= ~MSR_IA32_APICBASE_BSP;

vcpu->arch.apic_base = value;
if ((old_value ^ value) & X2APIC_ENABLE) {
if (value & X2APIC_ENABLE) {
u32 id = kvm_apic_id(apic);
Expand Down
7 changes: 1 addition & 6 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ int ata_dev_configure(struct ata_device *dev)
cdb_intr_string = ", CDB intr";
}

if (atapi_dmadir || (dev->horkage & ATA_HORKAGE_ATAPI_DMADIR) || atapi_id_dmadir(dev->id)) {
if (atapi_dmadir || atapi_id_dmadir(dev->id)) {
dev->flags |= ATA_DFLAG_DMADIR;
dma_dir_string = ", DMADIR";
}
Expand Down Expand Up @@ -4140,9 +4140,6 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ |
ATA_HORKAGE_FIRMWARE_WARN },

/* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */
{ "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA },

/* Blacklist entries taken from Silicon Image 3124/3132
Windows driver .inf file - also several Linux problem reports */
{ "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, },
Expand Down Expand Up @@ -6506,8 +6503,6 @@ static int __init ata_parse_force_one(char **cur,
{ "nosrst", .lflags = ATA_LFLAG_NO_SRST },
{ "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
{ "rstonce", .lflags = ATA_LFLAG_RST_ONCE },
{ "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR },
{ "disable", .horkage_on = ATA_HORKAGE_DISABLE },
};
char *start = *cur, *p = *cur;
char *id, *val, *endp;
Expand Down
Loading

0 comments on commit dc4e0d8

Please sign in to comment.