Skip to content

Commit 9f47112

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "A fair number of build fixes for various configurations. Fixes to BPF, and the BCM47xx platform code, a preemption fix for the Loongson core, a syscall auditing fix, wire up the new getrandom and memfd_create. Several patches for EVA" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (30 commits) MIPS: SmartMIPS: Disable assembler warnings MIPS: Move CPU topology macros to topology.h MIPS: Wire up new syscalls getrandom and memfd_create. MIPS: Fix a warning for virt_to_page arch/mips/net/bpf_jit.c: fix failure check MIPS: COP2: CPP macro safety fixes. MIPS: Kconfig: Select SMP symbols for CMP MIPS: ZBOOT: add missing <linux/string.h> include MIPS: IP28: Fix/clean spaces.h MIPS: IP28: Select correct L1_CACHE_SHIFT MIPS: BCM63xx: delete double assignment MIPS: Spelling s/confugrations/configurations/ MIPS: OCTEON: make get_system_type() thread-safe MIPS: CPS: Initialize EVA before bringing up VPEs from secondary cores MIPS: Malta: EVA: Rename 'eva_entry' to 'platform_eva_init' MIPS: EVA: Add new EVA header MIPS: scall64-o32: Fix indirect syscall detection MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64 MIPS: Loongson: Fix COP2 usage for preemptible kernel MIPS: NL: Fix nlm_xlp_defconfig build error ...
2 parents d9773ce + dab1b44 commit 9f47112

17 files changed

Lines changed: 67 additions & 38 deletions

File tree

‎arch/mips/Kconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ config SGI_IP28
546546
# select SYS_HAS_EARLY_PRINTK
547547
select SYS_SUPPORTS_64BIT_KERNEL
548548
select SYS_SUPPORTS_BIG_ENDIAN
549+
select MIPS_L1_CACHE_SHIFT_7
549550
help
550551
This is the SGI Indigo2 with R10000 processor. To compile a Linux
551552
kernel that runs on these, say Y here.
@@ -2029,7 +2030,9 @@ config MIPS_CMP
20292030
bool "MIPS CMP framework support (DEPRECATED)"
20302031
depends on SYS_SUPPORTS_MIPS_CMP
20312032
select MIPS_GIC_IPI
2033+
select SMP
20322034
select SYNC_R4K
2035+
select SYS_SUPPORTS_SMP
20332036
select WEAK_ORDERING
20342037
default n
20352038
help

‎arch/mips/Makefile‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
113113
cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
114114
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
115115

116-
cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips)
116+
# For smartmips configurations, there are hundreds of warnings due to ISA overrides
117+
# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
118+
# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
119+
# similar directives in the kernel will spam the build logs with the following warnings:
120+
# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
121+
# or
122+
# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
123+
# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
124+
# been fixed properly.
125+
cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn
117126
cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
118127

119128
cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \

‎arch/mips/bcm63xx/irq.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
434434
irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
435435
irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
436436
irq_stat_addr[1] = 0;
437-
irq_stat_addr[1] = 0;
437+
irq_mask_addr[1] = 0;
438438
irq_bits = 32;
439439
ext_irq_count = 4;
440440
ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
443443
irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
444444
irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
445445
irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
446-
irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
446+
irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
447447
irq_bits = 64;
448448
ext_irq_count = 4;
449449
is_ext_irq_cascaded = 1;

‎arch/mips/boot/compressed/decompress.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/types.h>
1515
#include <linux/kernel.h>
16+
#include <linux/string.h>
1617

1718
#include <asm/addrspace.h>
1819

‎arch/mips/include/asm/cop2.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
extern void octeon_cop2_save(struct octeon_cop2_state *);
1717
extern void octeon_cop2_restore(struct octeon_cop2_state *);
1818

19-
#define cop2_save(r) octeon_cop2_save(r)
20-
#define cop2_restore(r) octeon_cop2_restore(r)
19+
#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2)
20+
#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2)
2121

2222
#define cop2_present 1
2323
#define cop2_lazy_restore 1
@@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *);
2626

2727
extern void nlm_cop2_save(struct nlm_cop2_state *);
2828
extern void nlm_cop2_restore(struct nlm_cop2_state *);
29-
#define cop2_save(r) nlm_cop2_save(r)
30-
#define cop2_restore(r) nlm_cop2_restore(r)
29+
30+
#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2)
31+
#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2)
3132

3233
#define cop2_present 1
3334
#define cop2_lazy_restore 0
3435

3536
#elif defined(CONFIG_CPU_LOONGSON3)
3637

37-
#define cop2_save(r)
38-
#define cop2_restore(r)
39-
4038
#define cop2_present 1
4139
#define cop2_lazy_restore 1
40+
#define cop2_save(r) do { (r); } while (0)
41+
#define cop2_restore(r) do { (r); } while (0)
4242

4343
#else
4444

4545
#define cop2_present 0
4646
#define cop2_lazy_restore 0
47-
#define cop2_save(r)
48-
#define cop2_restore(r)
47+
#define cop2_save(r) do { (r); } while (0)
48+
#define cop2_restore(r) do { (r); } while (0)
4949
#endif
5050

5151
enum cu2_ops {

‎arch/mips/include/asm/mach-ip28/spaces.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@
1111
#ifndef _ASM_MACH_IP28_SPACES_H
1212
#define _ASM_MACH_IP28_SPACES_H
1313

14-
#define CAC_BASE _AC(0xa800000000000000, UL)
15-
16-
#define HIGHMEM_START (~0UL)
17-
1814
#define PHYS_OFFSET _AC(0x20000000, UL)
1915

20-
#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */
21-
#define IO_BASE UNCAC_BASE
22-
2316
#include <asm/mach-generic/spaces.h>
2417

2518
#endif /* _ASM_MACH_IP28_SPACES_H */

‎arch/mips/include/asm/page.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
/*
3939
* This is used for calculating the real page sizes
40-
* for FTLB or VTLB + FTLB confugrations.
40+
* for FTLB or VTLB + FTLB configurations.
4141
*/
4242
static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
4343
{
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn)
223223

224224
#endif
225225

226-
#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
226+
#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
227+
(kaddr))))
227228

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

‎arch/mips/include/asm/smp.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS];
3737

3838
#define NO_PROC_ID (-1)
3939

40-
#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
41-
#define topology_core_id(cpu) (cpu_data[cpu].core)
42-
#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
43-
#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
44-
4540
#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
4641
#define SMP_CALL_FUNCTION 0x2
4742
/* Octeon - Tell another core to flush its icache */

‎arch/mips/include/asm/switch_to.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ do { \
9292
KSTK_STATUS(prev) &= ~ST0_CU2; \
9393
__c0_stat = read_c0_status(); \
9494
write_c0_status(__c0_stat | ST0_CU2); \
95-
cop2_save(&prev->thread.cp2); \
95+
cop2_save(prev); \
9696
write_c0_status(__c0_stat & ~ST0_CU2); \
9797
} \
9898
__clear_software_ll_bit(); \
@@ -111,7 +111,7 @@ do { \
111111
(KSTK_STATUS(current) & ST0_CU2)) { \
112112
__c0_stat = read_c0_status(); \
113113
write_c0_status(__c0_stat | ST0_CU2); \
114-
cop2_restore(&current->thread.cp2); \
114+
cop2_restore(current); \
115115
write_c0_status(__c0_stat & ~ST0_CU2); \
116116
} \
117117
if (cpu_has_dsp) \

‎arch/mips/include/asm/topology.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@
99
#define __ASM_TOPOLOGY_H
1010

1111
#include <topology.h>
12+
#include <linux/smp.h>
13+
14+
#ifdef CONFIG_SMP
15+
#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
16+
#define topology_core_id(cpu) (cpu_data[cpu].core)
17+
#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
18+
#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
19+
#endif
1220

1321
#endif /* __ASM_TOPOLOGY_H */

0 commit comments

Comments
 (0)