Skip to content

Commit

Permalink
Merge tag 'mips_fixes_5.2_1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/mips/linux

Pull MIPS fixes from Paul Burton:

 - Declare ginvt() __always_inline due to its use of an argument as an
   inline asm immediate.

 - A VDSO build fix following Kbuild changes made this cycle.

 - A fix for boot failures on txx9 systems following memory
   initialization changes made this cycle.

 - Bounds check virt_addr_valid() to prevent it spuriously indicating
   that bogus addresses are valid, in turn fixing hardened usercopy
   failures that have been present since v4.12.

 - Build uImage.gz for pistachio systems by default, since this is the
   image we need in order to actually boot on a board.

 - Remove an unused variable in our uprobes code.

* tag 'mips_fixes_5.2_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: uprobes: remove set but not used variable 'epc'
  MIPS: pistachio: Build uImage.gz by default
  MIPS: Make virt_addr_valid() return bool
  MIPS: Bounds check virt_addr_valid
  MIPS: TXx9: Fix boot crash in free_initmem()
  MIPS: remove a space after -I to cope with header search paths for VDSO
  MIPS: mark ginvt() as __always_inline
  • Loading branch information
Linus Torvalds committed Jun 8, 2019
2 parents 9331b67 + f532bee commit d0cc617
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/ginvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _ASM_MACRO_1R1I(ginvt, rs, type,
# define _ASM_SET_GINV
#endif

static inline void ginvt(unsigned long addr, enum ginvt_type type)
static __always_inline void ginvt(unsigned long addr, enum ginvt_type type)
{
asm volatile(
".set push\n"
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static inline int pfn_valid(unsigned long pfn)
#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))

extern int __virt_addr_valid(const volatile void *kaddr);
extern bool __virt_addr_valid(const volatile void *kaddr);
#define virt_addr_valid(kaddr) \
__virt_addr_valid((const volatile void *) (kaddr))

Expand Down
3 changes: 0 additions & 3 deletions arch/mips/kernel/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs)
*/
aup->resume_epc = regs->cp0_epc + 4;
if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) {
unsigned long epc;

epc = regs->cp0_epc;
__compute_return_epc_for_insn(regs,
(union mips_instruction) aup->insn[0]);
aup->resume_epc = regs->cp0_epc;
Expand Down
7 changes: 6 additions & 1 deletion arch/mips/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,13 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
return ret;
}

int __virt_addr_valid(const volatile void *kaddr)
bool __virt_addr_valid(const volatile void *kaddr)
{
unsigned long vaddr = (unsigned long)vaddr;

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

return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
}
EXPORT_SYMBOL_GPL(__virt_addr_valid);
1 change: 1 addition & 0 deletions arch/mips/pistachio/Platform
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ cflags-$(CONFIG_MACH_PISTACHIO) += \
-I$(srctree)/arch/mips/include/asm/mach-pistachio
load-$(CONFIG_MACH_PISTACHIO) += 0xffffffff80400000
zload-$(CONFIG_MACH_PISTACHIO) += 0xffffffff81000000
all-$(CONFIG_MACH_PISTACHIO) := uImage.gz
2 changes: 1 addition & 1 deletion arch/mips/pnx833x/Platform
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NXP STB225
platform-$(CONFIG_SOC_PNX833X) += pnx833x/
cflags-$(CONFIG_SOC_PNX833X) += -I $(srctree)/arch/mips/include/asm/mach-pnx833x
cflags-$(CONFIG_SOC_PNX833X) += -I$(srctree)/arch/mips/include/asm/mach-pnx833x
load-$(CONFIG_NXP_STB220) += 0xffffffff80001000
load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
6 changes: 0 additions & 6 deletions arch/mips/txx9/generic/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <asm/time.h>
#include <asm/reboot.h>
#include <asm/r4kcache.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/pci.h>
Expand Down Expand Up @@ -343,11 +342,6 @@ void __init prom_init(void)

void __init prom_free_prom_memory(void)
{
unsigned long saddr = PAGE_SIZE;
unsigned long eaddr = __pa_symbol(&_text);

if (saddr < eaddr)
free_init_pages("prom memory", saddr, eaddr);
}

const char *get_system_type(void)
Expand Down

0 comments on commit d0cc617

Please sign in to comment.