summaryrefslogtreecommitdiff
path: root/arch/sparc/include
diff options
context:
space:
mode:
authorBlagovest Kolenichev <bkolenichev@codeaurora.org>2017-06-15 07:41:05 -0700
committerBlagovest Kolenichev <bkolenichev@codeaurora.org>2017-06-20 14:55:15 -0700
commite0a0b484bf394e1f5e5ecf48ec9af7d57bcd8083 (patch)
treed33e1cf36a7b17cc80323ed65271c1c9b5d437e5 /arch/sparc/include
parentc5f247dd6d415e5f4b7613d0234a311b81354ee9 (diff)
parente76c0faf1125158db59feaa88b16923c9a0e580e (diff)
Merge branch 'android-4.4@e76c0fa' into branch 'msm-4.4'
* refs/heads/tmp-e76c0fa Linux 4.4.72 arm64: ensure extension of smp_store_release value arm64: armv8_deprecated: ensure extension of addr usercopy: Adjust tests to deal with SMAP/PAN RDMA/qib,hfi1: Fix MR reference count leak on write with immediate arm64: entry: improve data abort handling of tagged pointers arm64: hw_breakpoint: fix watchpoint matching for tagged pointers Make __xfs_xattr_put_listen preperly report errors. NFSv4: Don't perform cached access checks before we've OPENed the file NFS: Ensure we revalidate attributes before using execute_ok() mm: consider memblock reservations for deferred memory initialization sizing net: better skb->sender_cpu and skb->napi_id cohabitation serial: sh-sci: Fix panic when serial console and DMA are enabled tty: Drop krefs for interrupted tty lock drivers: char: mem: Fix wraparound check to allow mappings up to the end ASoC: Fix use-after-free at card unregistration ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT ALSA: timer: Fix race between read and ioctl drm/nouveau/tmr: fully separate alarm execution/pending lists drm/vmwgfx: Make sure backup_handle is always valid drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() perf/core: Drop kernel samples even though :u is specified powerpc/hotplug-mem: Fix missing endian conversion of aa_index powerpc/numa: Fix percpu allocations to be NUMA aware powerpc/eeh: Avoid use after free in eeh_handle_special_event() scsi: qla2xxx: don't disable a not previously enabled PCI device KVM: arm/arm64: Handle possible NULL stage2 pud when ageing pages btrfs: fix memory leak in update_space_info failure path btrfs: use correct types for page indices in btrfs_page_exists_in_range cxl: Fix error path on bad ioctl ufs_getfrag_block(): we only grab ->truncate_mutex on block creation path ufs_extend_tail(): fix the braino in calling conventions of ufs_new_fragments() ufs: set correct ->s_maxsize ufs: restore maintaining ->i_blocks fix ufs_isblockset() ufs: restore proper tail allocation fs: add i_blocksize() cpuset: consider dying css as offline Input: elantech - add Fujitsu Lifebook E546/E557 to force crc_enabled drm/msm: Expose our reservation object when exporting a dmabuf. target: Re-add check to reject control WRITEs with overflow data cpufreq: cpufreq_register_driver() should return -ENODEV if init fails stackprotector: Increase the per-task stack canary's random range from 32 bits to 64 bits on 64-bit platforms random: properly align get_random_int_hash drivers: char: random: add get_random_long() iio: proximity: as3935: fix AS3935_INT mask iio: light: ltr501 Fix interchanged als/ps register field staging/lustre/lov: remove set_fs() call from lov_getstripe() usb: chipidea: debug: check before accessing ci_role usb: chipidea: udc: fix NULL pointer dereference if udc_start failed usb: gadget: f_mass_storage: Serialize wake and sleep execution ext4: fix fdatasync(2) after extent manipulation operations ext4: keep existing extra fields when inode expands ext4: fix SEEK_HOLE xen-netfront: cast grant table reference first to type int xen-netfront: do not cast grant table reference to signed short xen/privcmd: Support correctly 64KB page granularity when mapping memory dmaengine: ep93xx: Always start from BASE0 dmaengine: usb-dmac: Fix DMAOR AE bit definition KVM: async_pf: avoid async pf injection when in guest mode arm: KVM: Allow unaligned accesses at HYP KVM: cpuid: Fix read/write out-of-bounds vulnerability in cpuid emulation kvm: async_pf: fix rcu_irq_enter() with irqs enabled nfsd: Fix up the "supattr_exclcreat" attributes nfsd4: fix null dereference on replay drm/amdgpu/ci: disable mclk switching for high refresh rates (v2) crypto: gcm - wait for crypto op not signal safe KEYS: fix freeing uninitialized memory in key_update() KEYS: fix dereferencing NULL payload with nonzero length ptrace: Properly initialize ptracer_cred on fork serial: ifx6x60: fix use-after-free on module unload arch/sparc: support NR_CPUS = 4096 sparc64: delete old wrap code sparc64: new context wrap sparc64: add per-cpu mm of secondary contexts sparc64: redefine first version sparc64: combine activate_mm and switch_mm sparc64: reset mm cpumask after wrap sparc: Machine description indices can vary sparc64: mm: fix copy_tsb to correctly copy huge page TSBs net: bridge: start hello timer only if device is up net: ethoc: enable NAPI before poll may be scheduled net: ping: do not abuse udp_poll() ipv6: Fix leak in ipv6_gso_segment(). vxlan: fix use-after-free on deletion tcp: disallow cwnd undo when switching congestion control cxgb4: avoid enabling napi twice to the same queue ipv6: xfrm: Handle errors reported by xfrm6_find_1stfragopt() bnx2x: Fix Multi-Cos ANDROID: uid_sys_stats: check previous uid_entry before call find_or_register_uid ANDROID: sdcardfs: d_splice_alias can return error values Change-Id: I829ebf1a9271dcf0462c537e7bfcbcfde322f336 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Diffstat (limited to 'arch/sparc/include')
-rw-r--r--arch/sparc/include/asm/mmu_64.h2
-rw-r--r--arch/sparc/include/asm/mmu_context_64.h32
-rw-r--r--arch/sparc/include/asm/pil.h1
-rw-r--r--arch/sparc/include/asm/vio.h1
4 files changed, 6 insertions, 30 deletions
diff --git a/arch/sparc/include/asm/mmu_64.h b/arch/sparc/include/asm/mmu_64.h
index f7de0dbc38af..83b36a5371ff 100644
--- a/arch/sparc/include/asm/mmu_64.h
+++ b/arch/sparc/include/asm/mmu_64.h
@@ -52,7 +52,7 @@
#define CTX_NR_MASK TAG_CONTEXT_BITS
#define CTX_HW_MASK (CTX_NR_MASK | CTX_PGSZ_MASK)
-#define CTX_FIRST_VERSION ((_AC(1,UL) << CTX_VERSION_SHIFT) + _AC(1,UL))
+#define CTX_FIRST_VERSION BIT(CTX_VERSION_SHIFT)
#define CTX_VALID(__ctx) \
(!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK))
#define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK)
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h
index b84be675e507..349dd23e2876 100644
--- a/arch/sparc/include/asm/mmu_context_64.h
+++ b/arch/sparc/include/asm/mmu_context_64.h
@@ -17,13 +17,8 @@ extern spinlock_t ctx_alloc_lock;
extern unsigned long tlb_context_cache;
extern unsigned long mmu_context_bmap[];
+DECLARE_PER_CPU(struct mm_struct *, per_cpu_secondary_mm);
void get_new_mmu_context(struct mm_struct *mm);
-#ifdef CONFIG_SMP
-void smp_new_mmu_context_version(void);
-#else
-#define smp_new_mmu_context_version() do { } while (0)
-#endif
-
int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
void destroy_context(struct mm_struct *mm);
@@ -74,8 +69,9 @@ void __flush_tlb_mm(unsigned long, unsigned long);
static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
{
unsigned long ctx_valid, flags;
- int cpu;
+ int cpu = smp_processor_id();
+ per_cpu(per_cpu_secondary_mm, cpu) = mm;
if (unlikely(mm == &init_mm))
return;
@@ -121,7 +117,6 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
* for the first time, we must flush that context out of the
* local TLB.
*/
- cpu = smp_processor_id();
if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) {
cpumask_set_cpu(cpu, mm_cpumask(mm));
__flush_tlb_mm(CTX_HWBITS(mm->context),
@@ -131,26 +126,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
}
#define deactivate_mm(tsk,mm) do { } while (0)
-
-/* Activate a new MM instance for the current task. */
-static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm)
-{
- unsigned long flags;
- int cpu;
-
- spin_lock_irqsave(&mm->context.lock, flags);
- if (!CTX_VALID(mm->context))
- get_new_mmu_context(mm);
- cpu = smp_processor_id();
- if (!cpumask_test_cpu(cpu, mm_cpumask(mm)))
- cpumask_set_cpu(cpu, mm_cpumask(mm));
-
- load_secondary_context(mm);
- __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT);
- tsb_context_switch(mm);
- spin_unlock_irqrestore(&mm->context.lock, flags);
-}
-
+#define activate_mm(active_mm, mm) switch_mm(active_mm, mm, NULL)
#endif /* !(__ASSEMBLY__) */
#endif /* !(__SPARC64_MMU_CONTEXT_H) */
diff --git a/arch/sparc/include/asm/pil.h b/arch/sparc/include/asm/pil.h
index 266937030546..522b43db2ed3 100644
--- a/arch/sparc/include/asm/pil.h
+++ b/arch/sparc/include/asm/pil.h
@@ -20,7 +20,6 @@
#define PIL_SMP_CALL_FUNC 1
#define PIL_SMP_RECEIVE_SIGNAL 2
#define PIL_SMP_CAPTURE 3
-#define PIL_SMP_CTX_NEW_VERSION 4
#define PIL_DEVICE_IRQ 5
#define PIL_SMP_CALL_FUNC_SNGL 6
#define PIL_DEFERRED_PCR_WORK 7
diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h
index 8174f6cdbbbb..9dca7a892978 100644
--- a/arch/sparc/include/asm/vio.h
+++ b/arch/sparc/include/asm/vio.h
@@ -327,6 +327,7 @@ struct vio_dev {
int compat_len;
u64 dev_no;
+ u64 id;
unsigned long channel_id;