Skip to content

Commit b0e39aa

Browse files
committed
Merge tag 'v4.18.15' into 4.18-main
This is the 4.18.15 stable release
2 parents 61b2cc6 + 2724bf1 commit b0e39aa

File tree

159 files changed

+1289
-621
lines changed

Some content is hidden

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

159 files changed

+1289
-621
lines changed

Documentation/devicetree/bindings/net/macb.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Required properties:
1010
Use "cdns,pc302-gem" for Picochip picoXcell pc302 and later devices based on
1111
the Cadence GEM, or the generic form: "cdns,gem".
1212
Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs.
13+
Use "atmel,sama5d3-macb" for the 10/100Mbit IP available on Atmel sama5d3 SoCs.
1314
Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs.
1415
Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs.
1516
Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.

Makefile

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 18
4-
SUBLEVEL = 14
4+
SUBLEVEL = 15
55
EXTRAVERSION =
66
NAME = Merciless Moray
77

@@ -298,19 +298,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
298298
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
299299
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
300300

301-
# SUBARCH tells the usermode build what the underlying arch is. That is set
302-
# first, and if a usermode build is happening, the "ARCH=um" on the command
303-
# line overrides the setting of ARCH below. If a native build is happening,
304-
# then ARCH is assigned, getting whatever value it gets normally, and
305-
# SUBARCH is subsequently ignored.
306-
307-
SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
308-
-e s/sun4u/sparc64/ \
309-
-e s/arm.*/arm/ -e s/sa110/arm/ \
310-
-e s/s390x/s390/ -e s/parisc64/parisc/ \
311-
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
312-
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
313-
-e s/riscv.*/riscv/)
301+
include scripts/subarch.include
314302

315303
# Cross compiling and selecting different set of gcc/bin-utils
316304
# ---------------------------------------------------------------------------

arch/arm/boot/dts/sama5d3_emac.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
};
4242

4343
macb1: ethernet@f802c000 {
44-
compatible = "cdns,at91sam9260-macb", "cdns,macb";
44+
compatible = "atmel,sama5d3-macb", "cdns,at91sam9260-macb", "cdns,macb";
4545
reg = <0xf802c000 0x100>;
4646
interrupts = <35 IRQ_TYPE_LEVEL_HIGH 3>;
4747
pinctrl-names = "default";

arch/arm64/kernel/perf_event.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,12 @@ static int armv8pmu_set_event_filter(struct hw_perf_event *event,
823823
return 0;
824824
}
825825

826+
static int armv8pmu_filter_match(struct perf_event *event)
827+
{
828+
unsigned long evtype = event->hw.config_base & ARMV8_PMU_EVTYPE_EVENT;
829+
return evtype != ARMV8_PMUV3_PERFCTR_CHAIN;
830+
}
831+
826832
static void armv8pmu_reset(void *info)
827833
{
828834
struct arm_pmu *cpu_pmu = (struct arm_pmu *)info;
@@ -968,6 +974,7 @@ static int armv8_pmu_init(struct arm_pmu *cpu_pmu)
968974
cpu_pmu->reset = armv8pmu_reset,
969975
cpu_pmu->max_period = (1LLU << 32) - 1,
970976
cpu_pmu->set_event_filter = armv8pmu_set_event_filter;
977+
cpu_pmu->filter_match = armv8pmu_filter_match;
971978

972979
return 0;
973980
}

arch/mips/include/asm/processor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/atomic.h>
1515
#include <linux/cpumask.h>
16+
#include <linux/sizes.h>
1617
#include <linux/threads.h>
1718

1819
#include <asm/cachectl.h>
@@ -80,11 +81,10 @@ extern unsigned int vced_count, vcei_count;
8081

8182
#endif
8283

83-
/*
84-
* One page above the stack is used for branch delay slot "emulation".
85-
* See dsemul.c for details.
86-
*/
87-
#define STACK_TOP ((TASK_SIZE & PAGE_MASK) - PAGE_SIZE)
84+
#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_256M)
85+
86+
extern unsigned long mips_stack_top(void);
87+
#define STACK_TOP mips_stack_top()
8888

8989
/*
9090
* This decides where the kernel will search for a free chunk of vm

arch/mips/kernel/process.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
#include <linux/prctl.h>
3232
#include <linux/nmi.h>
3333

34+
#include <asm/abi.h>
3435
#include <asm/asm.h>
3536
#include <asm/bootinfo.h>
3637
#include <asm/cpu.h>
3738
#include <asm/dsemul.h>
3839
#include <asm/dsp.h>
3940
#include <asm/fpu.h>
4041
#include <asm/irq.h>
42+
#include <asm/mips-cps.h>
4143
#include <asm/msa.h>
4244
#include <asm/pgtable.h>
4345
#include <asm/mipsregs.h>
@@ -644,6 +646,29 @@ unsigned long get_wchan(struct task_struct *task)
644646
return pc;
645647
}
646648

649+
unsigned long mips_stack_top(void)
650+
{
651+
unsigned long top = TASK_SIZE & PAGE_MASK;
652+
653+
/* One page for branch delay slot "emulation" */
654+
top -= PAGE_SIZE;
655+
656+
/* Space for the VDSO, data page & GIC user page */
657+
top -= PAGE_ALIGN(current->thread.abi->vdso->size);
658+
top -= PAGE_SIZE;
659+
top -= mips_gic_present() ? PAGE_SIZE : 0;
660+
661+
/* Space for cache colour alignment */
662+
if (cpu_has_dc_aliases)
663+
top -= shm_align_mask + 1;
664+
665+
/* Space to randomize the VDSO base */
666+
if (current->flags & PF_RANDOMIZE)
667+
top -= VDSO_RANDOMIZE_SIZE;
668+
669+
return top;
670+
}
671+
647672
/*
648673
* Don't forget that the stack pointer must be aligned on a 8 bytes
649674
* boundary for 32-bits ABI and 16 bytes for 64-bits ABI.

arch/mips/kernel/setup.c

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,34 @@ static void __init arch_mem_init(char **cmdline_p)
835835
struct memblock_region *reg;
836836
extern void plat_mem_setup(void);
837837

838+
/*
839+
* Initialize boot_command_line to an innocuous but non-empty string in
840+
* order to prevent early_init_dt_scan_chosen() from copying
841+
* CONFIG_CMDLINE into it without our knowledge. We handle
842+
* CONFIG_CMDLINE ourselves below & don't want to duplicate its
843+
* content because repeating arguments can be problematic.
844+
*/
845+
strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE);
846+
847+
/* call board setup routine */
848+
plat_mem_setup();
849+
850+
/*
851+
* Make sure all kernel memory is in the maps. The "UP" and
852+
* "DOWN" are opposite for initdata since if it crosses over
853+
* into another memory section you don't want that to be
854+
* freed when the initdata is freed.
855+
*/
856+
arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT,
857+
PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT,
858+
BOOT_MEM_RAM);
859+
arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT,
860+
PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT,
861+
BOOT_MEM_INIT_RAM);
862+
863+
pr_info("Determined physical RAM map:\n");
864+
print_memory_map();
865+
838866
#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)
839867
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
840868
#else
@@ -862,26 +890,6 @@ static void __init arch_mem_init(char **cmdline_p)
862890
}
863891
#endif
864892
#endif
865-
866-
/* call board setup routine */
867-
plat_mem_setup();
868-
869-
/*
870-
* Make sure all kernel memory is in the maps. The "UP" and
871-
* "DOWN" are opposite for initdata since if it crosses over
872-
* into another memory section you don't want that to be
873-
* freed when the initdata is freed.
874-
*/
875-
arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT,
876-
PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT,
877-
BOOT_MEM_RAM);
878-
arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT,
879-
PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT,
880-
BOOT_MEM_INIT_RAM);
881-
882-
pr_info("Determined physical RAM map:\n");
883-
print_memory_map();
884-
885893
strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
886894

887895
*cmdline_p = command_line;

arch/mips/kernel/vdso.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/ioport.h>
1616
#include <linux/kernel.h>
1717
#include <linux/mm.h>
18+
#include <linux/random.h>
1819
#include <linux/sched.h>
1920
#include <linux/slab.h>
2021
#include <linux/timekeeper_internal.h>
@@ -97,6 +98,21 @@ void update_vsyscall_tz(void)
9798
}
9899
}
99100

101+
static unsigned long vdso_base(void)
102+
{
103+
unsigned long base;
104+
105+
/* Skip the delay slot emulation page */
106+
base = STACK_TOP + PAGE_SIZE;
107+
108+
if (current->flags & PF_RANDOMIZE) {
109+
base += get_random_int() & (VDSO_RANDOMIZE_SIZE - 1);
110+
base = PAGE_ALIGN(base);
111+
}
112+
113+
return base;
114+
}
115+
100116
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
101117
{
102118
struct mips_vdso_image *image = current->thread.abi->vdso;
@@ -137,7 +153,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
137153
if (cpu_has_dc_aliases)
138154
size += shm_align_mask + 1;
139155

140-
base = get_unmapped_area(NULL, 0, size, 0, 0);
156+
base = get_unmapped_area(NULL, vdso_base(), size, 0, 0);
141157
if (IS_ERR_VALUE(base)) {
142158
ret = base;
143159
goto out;

arch/powerpc/include/asm/book3s/64/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
*/
105105
#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
106106
_PAGE_ACCESSED | H_PAGE_THP_HUGE | _PAGE_PTE | \
107-
_PAGE_SOFT_DIRTY)
107+
_PAGE_SOFT_DIRTY | _PAGE_DEVMAP)
108108
/*
109109
* user access blocked by key
110110
*/
@@ -122,7 +122,7 @@
122122
*/
123123
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
124124
_PAGE_ACCESSED | _PAGE_SPECIAL | _PAGE_PTE | \
125-
_PAGE_SOFT_DIRTY)
125+
_PAGE_SOFT_DIRTY | _PAGE_DEVMAP)
126126

127127
#define H_PTE_PKEY (H_PTE_PKEY_BIT0 | H_PTE_PKEY_BIT1 | H_PTE_PKEY_BIT2 | \
128128
H_PTE_PKEY_BIT3 | H_PTE_PKEY_BIT4)

arch/powerpc/kvm/book3s_64_mmu_radix.c

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
538538
unsigned long ea, unsigned long dsisr)
539539
{
540540
struct kvm *kvm = vcpu->kvm;
541-
unsigned long mmu_seq, pte_size;
542-
unsigned long gpa, gfn, hva, pfn;
541+
unsigned long mmu_seq;
542+
unsigned long gpa, gfn, hva;
543543
struct kvm_memory_slot *memslot;
544544
struct page *page = NULL;
545545
long ret;
@@ -636,9 +636,10 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
636636
*/
637637
hva = gfn_to_hva_memslot(memslot, gfn);
638638
if (upgrade_p && __get_user_pages_fast(hva, 1, 1, &page) == 1) {
639-
pfn = page_to_pfn(page);
640639
upgrade_write = true;
641640
} else {
641+
unsigned long pfn;
642+
642643
/* Call KVM generic code to do the slow-path check */
643644
pfn = __gfn_to_pfn_memslot(memslot, gfn, false, NULL,
644645
writing, upgrade_p);
@@ -652,63 +653,55 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
652653
}
653654
}
654655

655-
/* See if we can insert a 1GB or 2MB large PTE here */
656-
level = 0;
657-
if (page && PageCompound(page)) {
658-
pte_size = PAGE_SIZE << compound_order(compound_head(page));
659-
if (pte_size >= PUD_SIZE &&
660-
(gpa & (PUD_SIZE - PAGE_SIZE)) ==
661-
(hva & (PUD_SIZE - PAGE_SIZE))) {
662-
level = 2;
663-
pfn &= ~((PUD_SIZE >> PAGE_SHIFT) - 1);
664-
} else if (pte_size >= PMD_SIZE &&
665-
(gpa & (PMD_SIZE - PAGE_SIZE)) ==
666-
(hva & (PMD_SIZE - PAGE_SIZE))) {
667-
level = 1;
668-
pfn &= ~((PMD_SIZE >> PAGE_SHIFT) - 1);
669-
}
670-
}
671-
672656
/*
673-
* Compute the PTE value that we need to insert.
657+
* Read the PTE from the process' radix tree and use that
658+
* so we get the shift and attribute bits.
674659
*/
675-
if (page) {
676-
pgflags = _PAGE_READ | _PAGE_EXEC | _PAGE_PRESENT | _PAGE_PTE |
677-
_PAGE_ACCESSED;
678-
if (writing || upgrade_write)
679-
pgflags |= _PAGE_WRITE | _PAGE_DIRTY;
680-
pte = pfn_pte(pfn, __pgprot(pgflags));
681-
} else {
682-
/*
683-
* Read the PTE from the process' radix tree and use that
684-
* so we get the attribute bits.
685-
*/
686-
local_irq_disable();
687-
ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
688-
pte = *ptep;
660+
local_irq_disable();
661+
ptep = __find_linux_pte(vcpu->arch.pgdir, hva, NULL, &shift);
662+
/*
663+
* If the PTE disappeared temporarily due to a THP
664+
* collapse, just return and let the guest try again.
665+
*/
666+
if (!ptep) {
689667
local_irq_enable();
690-
if (shift == PUD_SHIFT &&
691-
(gpa & (PUD_SIZE - PAGE_SIZE)) ==
692-
(hva & (PUD_SIZE - PAGE_SIZE))) {
693-
level = 2;
694-
} else if (shift == PMD_SHIFT &&
695-
(gpa & (PMD_SIZE - PAGE_SIZE)) ==
696-
(hva & (PMD_SIZE - PAGE_SIZE))) {
697-
level = 1;
698-
} else if (shift && shift != PAGE_SHIFT) {
699-
/* Adjust PFN */
700-
unsigned long mask = (1ul << shift) - PAGE_SIZE;
701-
pte = __pte(pte_val(pte) | (hva & mask));
702-
}
703-
pte = __pte(pte_val(pte) | _PAGE_EXEC | _PAGE_ACCESSED);
704-
if (writing || upgrade_write) {
705-
if (pte_val(pte) & _PAGE_WRITE)
706-
pte = __pte(pte_val(pte) | _PAGE_DIRTY);
707-
} else {
708-
pte = __pte(pte_val(pte) & ~(_PAGE_WRITE | _PAGE_DIRTY));
668+
if (page)
669+
put_page(page);
670+
return RESUME_GUEST;
671+
}
672+
pte = *ptep;
673+
local_irq_enable();
674+
675+
/* Get pte level from shift/size */
676+
if (shift == PUD_SHIFT &&
677+
(gpa & (PUD_SIZE - PAGE_SIZE)) ==
678+
(hva & (PUD_SIZE - PAGE_SIZE))) {
679+
level = 2;
680+
} else if (shift == PMD_SHIFT &&
681+
(gpa & (PMD_SIZE - PAGE_SIZE)) ==
682+
(hva & (PMD_SIZE - PAGE_SIZE))) {
683+
level = 1;
684+
} else {
685+
level = 0;
686+
if (shift > PAGE_SHIFT) {
687+
/*
688+
* If the pte maps more than one page, bring over
689+
* bits from the virtual address to get the real
690+
* address of the specific single page we want.
691+
*/
692+
unsigned long rpnmask = (1ul << shift) - PAGE_SIZE;
693+
pte = __pte(pte_val(pte) | (hva & rpnmask));
709694
}
710695
}
711696

697+
pte = __pte(pte_val(pte) | _PAGE_EXEC | _PAGE_ACCESSED);
698+
if (writing || upgrade_write) {
699+
if (pte_val(pte) & _PAGE_WRITE)
700+
pte = __pte(pte_val(pte) | _PAGE_DIRTY);
701+
} else {
702+
pte = __pte(pte_val(pte) & ~(_PAGE_WRITE | _PAGE_DIRTY));
703+
}
704+
712705
/* Allocate space in the tree and write the PTE */
713706
ret = kvmppc_create_pte(kvm, pte, gpa, level, mmu_seq);
714707

0 commit comments

Comments
 (0)