Commit bca2a25d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sparc-for-6.10-tag1' of...

Merge tag 'sparc-for-6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc

Pull sparc updates from Andreas Larsson:

 - Avoid on-stack cpumask variables in a number of places

 - Move struct termio to asm/termios.h, matching other architectures and
   allowing certain user space applications to build also for sparc

 - Fix missing prototype warnings for sparc64

 - Fix version generation warnings for sparc32

 - Fix bug where non-consecutive CPU IDs lead to some CPUs not starting

 - Simplification using swap and cleanup using NULL for pointer

 - Convert sparc parport and chmc drivers to use remove callbacks
   returning void

* tag 'sparc-for-6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc:
  sparc/leon: Remove on-stack cpumask var
  sparc/pci_msi: Remove on-stack cpumask var
  sparc/of: Remove on-stack cpumask var
  sparc/irq: Remove on-stack cpumask var
  sparc/srmmu: Remove on-stack cpumask var
  sparc: chmc: Convert to platform remove callback returning void
  sparc: parport: Convert to platform remove callback returning void
  sparc: Compare pointers to NULL instead of 0
  sparc: Use swap() to fix Coccinelle warning
  sparc32: Fix version generation failed warnings
  sparc64: Fix number of online CPUs
  sparc64: Fix prototype warning for sched_clock
  sparc64: Fix prototype warnings in adi_64.c
  sparc64: Fix prototype warning for dma_4v_iotsb_bind
  sparc64: Fix prototype warning for uprobe_trap
  sparc64: Fix prototype warning for alloc_irqstack_bootmem
  sparc64: Fix prototype warning for vmemmap_free
  sparc64: Fix prototype warnings in traps_64.c
  sparc64: Fix prototype warning for init_vdso_image
  sparc: move struct termio to asm/termios.h
parents 2b7ced10 1c9e709c
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
* Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
#include <asm/xor.h> #include <linux/atomic.h>
#include <asm/checksum.h>
#include <asm/trap_block.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/ftrace.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/ftrace.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <linux/atomic.h> #include <asm/pgtable.h>
#include <asm/trap_block.h>
#include <asm/xor.h>
void *__memscan_zero(void *, size_t); void *__memscan_zero(void *, size_t);
void *__memscan_generic(void *, int, size_t); void *__memscan_generic(void *, int, size_t);
...@@ -23,3 +26,7 @@ void *memcpy(void *dest, const void *src, size_t n); ...@@ -23,3 +26,7 @@ void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n); void *memset(void *s, int c, size_t n);
typedef int TItype __attribute__((mode(TI))); typedef int TItype __attribute__((mode(TI)));
TItype __multi3(TItype a, TItype b); TItype __multi3(TItype a, TItype b);
s64 __ashldi3(s64, int);
s64 __lshrdi3(s64, int);
s64 __ashrdi3(s64, int);
...@@ -704,9 +704,7 @@ static unsigned long __init sun_floppy_init(void) ...@@ -704,9 +704,7 @@ static unsigned long __init sun_floppy_init(void)
ns87303_modify(config, ASC, ASC_DRV2_SEL, 0); ns87303_modify(config, ASC, ASC_DRV2_SEL, 0);
ns87303_modify(config, FCR, 0, FCR_LDE); ns87303_modify(config, FCR, 0, FCR_LDE);
config = sun_floppy_types[0]; swap(sun_floppy_types[0], sun_floppy_types[1]);
sun_floppy_types[0] = sun_floppy_types[1];
sun_floppy_types[1] = config;
if (sun_pci_broken_drive != -1) { if (sun_pci_broken_drive != -1) {
sun_pci_broken_drive = 1 - sun_pci_broken_drive; sun_pci_broken_drive = 1 - sun_pci_broken_drive;
......
...@@ -196,7 +196,7 @@ static int ecpp_probe(struct platform_device *op) ...@@ -196,7 +196,7 @@ static int ecpp_probe(struct platform_device *op)
return err; return err;
} }
static int ecpp_remove(struct platform_device *op) static void ecpp_remove(struct platform_device *op)
{ {
struct parport *p = dev_get_drvdata(&op->dev); struct parport *p = dev_get_drvdata(&op->dev);
int slot = p->dma; int slot = p->dma;
...@@ -216,8 +216,6 @@ static int ecpp_remove(struct platform_device *op) ...@@ -216,8 +216,6 @@ static int ecpp_remove(struct platform_device *op)
d_len); d_len);
clear_bit(slot, dma_slot_map); clear_bit(slot, dma_slot_map);
} }
return 0;
} }
static const struct of_device_id ecpp_match[] = { static const struct of_device_id ecpp_match[] = {
...@@ -245,7 +243,7 @@ static struct platform_driver ecpp_driver = { ...@@ -245,7 +243,7 @@ static struct platform_driver ecpp_driver = {
.of_match_table = ecpp_match, .of_match_table = ecpp_match,
}, },
.probe = ecpp_probe, .probe = ecpp_probe,
.remove = ecpp_remove, .remove_new = ecpp_remove,
}; };
static int parport_pc_find_nonpci_ports(int autoirq, int autodma) static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
......
...@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask); ...@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask);
int hard_smp_processor_id(void); int hard_smp_processor_id(void);
#define raw_smp_processor_id() (current_thread_info()->cpu) #define raw_smp_processor_id() (current_thread_info()->cpu)
void smp_fill_in_cpu_possible_map(void);
void smp_fill_in_sib_core_maps(void); void smp_fill_in_sib_core_maps(void);
void __noreturn cpu_play_dead(void); void __noreturn cpu_play_dead(void);
...@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu); ...@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu);
#define smp_fill_in_sib_core_maps() do { } while (0) #define smp_fill_in_sib_core_maps() do { } while (0)
#define smp_fetch_global_regs() do { } while (0) #define smp_fetch_global_regs() do { } while (0)
#define smp_fetch_global_pmu() do { } while (0) #define smp_fetch_global_pmu() do { } while (0)
#define smp_fill_in_cpu_possible_map() do { } while (0)
#define smp_init_cpu_poke() do { } while (0) #define smp_init_cpu_poke() do { } while (0)
#define scheduler_poke() do { } while (0) #define scheduler_poke() do { } while (0)
......
...@@ -10,16 +10,6 @@ typedef unsigned int tcflag_t; ...@@ -10,16 +10,6 @@ typedef unsigned int tcflag_t;
typedef unsigned long tcflag_t; typedef unsigned long tcflag_t;
#endif #endif
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#define NCCS 17 #define NCCS 17
struct termios { struct termios {
tcflag_t c_iflag; /* input mode flags */ tcflag_t c_iflag; /* input mode flags */
......
...@@ -40,5 +40,14 @@ struct winsize { ...@@ -40,5 +40,14 @@ struct winsize {
unsigned short ws_ypixel; unsigned short ws_ypixel;
}; };
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#endif /* _UAPI_SPARC_TERMIOS_H */ #endif /* _UAPI_SPARC_TERMIOS_H */
...@@ -121,9 +121,9 @@ void __init mdesc_adi_init(void) ...@@ -121,9 +121,9 @@ void __init mdesc_adi_init(void)
mdesc_release(hp); mdesc_release(hp);
} }
tag_storage_desc_t *find_tag_store(struct mm_struct *mm, static tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
struct vm_area_struct *vma, struct vm_area_struct *vma,
unsigned long addr) unsigned long addr)
{ {
tag_storage_desc_t *tag_desc = NULL; tag_storage_desc_t *tag_desc = NULL;
unsigned long i, max_desc, flags; unsigned long i, max_desc, flags;
...@@ -153,9 +153,9 @@ tag_storage_desc_t *find_tag_store(struct mm_struct *mm, ...@@ -153,9 +153,9 @@ tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
return tag_desc; return tag_desc;
} }
tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm, static tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
struct vm_area_struct *vma, struct vm_area_struct *vma,
unsigned long addr) unsigned long addr)
{ {
unsigned char *tags; unsigned char *tags;
unsigned long i, size, max_desc, flags; unsigned long i, size, max_desc, flags;
...@@ -296,7 +296,7 @@ tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm, ...@@ -296,7 +296,7 @@ tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
return tag_desc; return tag_desc;
} }
void del_tag_store(tag_storage_desc_t *tag_desc, struct mm_struct *mm) static void del_tag_store(tag_storage_desc_t *tag_desc, struct mm_struct *mm)
{ {
unsigned long flags; unsigned long flags;
unsigned char *tags = NULL; unsigned char *tags = NULL;
......
...@@ -788,7 +788,7 @@ static void jbusmc_destroy(struct platform_device *op, struct jbusmc *p) ...@@ -788,7 +788,7 @@ static void jbusmc_destroy(struct platform_device *op, struct jbusmc *p)
kfree(p); kfree(p);
} }
static int us3mc_remove(struct platform_device *op) static void us3mc_remove(struct platform_device *op)
{ {
void *p = dev_get_drvdata(&op->dev); void *p = dev_get_drvdata(&op->dev);
...@@ -798,7 +798,6 @@ static int us3mc_remove(struct platform_device *op) ...@@ -798,7 +798,6 @@ static int us3mc_remove(struct platform_device *op)
else if (mc_type == MC_TYPE_JBUS) else if (mc_type == MC_TYPE_JBUS)
jbusmc_destroy(op, p); jbusmc_destroy(op, p);
} }
return 0;
} }
static const struct of_device_id us3mc_match[] = { static const struct of_device_id us3mc_match[] = {
...@@ -815,7 +814,7 @@ static struct platform_driver us3mc_driver = { ...@@ -815,7 +814,7 @@ static struct platform_driver us3mc_driver = {
.of_match_table = us3mc_match, .of_match_table = us3mc_match,
}, },
.probe = us3mc_probe, .probe = us3mc_probe,
.remove = us3mc_remove, .remove_new = us3mc_remove,
}; };
static inline bool us3mc_platform(void) static inline bool us3mc_platform(void)
......
...@@ -349,17 +349,13 @@ static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid) ...@@ -349,17 +349,13 @@ static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
static int irq_choose_cpu(unsigned int irq, const struct cpumask *affinity) static int irq_choose_cpu(unsigned int irq, const struct cpumask *affinity)
{ {
cpumask_t mask;
int cpuid; int cpuid;
cpumask_copy(&mask, affinity); if (cpumask_equal(affinity, cpu_online_mask)) {
if (cpumask_equal(&mask, cpu_online_mask)) {
cpuid = map_to_cpu(irq); cpuid = map_to_cpu(irq);
} else { } else {
cpumask_t tmp; cpuid = cpumask_first_and(affinity, cpu_online_mask);
cpuid = cpuid < nr_cpu_ids ? cpuid : map_to_cpu(irq);
cpumask_and(&tmp, cpu_online_mask, &mask);
cpuid = cpumask_empty(&tmp) ? map_to_cpu(irq) : cpumask_first(&tmp);
} }
return cpuid; return cpuid;
......
...@@ -40,6 +40,10 @@ int handle_popc(u32 insn, struct pt_regs *regs); ...@@ -40,6 +40,10 @@ int handle_popc(u32 insn, struct pt_regs *regs);
void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
/* uprobes.c */
asmlinkage void uprobe_trap(struct pt_regs *regs,
unsigned long trap_level);
/* smp_64.c */ /* smp_64.c */
void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs); void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);
void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs); void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs);
......
...@@ -106,13 +106,12 @@ unsigned long leon_get_irqmask(unsigned int irq) ...@@ -106,13 +106,12 @@ unsigned long leon_get_irqmask(unsigned int irq)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
static int irq_choose_cpu(const struct cpumask *affinity) static int irq_choose_cpu(const struct cpumask *affinity)
{ {
cpumask_t mask; unsigned int cpu = cpumask_first_and(affinity, cpu_online_mask);
cpumask_and(&mask, cpu_online_mask, affinity); if (cpumask_subset(cpu_online_mask, affinity) || cpu >= nr_cpu_ids)
if (cpumask_equal(&mask, cpu_online_mask) || cpumask_empty(&mask))
return boot_cpu_id; return boot_cpu_id;
else else
return cpumask_first(&mask); return cpu;
} }
#else #else
#define irq_choose_cpu(affinity) boot_cpu_id #define irq_choose_cpu(affinity) boot_cpu_id
......
...@@ -624,10 +624,7 @@ static unsigned int __init build_one_device_irq(struct platform_device *op, ...@@ -624,10 +624,7 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
out: out:
nid = of_node_to_nid(dp); nid = of_node_to_nid(dp);
if (nid != -1) { if (nid != -1) {
cpumask_t numa_mask; irq_set_affinity(irq, cpumask_of_node(nid));
cpumask_copy(&numa_mask, cpumask_of_node(nid));
irq_set_affinity(irq, &numa_mask);
} }
return irq; return irq;
......
...@@ -287,10 +287,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm, ...@@ -287,10 +287,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm,
nid = pbm->numa_node; nid = pbm->numa_node;
if (nid != -1) { if (nid != -1) {
cpumask_t numa_mask; irq_set_affinity(irq, cpumask_of_node(nid));
cpumask_copy(&numa_mask, cpumask_of_node(nid));
irq_set_affinity(irq, &numa_mask);
} }
err = request_irq(irq, sparc64_msiq_interrupt, 0, err = request_irq(irq, sparc64_msiq_interrupt, 0,
"MSIQ", "MSIQ",
......
...@@ -256,9 +256,9 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size, ...@@ -256,9 +256,9 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
return NULL; return NULL;
} }
unsigned long dma_4v_iotsb_bind(unsigned long devhandle, static unsigned long dma_4v_iotsb_bind(unsigned long devhandle,
unsigned long iotsb_num, unsigned long iotsb_num,
struct pci_bus *bus_dev) struct pci_bus *bus_dev)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
unsigned long err; unsigned long err;
......
...@@ -483,7 +483,9 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg) ...@@ -483,7 +483,9 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg)
ncpus_probed++; ncpus_probed++;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
set_cpu_present(cpuid, true); set_cpu_present(cpuid, true);
set_cpu_possible(cpuid, true);
if (num_possible_cpus() < nr_cpu_ids)
set_cpu_possible(cpuid, true);
#endif #endif
return NULL; return NULL;
} }
......
...@@ -599,7 +599,7 @@ static void __init init_sparc64_elf_hwcap(void) ...@@ -599,7 +599,7 @@ static void __init init_sparc64_elf_hwcap(void)
pause_patch(); pause_patch();
} }
void __init alloc_irqstack_bootmem(void) static void __init alloc_irqstack_bootmem(void)
{ {
unsigned int i, node; unsigned int i, node;
...@@ -671,7 +671,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -671,7 +671,6 @@ void __init setup_arch(char **cmdline_p)
paging_init(); paging_init();
init_sparc64_elf_hwcap(); init_sparc64_elf_hwcap();
smp_fill_in_cpu_possible_map();
/* /*
* Once the OF device tree and MDESC have been setup and nr_cpus has * Once the OF device tree and MDESC have been setup and nr_cpus has
* been parsed, we know the list of possible cpus. Therefore we can * been parsed, we know the list of possible cpus. Therefore we can
......
...@@ -1216,20 +1216,6 @@ void __init smp_setup_processor_id(void) ...@@ -1216,20 +1216,6 @@ void __init smp_setup_processor_id(void)
xcall_deliver_impl = hypervisor_xcall_deliver; xcall_deliver_impl = hypervisor_xcall_deliver;
} }
void __init smp_fill_in_cpu_possible_map(void)
{
int possible_cpus = num_possible_cpus();
int i;
if (possible_cpus > nr_cpu_ids)
possible_cpus = nr_cpu_ids;
for (i = 0; i < possible_cpus; i++)
set_cpu_possible(i, true);
for (; i < NR_CPUS; i++)
set_cpu_possible(i, false);
}
void smp_fill_in_sib_core_maps(void) void smp_fill_in_sib_core_maps(void)
{ {
unsigned int i; unsigned int i;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/sched/clock.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <asm/oplib.h> #include <asm/oplib.h>
......
...@@ -250,7 +250,7 @@ void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, u ...@@ -250,7 +250,7 @@ void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, u
sun4v_insn_access_exception(regs, addr, type_ctx); sun4v_insn_access_exception(regs, addr, type_ctx);
} }
bool is_no_fault_exception(struct pt_regs *regs) static bool is_no_fault_exception(struct pt_regs *regs)
{ {
unsigned char asi; unsigned char asi;
u32 insn; u32 insn;
...@@ -2032,7 +2032,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, ...@@ -2032,7 +2032,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
/* Handle memory corruption detected error which is vectored in /* Handle memory corruption detected error which is vectored in
* through resumable error trap. * through resumable error trap.
*/ */
void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent) static void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
{ {
if (notify_die(DIE_TRAP, "MCD error", regs, 0, 0x34, if (notify_die(DIE_TRAP, "MCD error", regs, 0, 0x34,
SIGSEGV) == NOTIFY_STOP) SIGSEGV) == NOTIFY_STOP)
...@@ -2150,9 +2150,9 @@ static unsigned long sun4v_get_vaddr(struct pt_regs *regs) ...@@ -2150,9 +2150,9 @@ static unsigned long sun4v_get_vaddr(struct pt_regs *regs)
/* Attempt to handle non-resumable errors generated from userspace. /* Attempt to handle non-resumable errors generated from userspace.
* Returns true if the signal was handled, false otherwise. * Returns true if the signal was handled, false otherwise.
*/ */
bool sun4v_nonresum_error_user_handled(struct pt_regs *regs, static bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
struct sun4v_error_entry *ent) { struct sun4v_error_entry *ent)
{
unsigned int attrs = ent->err_attrs; unsigned int attrs = ent->err_attrs;
if (attrs & SUN4V_ERR_ATTRS_MEMORY) { if (attrs & SUN4V_ERR_ATTRS_MEMORY) {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include "kernel.h"
/* Compute the address of the breakpoint instruction and return it. /* Compute the address of the breakpoint instruction and return it.
* *
* Note that uprobe_get_swbp_addr is defined as a weak symbol in * Note that uprobe_get_swbp_addr is defined as a weak symbol in
......
...@@ -2640,11 +2640,6 @@ int __meminit vmemmap_populate(unsigned long vstart, unsigned long vend, ...@@ -2640,11 +2640,6 @@ int __meminit vmemmap_populate(unsigned long vstart, unsigned long vend,
return 0; return 0;
} }
void vmemmap_free(unsigned long start, unsigned long end,
struct vmem_altmap *altmap)
{
}
#endif /* CONFIG_SPARSEMEM_VMEMMAP */ #endif /* CONFIG_SPARSEMEM_VMEMMAP */
/* These are actually filled in at boot time by sun4{u,v}_pgprot_init() */ /* These are actually filled in at boot time by sun4{u,v}_pgprot_init() */
......
...@@ -1653,13 +1653,15 @@ static void smp_flush_tlb_all(void) ...@@ -1653,13 +1653,15 @@ static void smp_flush_tlb_all(void)
local_ops->tlb_all(); local_ops->tlb_all();
} }
static bool any_other_mm_cpus(struct mm_struct *mm)
{
return cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids;
}
static void smp_flush_cache_mm(struct mm_struct *mm) static void smp_flush_cache_mm(struct mm_struct *mm)
{ {
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc1(local_ops->cache_mm, (unsigned long)mm); xc1(local_ops->cache_mm, (unsigned long)mm);
local_ops->cache_mm(mm); local_ops->cache_mm(mm);
} }
...@@ -1668,10 +1670,7 @@ static void smp_flush_cache_mm(struct mm_struct *mm) ...@@ -1668,10 +1670,7 @@ static void smp_flush_cache_mm(struct mm_struct *mm)
static void smp_flush_tlb_mm(struct mm_struct *mm) static void smp_flush_tlb_mm(struct mm_struct *mm)
{ {
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm)) {
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask)) {
xc1(local_ops->tlb_mm, (unsigned long)mm); xc1(local_ops->tlb_mm, (unsigned long)mm);
if (atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) if (atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
cpumask_copy(mm_cpumask(mm), cpumask_copy(mm_cpumask(mm),
...@@ -1688,10 +1687,7 @@ static void smp_flush_cache_range(struct vm_area_struct *vma, ...@@ -1688,10 +1687,7 @@ static void smp_flush_cache_range(struct vm_area_struct *vma,
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc3(local_ops->cache_range, (unsigned long)vma, start, xc3(local_ops->cache_range, (unsigned long)vma, start,
end); end);
local_ops->cache_range(vma, start, end); local_ops->cache_range(vma, start, end);
...@@ -1705,10 +1701,7 @@ static void smp_flush_tlb_range(struct vm_area_struct *vma, ...@@ -1705,10 +1701,7 @@ static void smp_flush_tlb_range(struct vm_area_struct *vma,
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc3(local_ops->tlb_range, (unsigned long)vma, start, xc3(local_ops->tlb_range, (unsigned long)vma, start,
end); end);
local_ops->tlb_range(vma, start, end); local_ops->tlb_range(vma, start, end);
...@@ -1720,10 +1713,7 @@ static void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) ...@@ -1720,10 +1713,7 @@ static void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page)
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc2(local_ops->cache_page, (unsigned long)vma, page); xc2(local_ops->cache_page, (unsigned long)vma, page);
local_ops->cache_page(vma, page); local_ops->cache_page(vma, page);
} }
...@@ -1734,10 +1724,7 @@ static void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) ...@@ -1734,10 +1724,7 @@ static void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
if (mm->context != NO_CONTEXT) { if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc2(local_ops->tlb_page, (unsigned long)vma, page); xc2(local_ops->tlb_page, (unsigned long)vma, page);
local_ops->tlb_page(vma, page); local_ops->tlb_page(vma, page);
} }
...@@ -1759,10 +1746,7 @@ static void smp_flush_page_to_ram(unsigned long page) ...@@ -1759,10 +1746,7 @@ static void smp_flush_page_to_ram(unsigned long page)
static void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) static void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
{ {
cpumask_t cpu_mask; if (any_other_mm_cpus(mm))
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
if (!cpumask_empty(&cpu_mask))
xc2(local_ops->sig_insns, (unsigned long)mm, insn_addr); xc2(local_ops->sig_insns, (unsigned long)mm, insn_addr);
local_ops->sig_insns(mm, insn_addr); local_ops->sig_insns(mm, insn_addr);
} }
......
...@@ -332,7 +332,7 @@ prom_setprop(phandle node, const char *pname, char *value, int size) ...@@ -332,7 +332,7 @@ prom_setprop(phandle node, const char *pname, char *value, int size)
if (size == 0) if (size == 0)
return 0; return 0;
if ((pname == 0) || (value == 0)) if ((pname == NULL) || (value == NULL))
return 0; return 0;
#ifdef CONFIG_SUN_LDOMS #ifdef CONFIG_SUN_LDOMS
......
...@@ -243,8 +243,9 @@ static int stick_patch(const struct vdso_image *image, struct vdso_elfinfo *e, b ...@@ -243,8 +243,9 @@ static int stick_patch(const struct vdso_image *image, struct vdso_elfinfo *e, b
* Allocate pages for the vdso and vvar, and copy in the vdso text from the * Allocate pages for the vdso and vvar, and copy in the vdso text from the
* kernel image. * kernel image.
*/ */
int __init init_vdso_image(const struct vdso_image *image, static int __init init_vdso_image(const struct vdso_image *image,
struct vm_special_mapping *vdso_mapping, bool elf64) struct vm_special_mapping *vdso_mapping,
bool elf64)
{ {
int cnpages = (image->size) / PAGE_SIZE; int cnpages = (image->size) / PAGE_SIZE;
struct page *dp, **dpp = NULL; struct page *dp, **dpp = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment