Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/android-3.18' into lineage-18.1
Browse files Browse the repository at this point in the history
Change-Id: I777d4d81df4e97dcefda2f36c8fea590eb21b24d
Signed-off-by: Francescodario Cuzzocrea <[email protected]>
  • Loading branch information
ivanmeler authored and fcuzzocrea committed Jul 11, 2021
2 parents 4b175ba + 31e7762 commit 43d1cc8
Show file tree
Hide file tree
Showing 137 changed files with 848 additions and 513 deletions.
2 changes: 1 addition & 1 deletion Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
register save and restore. The kernel will only save
legacy floating-point registers on task switch.

nospectre_v2 [X86] Disable all mitigations for the Spectre variant 2
nospectre_v2 [X86,PPC_FSL_BOOK3E] Disable all mitigations for the Spectre variant 2
(indirect branch prediction) vulnerability. System may
allow data leaks with this option, which is equivalent
to spectre_v2=off.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)


ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
KBUILD_CFLAGS += -Os
else
ifdef CONFIG_PROFILE_ALL_BRANCHES
KBUILD_CFLAGS += -O2
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/crypto/sha256-armv4.pl
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,11 @@ sub BODY_16_XX {
.global sha256_block_data_order
.type sha256_block_data_order,%function
sha256_block_data_order:
.Lsha256_block_data_order:
#if __ARM_ARCH__<7
sub r3,pc,#8 @ sha256_block_data_order
#else
adr r3,sha256_block_data_order
adr r3,.Lsha256_block_data_order
#endif
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
ldr r12,.LOPENSSL_armcap
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/crypto/sha256-core.S_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ K256:
.global sha256_block_data_order
.type sha256_block_data_order,%function
sha256_block_data_order:
.Lsha256_block_data_order:
#if __ARM_ARCH__<7
sub r3,pc,#8 @ sha256_block_data_order
#else
adr r3,sha256_block_data_order
adr r3,.Lsha256_block_data_order
#endif
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
ldr r12,.LOPENSSL_armcap
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/kernel/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct patch {
unsigned int insn;
};

static DEFINE_SPINLOCK(patch_lock);
static DEFINE_RAW_SPINLOCK(patch_lock);

static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
__acquires(&patch_lock)
Expand All @@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
return addr;

if (flags)
spin_lock_irqsave(&patch_lock, *flags);
raw_spin_lock_irqsave(&patch_lock, *flags);
else
__acquire(&patch_lock);

Expand All @@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
clear_fixmap(fixmap);

if (flags)
spin_unlock_irqrestore(&patch_lock, *flags);
raw_spin_unlock_irqrestore(&patch_lock, *flags);
else
__release(&patch_lock);
}
Expand Down
13 changes: 11 additions & 2 deletions arch/arm64/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,29 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,

static int kgdb_brk_fn(struct pt_regs *regs, unsigned int esr)
{
if (user_mode(regs))
return DBG_HOOK_ERROR;

kgdb_handle_exception(1, SIGTRAP, 0, regs);
return 0;
return DBG_HOOK_HANDLED;
}

static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int esr)
{
if (user_mode(regs))
return DBG_HOOK_ERROR;

compiled_break = 1;
kgdb_handle_exception(1, SIGTRAP, 0, regs);

return 0;
return DBG_HOOK_HANDLED;
}

static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr)
{
if (user_mode(regs))
return DBG_HOOK_ERROR;

kgdb_handle_exception(0, SIGTRAP, 0, regs);
return 0;
}
Expand Down
8 changes: 7 additions & 1 deletion arch/arm64/kernel/vdso/vdso.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ SECTIONS
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }

/*
* Discard .note.gnu.property sections which are unused and have
* different alignment requirement from vDSO note sections.
*/
/DISCARD/ : {
*(.note.GNU-stack .note.gnu.property)
}
.note : { *(.note.*) } :text :note

. = ALIGN(16);
Expand All @@ -59,7 +66,6 @@ SECTIONS
PROVIDE(end = .);

/DISCARD/ : {
*(.note.GNU-stack)
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)
}
Expand Down
9 changes: 5 additions & 4 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,12 @@ void __init hook_debug_fault_code(int nr,
debug_fault_info[nr].name = name;
}

asmlinkage int __exception do_debug_exception(unsigned long addr,
asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,
unsigned int esr,
struct pt_regs *regs)
{
const struct fault_info *inf = debug_fault_info + DBG_ESR_EVT(esr);
unsigned long pc = instruction_pointer(regs);
struct siginfo info;
int rv;

Expand All @@ -626,16 +627,16 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
if (interrupts_enabled(regs))
trace_hardirqs_off();

if (!inf->fn(addr, esr, regs)) {
if (!inf->fn(addr_if_watchpoint, esr, regs)) {
rv = 1;
} else {
pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n",
inf->name, esr, addr);
inf->name, esr, pc);

info.si_signo = inf->sig;
info.si_errno = 0;
info.si_code = inf->code;
info.si_addr = (void __user *)addr;
info.si_addr = (void __user *)pc;
arm64_notify_die("", regs, &info, 0);
rv = 0;
}
Expand Down
8 changes: 1 addition & 7 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1881,14 +1881,8 @@ config PHYSICAL_ALIGN
Don't change this unless you know what you are doing.

config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"
def_bool y
depends on SMP
---help---
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
( Note: power management support will enable this option
automatically on SMP systems. )
Say N if you want to disable CPU hotplug.

config BOOTPARAM_HOTPLUG_CPU0
bool "Set default setting of cpu0_hotpluggable"
Expand Down
1 change: 1 addition & 0 deletions arch/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \
REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4))
REALMODE_CFLAGS += $(CLANG_FLAGS)
export REALMODE_CFLAGS

# BITS is used as extension for files which are available in a 32 bit
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE
AFLAGS_header.o += -I$(obj)
$(obj)/header.o: $(obj)/voffset.h $(obj)/zoffset.h

LDFLAGS_setup.elf := -T
LDFLAGS_setup.elf := -m elf_i386 -T
$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
$(call if_changed,ld)

Expand Down
6 changes: 3 additions & 3 deletions arch/x86/kernel/cpu/perf_event_amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ static struct attribute_group amd_iommu_format_group = {
* sysfs events attributes
*---------------------------------------------*/
struct amd_iommu_event_desc {
struct kobj_attribute attr;
struct device_attribute attr;
const char *event;
};

static ssize_t _iommu_event_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
static ssize_t _iommu_event_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct amd_iommu_event_desc *event =
container_of(attr, struct amd_iommu_event_desc, attr);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/realmode/rm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
targets += realmode.lds
$(obj)/realmode.lds: $(obj)/pasyms.h

LDFLAGS_realmode.elf := --emit-relocs -T
LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
CPPFLAGS_realmode.lds += -P -C -I$(obj)

targets += realmode.elf
Expand Down
4 changes: 3 additions & 1 deletion drivers/acpi/custom_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
sizeof(struct acpi_table_header)))
return -EFAULT;
uncopied_bytes = max_size = table.length;
/* make sure the buf is not allocated */
kfree(buf);
buf = kzalloc(max_size, GFP_KERNEL);
if (!buf)
return -ENOMEM;
Expand All @@ -50,6 +52,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
(*ppos + count < count) ||
(count > uncopied_bytes)) {
kfree(buf);
buf = NULL;
return -EINVAL;
}

Expand All @@ -71,7 +74,6 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
}

kfree(buf);
return count;
}

Expand Down
4 changes: 3 additions & 1 deletion drivers/ata/libahci_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,13 @@ int ahci_platform_init_host(struct platform_device *pdev,
int i, irq, n_ports, rc;

irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
if (irq < 0) {
if (irq != -EPROBE_DEFER)
dev_err(dev, "no irq\n");
return irq;
}
if (!irq)
return -EINVAL;

/* prepare host */
pi.private_data = (void *)(unsigned long)hpriv->flags;
Expand Down
15 changes: 11 additions & 4 deletions drivers/ata/pata_arasan_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,19 @@ static int arasan_cf_probe(struct platform_device *pdev)
else
quirk = CF_BROKEN_UDMA; /* as it is on spear1340 */

/* if irq is 0, support only PIO */
acdev->irq = platform_get_irq(pdev, 0);
if (acdev->irq)
/*
* If there's an error getting IRQ (or we do get IRQ0),
* support only PIO
*/
ret = platform_get_irq(pdev, 0);
if (ret > 0) {
acdev->irq = ret;
irq_handler = arasan_cf_interrupt;
else
} else if (ret == -EPROBE_DEFER) {
return ret;
} else {
quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
}

acdev->pbase = res->start;
acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/pata_ixp4xx_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
return -ENOMEM;

irq = platform_get_irq(pdev, 0);
if (irq)
if (irq > 0)
irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
else if (irq < 0)
return irq;
else
return -EINVAL;

/* Setup expansion bus chip selects */
*data->cs0_cfg = data->cs0_bits;
Expand Down
4 changes: 4 additions & 0 deletions drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4089,6 +4089,10 @@ static int mv_platform_probe(struct platform_device *pdev)
n_ports = mv_platform_data->n_ports;
irq = platform_get_irq(pdev, 0);
}
if (irq < 0)
return irq;
if (!irq)
return -EINVAL;

host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);
Expand Down
11 changes: 11 additions & 0 deletions drivers/char/ttyprintk.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,23 @@ static int tpk_ioctl(struct tty_struct *tty,
return 0;
}

/*
* TTY operations hangup function.
*/
static void tpk_hangup(struct tty_struct *tty)
{
struct ttyprintk_port *tpkp = tty->driver_data;

tty_port_hangup(&tpkp->port);
}

static const struct tty_operations ttyprintk_ops = {
.open = tpk_open,
.close = tpk_close,
.write = tpk_write,
.write_room = tpk_write_room,
.ioctl = tpk_ioctl,
.hangup = tpk_hangup,
};

static struct tty_port_operations null_ops = { };
Expand Down
1 change: 1 addition & 0 deletions drivers/crypto/qat/qat_common/adf_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ static int adf_init_ring(struct adf_etr_ring_data *ring)
pr_err("QAT: Ring address not aligned\n");
dma_free_coherent(&GET_DEV(accel_dev), ring_size_bytes,
ring->base_addr, ring->dma_addr);
ring->base_addr = NULL;
return -EFAULT;
}

Expand Down
29 changes: 21 additions & 8 deletions drivers/crypto/qat/qat_dh895xcc/adf_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,31 @@ int adf_isr_resource_alloc(struct adf_accel_dev *accel_dev)

ret = adf_isr_alloc_msix_entry_table(accel_dev);
if (ret)
return ret;
if (adf_enable_msix(accel_dev))
goto err_out;

if (adf_setup_bh(accel_dev))
goto err_out;
ret = adf_enable_msix(accel_dev);
if (ret)
goto err_free_msix_table;

if (adf_request_irqs(accel_dev))
goto err_out;
ret = adf_setup_bh(accel_dev);
if (ret)
goto err_disable_msix;

ret = adf_request_irqs(accel_dev);
if (ret)
goto err_cleanup_bh;

return 0;

err_cleanup_bh:
adf_cleanup_bh(accel_dev);

err_disable_msix:
adf_disable_msix(&accel_dev->accel_pci_dev);

err_free_msix_table:
adf_isr_free_msix_entry_table(accel_dev);

err_out:
adf_isr_resource_free(accel_dev);
return -EFAULT;
return ret;
}
Loading

0 comments on commit 43d1cc8

Please sign in to comment.