This is the 4.9.185 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl0lmgMACgkQONu9yGCS
 aT6xqhAAtn87S6SThYc2y6eQP/svHHCy7PGabWQm4RjnWnO2JAZkfJ3iIj+mgnqF
 umL7zINXVtkZ3G4BiQzOdMcuKE9cBDpHIJTicOEa/lHKLuDw5FscDeW8SGsR7T4/
 1OR1/55JA0R90Lew+Bzs8A9O1b525/35RQtxyOzFxZvl4xAgxUMrTJtSctMCJhSU
 MhzpxuIkvRCfWnlqbxLGKimv8UEcs9JwZlZKmAt+oTkbBeit2JWNJy5+w7Ln4g2N
 SVASZDg1/oad+jGzIHrT5fJs6ZC8EtH111xIUaS8Got/E5GCxG4qOMKOWFxf6Mag
 jy+YvzsAw06yIY7IxZbKpS1LJNTkNekH+8hKpTgf4wuWaUkakIJchnw+att4QpVz
 P8g/BG85DvrTzCIiKmYBEvsw9l9+Utb7iTpKeGvlw1+KmJnF1fu8ZEQQ9tOOr5VB
 w5HaqeMDRBz3twg/tf/SpEzI6PJgSQxLS4fwEYLkGEWrEBY9VqZ+sRtjIbWay2rG
 JeFFwiIDcF3pXrE7MtpTvYTYUGcxvtbAj49KViSs0BtWkhszcMgTEwLFSYL0LoYF
 La1NhfL7GnkZtyTEworvr7NXU7x/yMfvvSSdoVTpimkGUuGyD3VMILe11b6QDGzu
 CBfr09uJAtEGtAn59ZSXJvmqwAYwKrmcfvTqQ3S3lZsxXWV2CLw=
 =WDg7
 -----END PGP SIGNATURE-----

Merge 4.9.185 into android-4.9

Changes in 4.9.185
	tracing: Silence GCC 9 array bounds warning
	gcc-9: silence 'address-of-packed-member' warning
	scsi: ufs: Avoid runtime suspend possibly being blocked forever
	usb: chipidea: udc: workaround for endpoint conflict issue
	IB/hfi1: Silence txreq allocation warnings
	Input: uinput - add compat ioctl number translation for UI_*_FF_UPLOAD
	apparmor: enforce nullbyte at end of tag string
	ARC: fix build warnings with !CONFIG_KPROBES
	parport: Fix mem leak in parport_register_dev_model
	parisc: Fix compiler warnings in float emulation code
	IB/rdmavt: Fix alloc_qpn() WARN_ON()
	IB/hfi1: Insure freeze_work work_struct is canceled on shutdown
	IB/{qib, hfi1, rdmavt}: Correct ibv_devinfo max_mr value
	MIPS: uprobes: remove set but not used variable 'epc'
	net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0
	net: hns: Fix loopback test failed at copper ports
	sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD
	net: ethernet: mediatek: Use hw_feature to judge if HWLRO is supported
	net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled
	drm/arm/hdlcd: Allow a bit of clock tolerance
	scripts/checkstack.pl: Fix arm64 wrong or unknown architecture
	scsi: ufs: Check that space was properly alloced in copy_query_response
	s390/qeth: fix VLAN attribute in bridge_hostnotify udev event
	hwmon: (pmbus/core) Treat parameters as paged if on multiple pages
	nvme: Fix u32 overflow in the number of namespace list calculation
	btrfs: start readahead also in seed devices
	can: flexcan: fix timeout when set small bitrate
	can: purge socket error queue on sock destruct
	powerpc/bpf: use unsigned division instruction for 64-bit operations
	ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX
	Bluetooth: Align minimum encryption key size for LE and BR/EDR connections
	Bluetooth: Fix regression with minimum encryption key size alignment
	cfg80211: fix memory leak of wiphy device name
	mac80211: drop robust management frames from unknown TA
	mac80211: Do not use stack memory with scatterlist for GMAC
	IB/hfi1: Avoid hardlockup with flushlist_lock
	perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul
	perf help: Remove needless use of strncpy()
	perf header: Fix unchecked usage of strncpy()
	9p/rdma: do not disconnect on down_interruptible EAGAIN
	9p: acl: fix uninitialized iattr access
	9p/rdma: remove useless check in cm_event_handler
	9p: p9dirent_read: check network-provided name length
	net/9p: include trans_common.h to fix missing prototype warning.
	fs/proc/array.c: allow reporting eip/esp for all coredumping threads
	fs/binfmt_flat.c: make load_flat_shared_library() work
	mm/page_idle.c: fix oops because end_pfn is larger than max_pfn
	scsi: vmw_pscsi: Fix use-after-free in pvscsi_queue_lck()
	x86/speculation: Allow guests to use SSBD even if host does not
	NFS/flexfiles: Use the correct TCP timeout for flexfiles I/O
	cpu/speculation: Warn on unsupported mitigations= parameter
	af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET
	net: stmmac: fixed new system time seconds value calculation
	sctp: change to hold sk after auth shkey is created successfully
	tipc: change to use register_pernet_device
	tipc: check msg->req data len in tipc_nl_compat_bearer_disable
	tun: wake up waitqueues after IFF_UP is set
	team: Always enable vlan tx offload
	bonding: Always enable vlan tx offload
	ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
	net: check before dereferencing netdev_ops during busy poll
	bpf: udp: Avoid calling reuseport's bpf_prog from udp_gro
	bpf: udp: ipv6: Avoid running reuseport's bpf_prog from __udp6_lib_err
	tipc: pass tunnel dev as NULL to udp_tunnel(6)_xmit_skb
	Bluetooth: Fix faulty expression for minimum encryption key size check
	ASoC : cs4265 : readable register too low
	ASoC: soc-pcm: BE dai needs prepare when pause release after resume
	spi: bitbang: Fix NULL pointer dereference in spi_unregister_master
	drm/mediatek: fix unbind functions
	ASoC: max98090: remove 24-bit format support if RJ is 0
	usb: gadget: fusb300_udc: Fix memory leak of fusb300->ep[i]
	usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC
	scsi: hpsa: correct ioaccel2 chaining
	scripts/decode_stacktrace.sh: prefix addr2line with $CROSS_COMPILE
	mm/mlock.c: change count_mm_mlocked_page_nr return type
	MIPS: math-emu: do not use bools for arithmetic
	MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send()
	mfd: omap-usb-tll: Fix register offsets
	ARC: fix allnoconfig build warning
	bug.h: work around GCC PR82365 in BUG()
	ARC: handle gcc generated __builtin_trap for older compiler
	clk: sunxi: fix uninitialized access
	KVM: x86: degrade WARN to pr_warn_ratelimited
	drm/i915/dmc: protect against reading random memory
	MIPS: Workaround GCC __builtin_unreachable reordering bug
	ptrace: Fix ->ptracer_cred handling for PTRACE_TRACEME
	crypto: user - prevent operating on larval algorithms
	ALSA: seq: fix incorrect order of dest_client/dest_ports arguments
	ALSA: firewire-lib/fireworks: fix miss detection of received MIDI messages
	ALSA: line6: Fix write on zero-sized buffer
	ALSA: usb-audio: fix sign unintended sign extension on left shifts
	lib/mpi: Fix karactx leak in mpi_powm
	drm/imx: notify drm core before sending event during crtc disable
	drm/imx: only send event on crtc disable if kept disabled
	btrfs: Ensure replaced device doesn't have pending chunk allocation
	tty: rocket: fix incorrect forward declaration of 'rp_init()'
	arm64, vdso: Define vdso_{start,end} as array
	KVM: LAPIC: Fix pending interrupt in IRR blocked by software disable LAPIC
	IB/hfi1: Close PSM sdma_progress sleep window
	MIPS: Add missing EHB in mtc0 -> mfc0 sequence.
	dmaengine: imx-sdma: remove BD_INTR for channel0
	arm64: kaslr: keep modules inside module region when KASAN is enabled
	Linux 4.9.185

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2019-07-10 12:11:07 +02:00
commit 70d52cb2bb
119 changed files with 567 additions and 233 deletions

View file

@ -1,6 +1,6 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 9 PATCHLEVEL = 9
SUBLEVEL = 184 SUBLEVEL = 185
EXTRAVERSION = EXTRAVERSION =
NAME = Roaring Lionus NAME = Roaring Lionus
@ -668,6 +668,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
@ -786,7 +787,6 @@ ifeq ($(cc-name),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier)
# Quiet clang warning: comparison of unsigned expression < 0 is always false # Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)

View file

@ -23,7 +23,7 @@ config ARC
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
select HAVE_ARCH_KGDB select HAVE_ARCH_KGDB
select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRACEHOOK
select HAVE_FUTEX_CMPXCHG select HAVE_FUTEX_CMPXCHG if FUTEX
select HAVE_IOREMAP_PROT select HAVE_IOREMAP_PROT
select HAVE_KPROBES select HAVE_KPROBES
select HAVE_KRETPROBES select HAVE_KRETPROBES

View file

@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs *regs, unsigned long address);
#define BUG() do { \ #define BUG() do { \
pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
dump_stack(); \ barrier_before_unreachable(); \
__builtin_trap(); \
} while (0) } while (0)
#define HAVE_ARCH_BUG #define HAVE_ARCH_BUG

View file

@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new)
#endif /* CONFIG_ARC_HAS_LLSC */ #endif /* CONFIG_ARC_HAS_LLSC */
#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \ #define cmpxchg(ptr, o, n) ({ \
(unsigned long)(o), (unsigned long)(n))) (typeof(*(ptr)))__cmpxchg((ptr), \
(unsigned long)(o), \
(unsigned long)(n)); \
})
/* /*
* atomic_cmpxchg is same as cmpxchg * atomic_cmpxchg is same as cmpxchg
@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
return __xchg_bad_pointer(); return __xchg_bad_pointer();
} }
#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \ #define xchg(ptr, with) ({ \
sizeof(*(ptr)))) (typeof(*(ptr)))__xchg((unsigned long)(with), \
(ptr), \
sizeof(*(ptr))); \
})
#endif /* CONFIG_ARC_PLAT_EZNPS */ #endif /* CONFIG_ARC_PLAT_EZNPS */

View file

@ -155,3 +155,11 @@ void do_insterror_or_kprobe(unsigned long address, struct pt_regs *regs)
insterror_is_error(address, regs); insterror_is_error(address, regs);
} }
/*
* abort() call generated by older gcc for __builtin_trap()
*/
void abort(void)
{
__asm__ __volatile__("trap_s 5\n");
}

View file

@ -890,9 +890,11 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu;
unsigned int pd0[mmu->ways];
unsigned long flags; unsigned long flags;
int set; int set, n_ways = mmu->ways;
n_ways = min(n_ways, 4);
BUG_ON(mmu->ways > 4);
local_irq_save(flags); local_irq_save(flags);
@ -900,9 +902,10 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
for (set = 0; set < mmu->sets; set++) { for (set = 0; set < mmu->sets; set++) {
int is_valid, way; int is_valid, way;
unsigned int pd0[4];
/* read out all the ways of current set */ /* read out all the ways of current set */
for (way = 0, is_valid = 0; way < mmu->ways; way++) { for (way = 0, is_valid = 0; way < n_ways; way++) {
write_aux_reg(ARC_REG_TLBINDEX, write_aux_reg(ARC_REG_TLBINDEX,
SET_WAY_TO_IDX(mmu, set, way)); SET_WAY_TO_IDX(mmu, set, way));
write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead); write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead);
@ -916,14 +919,14 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
continue; continue;
/* Scan the set for duplicate ways: needs a nested loop */ /* Scan the set for duplicate ways: needs a nested loop */
for (way = 0; way < mmu->ways - 1; way++) { for (way = 0; way < n_ways - 1; way++) {
int n; int n;
if (!pd0[way]) if (!pd0[way])
continue; continue;
for (n = way + 1; n < mmu->ways; n++) { for (n = way + 1; n < n_ways; n++) {
if (pd0[way] != pd0[n]) if (pd0[way] != pd0[n])
continue; continue;

View file

@ -15,6 +15,7 @@
#include "common.h" #include "common.h"
#include "cpuidle.h" #include "cpuidle.h"
#include "hardware.h"
static int imx6sx_idle_finish(unsigned long val) static int imx6sx_idle_finish(unsigned long val)
{ {
@ -108,7 +109,7 @@ int __init imx6sx_cpuidle_init(void)
* except for power up sw2iso which need to be * except for power up sw2iso which need to be
* larger than LDO ramp up time. * larger than LDO ramp up time.
*/ */
imx_gpc_set_arm_power_up_timing(0xf, 1); imx_gpc_set_arm_power_up_timing(cpu_is_imx6sx() ? 0xf : 0x2, 1);
imx_gpc_set_arm_power_down_timing(1, 1); imx_gpc_set_arm_power_down_timing(1, 1);
return cpuidle_register(&imx6sx_cpuidle_driver, NULL); return cpuidle_register(&imx6sx_cpuidle_driver, NULL);

View file

@ -33,10 +33,14 @@
void *module_alloc(unsigned long size) void *module_alloc(unsigned long size)
{ {
void *p; void *p;
u64 module_alloc_end = module_alloc_base + MODULES_VSIZE;
if (IS_ENABLED(CONFIG_KASAN))
/* don't exceed the static module region - see below */
module_alloc_end = MODULES_END;
p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base, p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
module_alloc_base + MODULES_VSIZE, module_alloc_end, GFP_KERNEL, PAGE_KERNEL_EXEC, 0,
GFP_KERNEL, PAGE_KERNEL_EXEC, 0,
NUMA_NO_NODE, __builtin_return_address(0)); NUMA_NO_NODE, __builtin_return_address(0));
if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) && if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&

View file

@ -37,7 +37,7 @@
#include <asm/vdso.h> #include <asm/vdso.h>
#include <asm/vdso_datapage.h> #include <asm/vdso_datapage.h>
extern char vdso_start, vdso_end; extern char vdso_start[], vdso_end[];
static unsigned long vdso_pages __ro_after_init; static unsigned long vdso_pages __ro_after_init;
/* /*
@ -125,14 +125,14 @@ static int __init vdso_init(void)
struct page **vdso_pagelist; struct page **vdso_pagelist;
unsigned long pfn; unsigned long pfn;
if (memcmp(&vdso_start, "\177ELF", 4)) { if (memcmp(vdso_start, "\177ELF", 4)) {
pr_err("vDSO is not a valid ELF object!\n"); pr_err("vDSO is not a valid ELF object!\n");
return -EINVAL; return -EINVAL;
} }
vdso_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT; vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n", pr_info("vdso: %ld pages (%ld code @ %p, %ld data @ %p)\n",
vdso_pages + 1, vdso_pages, &vdso_start, 1L, vdso_data); vdso_pages + 1, vdso_pages, vdso_start, 1L, vdso_data);
/* Allocate the vDSO pagelist, plus a page for the data. */ /* Allocate the vDSO pagelist, plus a page for the data. */
vdso_pagelist = kcalloc(vdso_pages + 1, sizeof(struct page *), vdso_pagelist = kcalloc(vdso_pages + 1, sizeof(struct page *),
@ -145,7 +145,7 @@ static int __init vdso_init(void)
/* Grab the vDSO code pages. */ /* Grab the vDSO code pages. */
pfn = sym_to_pfn(&vdso_start); pfn = sym_to_pfn(vdso_start);
for (i = 0; i < vdso_pages; i++) for (i = 0; i < vdso_pages; i++)
vdso_pagelist[i + 1] = pfn_to_page(pfn + i); vdso_pagelist[i + 1] = pfn_to_page(pfn + i);

View file

@ -3,7 +3,11 @@
#ifdef CONFIG_BUG #ifdef CONFIG_BUG
#define ia64_abort() __builtin_trap() #define ia64_abort() __builtin_trap()
#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) #define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
barrier_before_unreachable(); \
ia64_abort(); \
} while (0)
/* should this BUG be made generic? */ /* should this BUG be made generic? */
#define HAVE_ARCH_BUG #define HAVE_ARCH_BUG

View file

@ -7,16 +7,19 @@
#ifndef CONFIG_SUN3 #ifndef CONFIG_SUN3
#define BUG() do { \ #define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
barrier_before_unreachable(); \
__builtin_trap(); \ __builtin_trap(); \
} while (0) } while (0)
#else #else
#define BUG() do { \ #define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
barrier_before_unreachable(); \
panic("BUG!"); \ panic("BUG!"); \
} while (0) } while (0)
#endif #endif
#else #else
#define BUG() do { \ #define BUG() do { \
barrier_before_unreachable(); \
__builtin_trap(); \ __builtin_trap(); \
} while (0) } while (0)
#endif #endif

View file

@ -13,6 +13,7 @@ config MIPS
select HAVE_OPROFILE select HAVE_OPROFILE
select HAVE_PERF_EVENTS select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC select PERF_USE_VMALLOC
select HAVE_ARCH_COMPILER_H
select HAVE_ARCH_KGDB select HAVE_ARCH_KGDB
select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRACEHOOK

View file

@ -8,6 +8,41 @@
#ifndef _ASM_COMPILER_H #ifndef _ASM_COMPILER_H
#define _ASM_COMPILER_H #define _ASM_COMPILER_H
/*
* With GCC 4.5 onwards we can use __builtin_unreachable to indicate to the
* compiler that a particular code path will never be hit. This allows it to be
* optimised out of the generated binary.
*
* Unfortunately at least GCC 4.6.3 through 7.3.0 inclusive suffer from a bug
* that can lead to instructions from beyond an unreachable statement being
* incorrectly reordered into earlier delay slots if the unreachable statement
* is the only content of a case in a switch statement. This can lead to
* seemingly random behaviour, such as invalid memory accesses from incorrectly
* reordered loads or stores. See this potential GCC fix for details:
*
* https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00360.html
*
* It is unclear whether GCC 8 onwards suffer from the same issue - nothing
* relevant is mentioned in GCC 8 release notes and nothing obviously relevant
* stands out in GCC commit logs, but these newer GCC versions generate very
* different code for the testcase which doesn't exhibit the bug.
*
* GCC also handles stack allocation suboptimally when calling noreturn
* functions or calling __builtin_unreachable():
*
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
*
* We work around both of these issues by placing a volatile asm statement,
* which GCC is prevented from reordering past, prior to __builtin_unreachable
* calls.
*
* The .insn statement is required to ensure that any branches to the
* statement, which sadly must be kept due to the asm statement, are known to
* be branches to code and satisfy linker requirements for microMIPS kernels.
*/
#undef barrier_before_unreachable
#define barrier_before_unreachable() asm volatile(".insn")
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#define GCC_IMM_ASM() "n" #define GCC_IMM_ASM() "n"
#define GCC_REG_ACCUM "$0" #define GCC_REG_ACCUM "$0"

View file

@ -301,8 +301,6 @@ static inline int nlm_fmn_send(unsigned int size, unsigned int code,
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
nlm_msgsnd(dest); nlm_msgsnd(dest);
status = nlm_read_c2_status0(); status = nlm_read_c2_status0();
if ((status & 0x2) == 1)
pr_info("Send pending fail!\n");
if ((status & 0x4) == 0) if ((status & 0x4) == 0)
return 0; return 0;
} }

View file

@ -111,9 +111,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs)
*/ */
aup->resume_epc = regs->cp0_epc + 4; aup->resume_epc = regs->cp0_epc + 4;
if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) { if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) {
unsigned long epc;
epc = regs->cp0_epc;
__compute_return_epc_for_insn(regs, __compute_return_epc_for_insn(regs,
(union mips_instruction) aup->insn[0]); (union mips_instruction) aup->insn[0]);
aup->resume_epc = regs->cp0_epc; aup->resume_epc = regs->cp0_epc;

View file

@ -828,12 +828,12 @@ do { \
} while (0) } while (0)
#define DIFROMREG(di, x) \ #define DIFROMREG(di, x) \
((di) = get_fpr64(&ctx->fpr[(x) & ~(cop1_64bit(xcp) == 0)], 0)) ((di) = get_fpr64(&ctx->fpr[(x) & ~(cop1_64bit(xcp) ^ 1)], 0))
#define DITOREG(di, x) \ #define DITOREG(di, x) \
do { \ do { \
unsigned fpr, i; \ unsigned fpr, i; \
fpr = (x) & ~(cop1_64bit(xcp) == 0); \ fpr = (x) & ~(cop1_64bit(xcp) ^ 1); \
set_fpr64(&ctx->fpr[fpr], 0, di); \ set_fpr64(&ctx->fpr[fpr], 0, di); \
for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++) \ for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++) \
set_fpr64(&ctx->fpr[fpr], i, 0); \ set_fpr64(&ctx->fpr[fpr], i, 0); \

View file

@ -386,6 +386,7 @@ static struct work_registers build_get_work_registers(u32 **p)
static void build_restore_work_registers(u32 **p) static void build_restore_work_registers(u32 **p)
{ {
if (scratch_reg >= 0) { if (scratch_reg >= 0) {
uasm_i_ehb(p);
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg); UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
return; return;
} }
@ -674,10 +675,12 @@ static void build_restore_pagemask(u32 **p, struct uasm_reloc **r,
uasm_i_mtc0(p, 0, C0_PAGEMASK); uasm_i_mtc0(p, 0, C0_PAGEMASK);
uasm_il_b(p, r, lid); uasm_il_b(p, r, lid);
} }
if (scratch_reg >= 0) if (scratch_reg >= 0) {
uasm_i_ehb(p);
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg); UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
else } else {
UASM_i_LW(p, 1, scratchpad_offset(0), 0); UASM_i_LW(p, 1, scratchpad_offset(0), 0);
}
} else { } else {
/* Reset default page size */ /* Reset default page size */
if (PM_DEFAULT_MASK >> 16) { if (PM_DEFAULT_MASK >> 16) {
@ -935,10 +938,12 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
uasm_i_jr(p, ptr); uasm_i_jr(p, ptr);
if (mode == refill_scratch) { if (mode == refill_scratch) {
if (scratch_reg >= 0) if (scratch_reg >= 0) {
uasm_i_ehb(p);
UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg); UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
else } else {
UASM_i_LW(p, 1, scratchpad_offset(0), 0); UASM_i_LW(p, 1, scratchpad_offset(0), 0);
}
} else { } else {
uasm_i_nop(p); uasm_i_nop(p);
} }
@ -1238,6 +1243,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
UASM_i_MTC0(p, odd, C0_ENTRYLO1); /* load it */ UASM_i_MTC0(p, odd, C0_ENTRYLO1); /* load it */
if (c0_scratch_reg >= 0) { if (c0_scratch_reg >= 0) {
uasm_i_ehb(p);
UASM_i_MFC0(p, scratch, c0_kscratch(), c0_scratch_reg); UASM_i_MFC0(p, scratch, c0_kscratch(), c0_scratch_reg);
build_tlb_write_entry(p, l, r, tlb_random); build_tlb_write_entry(p, l, r, tlb_random);
uasm_l_leave(l, *p); uasm_l_leave(l, *p);
@ -1592,15 +1598,17 @@ static void build_setup_pgd(void)
uasm_i_dinsm(&p, a0, 0, 29, 64 - 29); uasm_i_dinsm(&p, a0, 0, 29, 64 - 29);
uasm_l_tlbl_goaround1(&l, p); uasm_l_tlbl_goaround1(&l, p);
UASM_i_SLL(&p, a0, a0, 11); UASM_i_SLL(&p, a0, a0, 11);
uasm_i_jr(&p, 31);
UASM_i_MTC0(&p, a0, C0_CONTEXT); UASM_i_MTC0(&p, a0, C0_CONTEXT);
uasm_i_jr(&p, 31);
uasm_i_ehb(&p);
} else { } else {
/* PGD in c0_KScratch */ /* PGD in c0_KScratch */
uasm_i_jr(&p, 31);
if (cpu_has_ldpte) if (cpu_has_ldpte)
UASM_i_MTC0(&p, a0, C0_PWBASE); UASM_i_MTC0(&p, a0, C0_PWBASE);
else else
UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg); UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg);
uasm_i_jr(&p, 31);
uasm_i_ehb(&p);
} }
#else #else
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
@ -1614,13 +1622,16 @@ static void build_setup_pgd(void)
UASM_i_LA_mostly(&p, a2, pgdc); UASM_i_LA_mostly(&p, a2, pgdc);
UASM_i_SW(&p, a0, uasm_rel_lo(pgdc), a2); UASM_i_SW(&p, a0, uasm_rel_lo(pgdc), a2);
#endif /* SMP */ #endif /* SMP */
uasm_i_jr(&p, 31);
/* if pgd_reg is allocated, save PGD also to scratch register */ /* if pgd_reg is allocated, save PGD also to scratch register */
if (pgd_reg != -1) if (pgd_reg != -1) {
UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg); UASM_i_MTC0(&p, a0, c0_kscratch(), pgd_reg);
else uasm_i_jr(&p, 31);
uasm_i_ehb(&p);
} else {
uasm_i_jr(&p, 31);
uasm_i_nop(&p); uasm_i_nop(&p);
}
#endif #endif
if (p >= tlbmiss_handler_setup_pgd_end) if (p >= tlbmiss_handler_setup_pgd_end)
panic("tlbmiss_handler_setup_pgd space exceeded"); panic("tlbmiss_handler_setup_pgd space exceeded");

View file

@ -60,19 +60,19 @@
((exponent < (SGL_P - 1)) ? \ ((exponent < (SGL_P - 1)) ? \
(Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE) (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)
#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) #define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0)
#define Sgl_roundnearest_from_int(int_value,sgl_value) \ #define Sgl_roundnearest_from_int(int_value,sgl_value) \
if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \ if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
Sall(sgl_value)++ Sall(sgl_value)++
#define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \ #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \
((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
#define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \ #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \
if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \ if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \
Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++ Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++
#define Dint_isinexact_to_dbl(dint_value) \ #define Dint_isinexact_to_dbl(dint_value) \

View file

@ -261,6 +261,7 @@
#define PPC_INST_MULLI 0x1c000000 #define PPC_INST_MULLI 0x1c000000
#define PPC_INST_DIVWU 0x7c000396 #define PPC_INST_DIVWU 0x7c000396
#define PPC_INST_DIVD 0x7c0003d2 #define PPC_INST_DIVD 0x7c0003d2
#define PPC_INST_DIVDU 0x7c000392
#define PPC_INST_RLWINM 0x54000000 #define PPC_INST_RLWINM 0x54000000
#define PPC_INST_RLWIMI 0x50000000 #define PPC_INST_RLWIMI 0x50000000
#define PPC_INST_RLDICL 0x78000000 #define PPC_INST_RLDICL 0x78000000

View file

@ -116,7 +116,7 @@
___PPC_RA(a) | IMM_L(i)) ___PPC_RA(a) | IMM_L(i))
#define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \ #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \
___PPC_RA(a) | ___PPC_RB(b)) ___PPC_RA(a) | ___PPC_RB(b))
#define PPC_DIVD(d, a, b) EMIT(PPC_INST_DIVD | ___PPC_RT(d) | \ #define PPC_DIVDU(d, a, b) EMIT(PPC_INST_DIVDU | ___PPC_RT(d) | \
___PPC_RA(a) | ___PPC_RB(b)) ___PPC_RA(a) | ___PPC_RB(b))
#define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \ #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \
___PPC_RS(a) | ___PPC_RB(b)) ___PPC_RS(a) | ___PPC_RB(b))

Some files were not shown because too many files have changed in this diff Show more