Skip to content

Commit

Permalink
Merge tag 'v5.13.13' into 5.13
Browse files Browse the repository at this point in the history
Linux 5.13.13
  • Loading branch information
xanmod committed Aug 26, 2021
2 parents 0316edb + 7aeadb5 commit 5e9d07d
Show file tree
Hide file tree
Showing 129 changed files with 1,190 additions and 771 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 13
SUBLEVEL = 12
SUBLEVEL = 13
EXTRAVERSION =
NAME = Opossums on Parade

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/am43x-epos-evm.dts
Expand Up @@ -582,7 +582,7 @@
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
clock-frequency = <400000>;
clock-frequency = <100000>;

tps65218: tps65218@24 {
reg = <0x24>;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
Expand Up @@ -755,14 +755,14 @@
status = "disabled";
};

vica: intc@10140000 {
vica: interrupt-controller@10140000 {
compatible = "arm,versatile-vic";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x10140000 0x20>;
};

vicb: intc@10140020 {
vicb: interrupt-controller@10140020 {
compatible = "arm,versatile-vic";
interrupt-controller;
#interrupt-cells = <1>;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/Makefile
Expand Up @@ -181,6 +181,8 @@ archprepare:
# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=arch/arm64/kernel/vdso
$(Q)$(MAKE) $(clean)=arch/arm64/kernel/vdso32

ifeq ($(KBUILD_EXTMOD),)
# We need to generate vdso-offsets.h before compiling certain files in kernel/.
Expand Down
12 changes: 12 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015, LGE Inc. All rights reserved.
* Copyright (c) 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2021, Petr Vorel <petr.vorel@gmail.com>
*/

/dts-v1/;
Expand All @@ -9,6 +10,9 @@
#include "pm8994.dtsi"
#include "pmi8994.dtsi"

/* cont_splash_mem has different memory mapping */
/delete-node/ &cont_splash_mem;

/ {
model = "LG Nexus 5X";
compatible = "lg,bullhead", "qcom,msm8992";
Expand All @@ -17,6 +21,9 @@
qcom,board-id = <0xb64 0>;
qcom,pmic-id = <0x10009 0x1000A 0x0 0x0>;

/* Bullhead firmware doesn't support PSCI */
/delete-node/ psci;

aliases {
serial0 = &blsp1_uart2;
};
Expand All @@ -38,6 +45,11 @@
ftrace-size = <0x10000>;
pmsg-size = <0x20000>;
};

cont_splash_mem: memory@3400000 {
reg = <0 0x03400000 0 0x1200000>;
no-map;
};
};
};

Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8994-angler-rev-101.dts
@@ -1,12 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015, Huawei Inc. All rights reserved.
* Copyright (c) 2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2021, Petr Vorel <petr.vorel@gmail.com>
*/

/dts-v1/;

#include "msm8994.dtsi"

/* Angler's firmware does not report where the memory is allocated */
/delete-node/ &cont_splash_mem;

/ {
model = "Huawei Nexus 6P";
compatible = "huawei,angler", "qcom,msm8994";
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
Expand Up @@ -69,7 +69,7 @@
};
rmtfs_upper_guard: memory@f5d01000 {
no-map;
reg = <0 0xf5d01000 0 0x2000>;
reg = <0 0xf5d01000 0 0x1000>;
};

/*
Expand All @@ -78,7 +78,7 @@
*/
removed_region: memory@88f00000 {
no-map;
reg = <0 0x88f00000 0 0x200000>;
reg = <0 0x88f00000 0 0x1c00000>;
};

ramoops: ramoops@ac300000 {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
Expand Up @@ -700,15 +700,15 @@
left_spkr: wsa8810-left{
compatible = "sdw10217211000";
reg = <0 3>;
powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
#thermal-sensor-cells = <0>;
sound-name-prefix = "SpkrLeft";
#sound-dai-cells = <0>;
};

right_spkr: wsa8810-right{
compatible = "sdw10217211000";
powerdown-gpios = <&wcdgpio 3 GPIO_ACTIVE_HIGH>;
powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
reg = <0 4>;
#thermal-sensor-cells = <0>;
sound-name-prefix = "SpkrRight";
Expand Down
41 changes: 41 additions & 0 deletions arch/powerpc/include/asm/book3s/32/kup.h
Expand Up @@ -4,9 +4,50 @@

#include <asm/bug.h>
#include <asm/book3s/32/mmu-hash.h>
#include <asm/mmu.h>
#include <asm/synch.h>

#ifndef __ASSEMBLY__

static __always_inline bool kuep_is_disabled(void)
{
return !IS_ENABLED(CONFIG_PPC_KUEP);
}

static inline void kuep_lock(void)
{
if (kuep_is_disabled())
return;

update_user_segments(mfsr(0) | SR_NX);
/*
* This isync() shouldn't be necessary as the kernel is not excepted to
* run any instruction in userspace soon after the update of segments,
* but hash based cores (at least G3) seem to exhibit a random
* behaviour when the 'isync' is not there. 603 cores don't have this
* behaviour so don't do the 'isync' as it saves several CPU cycles.
*/
if (mmu_has_feature(MMU_FTR_HPTE_TABLE))
isync(); /* Context sync required after mtsr() */
}

static inline void kuep_unlock(void)
{
if (kuep_is_disabled())
return;

update_user_segments(mfsr(0) & ~SR_NX);
/*
* This isync() shouldn't be necessary as a 'rfi' will soon be executed
* to return to userspace, but hash based cores (at least G3) seem to
* exhibit a random behaviour when the 'isync' is not there. 603 cores
* don't have this behaviour so don't do the 'isync' as it saves several
* CPU cycles.
*/
if (mmu_has_feature(MMU_FTR_HPTE_TABLE))
isync(); /* Context sync required after mtsr() */
}

#ifdef CONFIG_PPC_KUAP

#include <linux/sched.h>
Expand Down
27 changes: 27 additions & 0 deletions arch/powerpc/include/asm/book3s/32/mmu-hash.h
Expand Up @@ -102,6 +102,33 @@ extern s32 patch__hash_page_B, patch__hash_page_C;
extern s32 patch__flush_hash_A0, patch__flush_hash_A1, patch__flush_hash_A2;
extern s32 patch__flush_hash_B;

#include <asm/reg.h>
#include <asm/task_size_32.h>

#define UPDATE_TWO_USER_SEGMENTS(n) do { \
if (TASK_SIZE > ((n) << 28)) \
mtsr(val1, (n) << 28); \
if (TASK_SIZE > (((n) + 1) << 28)) \
mtsr(val2, ((n) + 1) << 28); \
val1 = (val1 + 0x222) & 0xf0ffffff; \
val2 = (val2 + 0x222) & 0xf0ffffff; \
} while (0)

static __always_inline void update_user_segments(u32 val)
{
int val1 = val;
int val2 = (val + 0x111) & 0xf0ffffff;

UPDATE_TWO_USER_SEGMENTS(0);
UPDATE_TWO_USER_SEGMENTS(2);
UPDATE_TWO_USER_SEGMENTS(4);
UPDATE_TWO_USER_SEGMENTS(6);
UPDATE_TWO_USER_SEGMENTS(8);
UPDATE_TWO_USER_SEGMENTS(10);
UPDATE_TWO_USER_SEGMENTS(12);
UPDATE_TWO_USER_SEGMENTS(14);
}

#endif /* !__ASSEMBLY__ */

/* We happily ignore the smaller BATs on 601, we don't actually use
Expand Down
5 changes: 1 addition & 4 deletions arch/powerpc/include/asm/kup.h
Expand Up @@ -46,10 +46,7 @@ void setup_kuep(bool disabled);
static inline void setup_kuep(bool disabled) { }
#endif /* CONFIG_PPC_KUEP */

#if defined(CONFIG_PPC_KUEP) && defined(CONFIG_PPC_BOOK3S_32)
void kuep_lock(void);
void kuep_unlock(void);
#else
#ifndef CONFIG_PPC_BOOK3S_32
static inline void kuep_lock(void) { }
static inline void kuep_unlock(void) { }
#endif
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/mm/book3s32/Makefile
Expand Up @@ -10,3 +10,4 @@ obj-y += mmu.o mmu_context.o
obj-$(CONFIG_PPC_BOOK3S_603) += nohash_low.o
obj-$(CONFIG_PPC_BOOK3S_604) += hash_low.o tlb.o
obj-$(CONFIG_PPC_KUEP) += kuep.o
obj-$(CONFIG_PPC_KUAP) += kuap.o
11 changes: 11 additions & 0 deletions arch/powerpc/mm/book3s32/kuap.c
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include <asm/kup.h>

void __init setup_kuap(bool disabled)
{
pr_info("Activating Kernel Userspace Access Protection\n");

if (disabled)
pr_warn("KUAP cannot be disabled yet on 6xx when compiled in\n");
}
37 changes: 4 additions & 33 deletions arch/powerpc/mm/book3s32/kuep.c
@@ -1,40 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include <asm/kup.h>
#include <asm/reg.h>
#include <asm/task_size_32.h>
#include <asm/mmu.h>

#define KUEP_UPDATE_TWO_USER_SEGMENTS(n) do { \
if (TASK_SIZE > ((n) << 28)) \
mtsr(val1, (n) << 28); \
if (TASK_SIZE > (((n) + 1) << 28)) \
mtsr(val2, ((n) + 1) << 28); \
val1 = (val1 + 0x222) & 0xf0ffffff; \
val2 = (val2 + 0x222) & 0xf0ffffff; \
} while (0)

static __always_inline void kuep_update(u32 val)
void __init setup_kuep(bool disabled)
{
int val1 = val;
int val2 = (val + 0x111) & 0xf0ffffff;

KUEP_UPDATE_TWO_USER_SEGMENTS(0);
KUEP_UPDATE_TWO_USER_SEGMENTS(2);
KUEP_UPDATE_TWO_USER_SEGMENTS(4);
KUEP_UPDATE_TWO_USER_SEGMENTS(6);
KUEP_UPDATE_TWO_USER_SEGMENTS(8);
KUEP_UPDATE_TWO_USER_SEGMENTS(10);
KUEP_UPDATE_TWO_USER_SEGMENTS(12);
KUEP_UPDATE_TWO_USER_SEGMENTS(14);
}
pr_info("Activating Kernel Userspace Execution Prevention\n");

void kuep_lock(void)
{
kuep_update(mfsr(0) | SR_NX);
}

void kuep_unlock(void)
{
kuep_update(mfsr(0) & ~SR_NX);
if (disabled)
pr_warn("KUEP cannot be disabled yet on 6xx when compiled in\n");
}
20 changes: 0 additions & 20 deletions arch/powerpc/mm/book3s32/mmu.c
Expand Up @@ -445,26 +445,6 @@ void __init print_system_hash_info(void)
pr_info("Hash_mask = 0x%lx\n", Hash_mask);
}

#ifdef CONFIG_PPC_KUEP
void __init setup_kuep(bool disabled)
{
pr_info("Activating Kernel Userspace Execution Prevention\n");

if (disabled)
pr_warn("KUEP cannot be disabled yet on 6xx when compiled in\n");
}
#endif

#ifdef CONFIG_PPC_KUAP
void __init setup_kuap(bool disabled)
{
pr_info("Activating Kernel Userspace Access Protection\n");

if (disabled)
pr_warn("KUAP cannot be disabled yet on 6xx when compiled in\n");
}
#endif

void __init early_init_mmu(void)
{
}
4 changes: 2 additions & 2 deletions arch/riscv/kernel/setup.c
Expand Up @@ -230,8 +230,8 @@ static void __init init_resources(void)
}

/* Clean-up any unused pre-allocated resources */
mem_res_sz = (num_resources - res_idx + 1) * sizeof(*mem_res);
memblock_free(__pa(mem_res), mem_res_sz);
if (res_idx >= 0)
memblock_free(__pa(mem_res), (res_idx + 1) * sizeof(*mem_res));
return;

error:
Expand Down
6 changes: 6 additions & 0 deletions arch/s390/pci/pci.c
Expand Up @@ -560,9 +560,12 @@ static void zpci_cleanup_bus_resources(struct zpci_dev *zdev)

int pcibios_add_device(struct pci_dev *pdev)
{
struct zpci_dev *zdev = to_zpci(pdev);
struct resource *res;
int i;

/* The pdev has a reference to the zdev via its bus */
zpci_zdev_get(zdev);
if (pdev->is_physfn)
pdev->no_vf_scan = 1;

Expand All @@ -582,7 +585,10 @@ int pcibios_add_device(struct pci_dev *pdev)

void pcibios_release_device(struct pci_dev *pdev)
{
struct zpci_dev *zdev = to_zpci(pdev);

zpci_unmap_resources(pdev);
zpci_zdev_put(zdev);
}

int pcibios_enable_device(struct pci_dev *pdev, int mask)
Expand Down
5 changes: 5 additions & 0 deletions arch/s390/pci/pci_bus.h
Expand Up @@ -22,6 +22,11 @@ static inline void zpci_zdev_put(struct zpci_dev *zdev)
kref_put(&zdev->kref, zpci_release_device);
}

static inline void zpci_zdev_get(struct zpci_dev *zdev)
{
kref_get(&zdev->kref);
}

int zpci_alloc_domain(int domain);
void zpci_free_domain(int domain);
int zpci_setup_bus_resources(struct zpci_dev *zdev,
Expand Down
12 changes: 7 additions & 5 deletions arch/x86/events/core.c
Expand Up @@ -2489,13 +2489,15 @@ void perf_clear_dirty_counters(void)
return;

for_each_set_bit(i, cpuc->dirty, X86_PMC_IDX_MAX) {
/* Metrics and fake events don't have corresponding HW counters. */
if (is_metric_idx(i) || (i == INTEL_PMC_IDX_FIXED_VLBR))
continue;
else if (i >= INTEL_PMC_IDX_FIXED)
if (i >= INTEL_PMC_IDX_FIXED) {
/* Metrics and fake events don't have corresponding HW counters. */
if ((i - INTEL_PMC_IDX_FIXED) >= hybrid(cpuc->pmu, num_counters_fixed))
continue;

wrmsrl(MSR_ARCH_PERFMON_FIXED_CTR0 + (i - INTEL_PMC_IDX_FIXED), 0);
else
} else {
wrmsrl(x86_pmu_event_addr(i), 0);
}
}

bitmap_zero(cpuc->dirty, X86_PMC_IDX_MAX);
Expand Down

0 comments on commit 5e9d07d

Please sign in to comment.