Skip to content

Commit bcc0e65

Browse files
committed
Merge tag 'mips_fixes_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Paul Burton: "A few more MIPS fixes: - Fix a silly typo in virt_addr_valid which led to completely bogus behavior (that happened to stop tripping up hardened usercopy despite being broken). - Fix UART parity setup on AR933x systems. - A build fix for non-Linux build machines. - Have the 'all' make target build DTBs, primarily to fit in with the behavior of scripts/package/builddeb. - Handle an execution hazard in TLB exceptions that use KScratch registers, which could inadvertently clobber the $1 register on some generally higher-end out-of-order CPUs. - A MAINTAINERS update to fix the path to the NAND driver for Ingenic systems" * tag 'mips_fixes_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MAINTAINERS: Correct path to moved files MIPS: Add missing EHB in mtc0 -> mfc0 sequence. MIPS: have "plain" make calls build dtbs for selected platforms MIPS: fix build on non-linux hosts MIPS: ath79: fix ar933x uart parity mode MIPS: Fix bounds check virt_addr_valid
2 parents 2692982 + f2ff671 commit bcc0e65

File tree

7 files changed

+29
-15
lines changed

7 files changed

+29
-15
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7810,7 +7810,7 @@ INGENIC JZ4780 NAND DRIVER
78107810
M: Harvey Hunt <[email protected]>
78117811
78127812
S: Maintained
7813-
F: drivers/mtd/nand/raw/jz4780_*
7813+
F: drivers/mtd/nand/raw/ingenic/
78147814

78157815
INOTIFY
78167816
M: Jan Kara <[email protected]>

arch/mips/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ archscripts: scripts_basic
1717
$(Q)$(MAKE) $(build)=arch/mips/boot/tools relocs
1818

1919
KBUILD_DEFCONFIG := 32r2el_defconfig
20+
KBUILD_DTBS := dtbs
2021

2122
#
2223
# Select the object file format to substitute into the linker script.
@@ -384,7 +385,7 @@ quiet_cmd_64 = OBJCOPY $@
384385
vmlinux.64: vmlinux
385386
$(call cmd,64)
386387

387-
all: $(all-y)
388+
all: $(all-y) $(KBUILD_DTBS)
388389

389390
# boot
390391
$(boot-y): $(vmlinux-32) FORCE

arch/mips/boot/compressed/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
7878
$(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
7979
$(call if_changed,objcopy)
8080

81+
HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
82+
8183
# Calculate the load address of the compressed kernel image
8284
hostprogs-y := calc_vmlinuz_load_addr
8385

arch/mips/boot/compressed/calc_vmlinuz_load_addr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <stdint.h>
1010
#include <stdio.h>
1111
#include <stdlib.h>
12-
#include "../../../../include/linux/sizes.h"
12+
#include <linux/sizes.h>
1313

1414
int main(int argc, char *argv[])
1515
{

arch/mips/include/asm/mach-ath79/ar933x_uart.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#define AR933X_UART_CS_PARITY_S 0
2525
#define AR933X_UART_CS_PARITY_M 0x3
2626
#define AR933X_UART_CS_PARITY_NONE 0
27-
#define AR933X_UART_CS_PARITY_ODD 1
28-
#define AR933X_UART_CS_PARITY_EVEN 2
27+
#define AR933X_UART_CS_PARITY_ODD 2
28+
#define AR933X_UART_CS_PARITY_EVEN 3
2929
#define AR933X_UART_CS_IF_MODE_S 2
3030
#define AR933X_UART_CS_IF_MODE_M 0x3
3131
#define AR933X_UART_CS_IF_MODE_NONE 0

arch/mips/mm/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
203203

204204
bool __virt_addr_valid(const volatile void *kaddr)
205205
{
206-
unsigned long vaddr = (unsigned long)vaddr;
206+
unsigned long vaddr = (unsigned long)kaddr;
207207

208208
if ((vaddr < PAGE_OFFSET) || (vaddr >= MAP_BASE))
209209
return false;

arch/mips/mm/tlbex.c

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ static struct work_registers build_get_work_registers(u32 **p)
391391
static void build_restore_work_registers(u32 **p)
392392
{
393393
if (scratch_reg >= 0) {
394+
uasm_i_ehb(p);
394395
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
395396
return;
396397
}
@@ -668,10 +669,12 @@ static void build_restore_pagemask(u32 **p, struct uasm_reloc **r,
668669
uasm_i_mtc0(p, 0, C0_PAGEMASK);
669670
uasm_il_b(p, r, lid);
670671
}
671-
if (scratch_reg >= 0)
672+
if (scratch_reg >= 0) {
673+
uasm_i_ehb(p);
672674
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
673-
else
675+
} else {
674676
UASM_i_LW(p, 1, scratchpad_offset(0), 0);
677+
}
675678
} else {
676679
/* Reset default page size */
677680
if (PM_DEFAULT_MASK >> 16) {
@@ -938,10 +941,12 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
938941
uasm_i_jr(p, ptr);
939942

940943
if (mode == refill_scratch) {
941-
if (scratch_reg >= 0)
944+
if (scratch_reg >= 0) {
945+
uasm_i_ehb(p);
942946
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
943-
else
947+
} else {
944948
UASM_i_LW(p, 1, scratchpad_offset(0), 0);
949+
}
945950
} else {
946951
uasm_i_nop(p);
947952
}
@@ -1258,6 +1263,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
12581263
UASM_i_MTC0(p, odd, C0_ENTRYLO1); /* load it */
12591264

12601265
if (c0_scratch_reg >= 0) {
1266+
uasm_i_ehb(p);
12611267
UASM_i_MFC0(p, scratch, c0_kscratch(), c0_scratch_reg);
12621268
build_tlb_write_entry(p, l, r, tlb_random);
12631269
uasm_l_leave(l, *p);
@@ -1603,15 +1609,17 @@ static void build_setup_pgd(void)
16031609
uasm_i_dinsm(&p, a0, 0, 29, 64 - 29);
16041610
uasm_l_tlbl_goaround1(&l, p);
16051611
UASM_i_SLL(&p, a0, a0, 11);
1606-
uasm_i_jr(&p, 31);
16071612
UASM_i_MTC0(&p, a0, C0_CONTEXT);
1613+
uasm_i_jr(&p, 31);
1614+
uasm_i_ehb(&p);
16081615
} else {
16091616
/* PGD in c0_KScratch */
1610-
uasm_i_jr(&p, 31);
16111617
if (cpu_has_ldpte)
16121618
UASM_i_MTC0(&p, a0, C0_PWBASE);
16131619
else
16141620
UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg);
1621+
uasm_i_jr(&p, 31);
1622+
uasm_i_ehb(&p);
16151623
}
16161624
#else
16171625
#ifdef CONFIG_SMP
@@ -1625,13 +1633,16 @@ static void build_setup_pgd(void)
16251633
UASM_i_LA_mostly(&p, a2, pgdc);
16261634
UASM_i_SW(&p, a0, uasm_rel_lo(pgdc), a2);
16271635
#endif /* SMP */
1628-
uasm_i_jr(&p, 31);
16291636

16301637
/* if pgd_reg is allocated, save PGD also to scratch register */
1631-
if (pgd_reg != -1)
1638+
if (pgd_reg != -1) {
16321639
UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg);
1633-
else
1640+
uasm_i_jr(&p, 31);
1641+
uasm_i_ehb(&p);
1642+
} else {
1643+
uasm_i_jr(&p, 31);
16341644
uasm_i_nop(&p);
1645+
}
16351646
#endif
16361647
if (p >= (u32 *)tlbmiss_handler_setup_pgd_end)
16371648
panic("tlbmiss_handler_setup_pgd space exceeded");

0 commit comments

Comments
 (0)