mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
* remotes/msm-4.9/tmp-39dae59: Linux 4.14-rc8 x86/module: Detect and skip invalid relocations objtool: Prevent GCC from merging annotate_unreachable(), take 2 Revert "x86/mm: Stop calling leave_mm() in idle code" Documentation: Add Frank Rowand to list of enforcement statement endorsers doc: add Willy Tarreau to the list of enforcement statement endorsers tools/headers: Synchronize kernel ABI headers objtool: Resync objtool's instruction decoder source code copy with the kernel's latest version Input: sparse-keymap - send sync event for KE_SW/KE_VSW Input: ar1021_i2c - set INPUT_PROP_DIRECT arch/tile: Implement ->set_state_oneshot_stopped() Update MIPS email addresses x86: CPU: Fix up "cpu MHz" in /proc/cpuinfo mm, swap: fix race between swap count continuation operations mm/huge_memory.c: deposit page table when copying a PMD migration entry initramfs: fix initramfs rebuilds w/ compression after disabling fs/hugetlbfs/inode.c: fix hwpoison reserve accounting ocfs2: fstrim: Fix start offset of first cluster group during fstrim mm, /proc/pid/pagemap: fix soft dirty marking for PMD migration entry userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size Documentation: Add Tim Bird to list of enforcement statement endorsers net: systemport: Correct IPG length settings tcp: do not mangle skb->cb[] in tcp_make_synack() fib: fib_dump_info can no longer use __in_dev_get_rtnl stmmac: use of_property_read_u32 instead of read_u8 net_sched: hold netns refcnt for each action net_sched: acquire RTNL in tc_action_net_exit() powerpc/perf: Fix core-imc hotplug callback failure during imc initialization Kbuild: don't pass "-C" to preprocessor when processing linker scripts Revert "x86: do not use cpufreq_quick_get() for /proc/cpuinfo "cpu MHz"" arm64: ensure __dump_instr() checks addr_limit KVM: x86: Update APICv on APIC reset KVM: VMX: Do not fully reset PI descriptor on vCPU reset kvm: Return -ENODEV from update_persistent_clock futex: futex_wake_op, do not fail on invalid op MIPS: Update email address for Marcin Nowakowski License cleanup: add SPDX license identifier to uapi header files with a license License cleanup: add SPDX license identifier to uapi header files with no license License cleanup: add SPDX GPL-2.0 license identifier to files with no license KEYS: fix out-of-bounds read during ASN.1 parsing KEYS: trusted: fix writing past end of buffer in trusted_read() KEYS: return full count in keyring_read() if buffer is too small net: vrf: correct FRA_L3MDEV encode type tcp_nv: fix division by zero in tcpnv_acked() drm/amdgpu: allow harvesting check for Polaris VCE drm/amdgpu: return -ENOENT from uvd 6.0 early init for harvesting ARM: add debug ".edata_real" symbol MIPS: smp-cmp: Fix vpe_id build error MAINTAINERS: Update Pistachio platform maintainers MIPS: smp-cmp: Use right include for task_struct signal: Fix name of SIGEMT in #if defined() check MIPS: Update Goldfish RTC driver maintainer email address MIPS: Update RINT emulation maintainer email address MIPS: CPS: Fix use of current_cpu_data in preemptible code x86/mcelog: Get rid of RCU remnants watchdog/hardlockup/perf: Use atomics to track in-use cpu counter watchdog/harclockup/perf: Revert a33d44843d45 ("watchdog/hardlockup/perf: Simplify deferred event destroy") ARM: 8716/1: pass endianness info to sparse drm/i915: Check incoming alignment for unfenced buffers (on i915gm) x86/mm: fix use-after-free of vma during userfaultfd fault ide:ide-cd: fix kernel panic resulting from missing scsi_req_init mmc: dw_mmc: Fix the DTO timeout calculation tcp: fix tcp_mtu_probe() vs highest_sack ipv6: addrconf: increment ifp refcount before ipv6_del_addr() tun/tap: sanitize TUNSETSNDBUF input mlxsw: i2c: Fix buffer increment counter for write transaction netfilter: nf_reject_ipv4: Fix use-after-free in send_reset futex: Fix more put_pi_state() vs. exit_pi_state_list() races powerpc/kprobes: Dereference function pointers only if the address does not belong to kernel text Revert "powerpc64/elfv1: Only dereference function descriptor for non-text symbols" mlxsw: reg: Add high and low temperature thresholds MAINTAINERS: Remove Yotam from mlxfw MAINTAINERS: Update Yotam's E-mail net: hns: set correct return value net: lapbether: fix double free bpf: remove SK_REDIRECT from UAPI net: phy: marvell: Only configure RGMII delays when using RGMII MIPS: SMP: Fix deadlock & online race MIPS: bpf: Fix a typo in build_one_insn() MIPS: microMIPS: Fix incorrect mask in insn_table_MM MIPS: Fix CM region target definitions MIPS: generic: Fix compilation error from include asm/mips-cpc.h MIPS: Fix exception entry when CONFIG_EVA enabled irqchip/irq-mvebu-gicp: Add missing spin_lock init drm/nouveau/kms/nv50: use the correct state for base channel notifier setup MIPS: generic: Fix NI 169445 its build Update MIPS email addresses tile: pass machine size to sparse selftests: lib.mk: print individual test results to console by default RDMA/nldev: Enforce device index check for port callback Revert "PM / QoS: Fix device resume latency PM QoS" Revert "PM / QoS: Fix default runtime_pm device resume latency" scsi: qla2xxx: Fix oops in qla2x00_probe_one error path xfrm: Fix GSO for IPsec with GRE tunnel. ALSA: seq: Fix nested rwsem annotation for lockdep splat ALSA: timer: Add missing mutex lock for compat ioctls tc-testing: fix arg to ip command: -s -> -n net_sched: remove tcf_block_put_deferred() l2tp: hold tunnel in pppol2tp_connect() drm/i915: Hold rcu_read_lock when iterating over the radixtree (vma idr) drm/i915: Hold rcu_read_lock when iterating over the radixtree (objects) drm/i915/edp: read edp display control registers unconditionally drm/i915: Do not rely on wm preservation for ILK watermarks drm/i915: Cancel the modeset retry work during modeset cleanup Mark 'ioremap_page_range()' as possibly sleeping nvme: Fix setting logical block format when revalidating mmc: dw_mmc: Add locking to the CTO timer mmc: dw_mmc: Fix the CTO timeout calculation mmc: dw_mmc: cancel the CTO timer after a voltage switch perf/cgroup: Fix perf cgroup hierarchy support PM / QoS: Fix default runtime_pm device resume latency Revert "ath10k: fix napi_poll budget overflow" ath10k: rebuild crypto header in rx data frames cifs: check MaxPathNameComponentLength != 0 before using it KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables KVM: arm/arm64: vgic-its: Check CBASER/BASER validity before enabling the ITS KVM: arm/arm64: vgic-its: Fix vgic_its_restore_collection_table returned value KVM: arm/arm64: vgic-its: Fix return value for device table restore efi/libstub: arm: omit sorting of the UEFI memory map perf tools: Unwind properly location after REJECT virtio_blk: Fix an SG_IO regression wcn36xx: Remove unnecessary rcu_read_unlock in wcn36xx_bss_info_changed ARM: dts: mvebu: pl310-cache disable double-linefill xfrm: Clear sk_dst_cache when applying per-socket policy. perf symbols: Fix memory corruption because of zero length symbols powerpc/64s/radix: Fix preempt imbalance in TLB flush netfilter: nft_set_hash: disable fast_ops for 2-len keys powerpc: Fix check for copy/paste instructions in alignment handler powerpc/perf: Fix IMC allocation routine xfrm: Fix xfrm_dst_cache memleak ARM: 8715/1: add a private asm/unaligned.h clk: uniphier: fix clock data for PXs3 Documentation: Add my name to kernel enforcement statement nvme-rdma: fix possible hang when issuing commands during ctrl removal arm/arm64: kvm: Disable branch profiling in HYP code arm/arm64: kvm: Move initialization completion message arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort Documentation: kernel-enforcement-statement.rst: proper sort names ASoC: rt5616: fix 0x91 default value Documentation: Add Arm Ltd to kernel-enforcement-statement.rst arm64: dts: uniphier: add STDMAC clock to EHCI nodes ARM: dts: uniphier: add STDMAC clock to EHCI nodes mmc: renesas_sdhi: fix kernel panic in _internal_dmac.c mmc: tmio: fix swiotlb buffer is full Documentation: kernel-enforcement-statement.rst: Remove Red Hat markings Documentation: Add myself to the enforcement statement list Documentation: Sign kernel enforcement statement Add ack for Trond Myklebust to the enforcement statement Documentation: update kernel enforcement support list Documentation: add my name to supporters ASoC: rt5659: connect LOUT Amp with Charge Pump ASoC: rt5659: register power bit of LOUT Amp KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table crypto: x86/chacha20 - satisfy stack validation 2.0 ASoC: rt5663: Change the dev getting function in rt5663_irq ASoC: rt5514: Revert Hotword Model control ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()' ASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_widget_denum_create()' ASoC: rt5514-spi: check irq status to schedule data copy ASoC: adau17x1: Workaround for noise bug in ADC Conflicts: drivers/gpu/drm/msm/Makefile drivers/soc/qcom/Makefile drivers/staging/android/ion/Makefile include/linux/coresight-stm.h include/trace/events/kmem.h Change-Id: I01f1779762b652b9213924caa3d54f29cf03d285 Signed-off-by: Runmin Wang <runminw@codeaurora.org>
114 lines
2.8 KiB
C
114 lines
2.8 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/kernel.h>
|
|
#include <linux/types.h>
|
|
#include <linux/init.h>
|
|
#include <linux/memblock.h>
|
|
|
|
static u64 patterns[] __initdata = {
|
|
/* The first entry has to be 0 to leave memtest with zeroed memory */
|
|
0,
|
|
0xffffffffffffffffULL,
|
|
0x5555555555555555ULL,
|
|
0xaaaaaaaaaaaaaaaaULL,
|
|
0x1111111111111111ULL,
|
|
0x2222222222222222ULL,
|
|
0x4444444444444444ULL,
|
|
0x8888888888888888ULL,
|
|
0x3333333333333333ULL,
|
|
0x6666666666666666ULL,
|
|
0x9999999999999999ULL,
|
|
0xccccccccccccccccULL,
|
|
0x7777777777777777ULL,
|
|
0xbbbbbbbbbbbbbbbbULL,
|
|
0xddddddddddddddddULL,
|
|
0xeeeeeeeeeeeeeeeeULL,
|
|
0x7a6c7258554e494cULL, /* yeah ;-) */
|
|
};
|
|
|
|
static void __init reserve_bad_mem(u64 pattern, phys_addr_t start_bad, phys_addr_t end_bad)
|
|
{
|
|
pr_info(" %016llx bad mem addr %pa - %pa reserved\n",
|
|
cpu_to_be64(pattern), &start_bad, &end_bad);
|
|
memblock_reserve(start_bad, end_bad - start_bad);
|
|
}
|
|
|
|
static void __init memtest(u64 pattern, phys_addr_t start_phys, phys_addr_t size)
|
|
{
|
|
u64 *p, *start, *end;
|
|
phys_addr_t start_bad, last_bad;
|
|
phys_addr_t start_phys_aligned;
|
|
const size_t incr = sizeof(pattern);
|
|
|
|
start_phys_aligned = ALIGN(start_phys, incr);
|
|
start = __va(start_phys_aligned);
|
|
end = start + (size - (start_phys_aligned - start_phys)) / incr;
|
|
start_bad = 0;
|
|
last_bad = 0;
|
|
|
|
for (p = start; p < end; p++)
|
|
*p = pattern;
|
|
|
|
for (p = start; p < end; p++, start_phys_aligned += incr) {
|
|
if (*p == pattern)
|
|
continue;
|
|
if (start_phys_aligned == last_bad + incr) {
|
|
last_bad += incr;
|
|
continue;
|
|
}
|
|
if (start_bad)
|
|
reserve_bad_mem(pattern, start_bad, last_bad + incr);
|
|
start_bad = last_bad = start_phys_aligned;
|
|
}
|
|
if (start_bad)
|
|
reserve_bad_mem(pattern, start_bad, last_bad + incr);
|
|
}
|
|
|
|
static void __init do_one_pass(u64 pattern, phys_addr_t start, phys_addr_t end)
|
|
{
|
|
u64 i;
|
|
phys_addr_t this_start, this_end;
|
|
|
|
for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE, &this_start,
|
|
&this_end, NULL) {
|
|
this_start = clamp(this_start, start, end);
|
|
this_end = clamp(this_end, start, end);
|
|
if (this_start < this_end) {
|
|
pr_info(" %pa - %pa pattern %016llx\n",
|
|
&this_start, &this_end, cpu_to_be64(pattern));
|
|
memtest(pattern, this_start, this_end - this_start);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* default is disabled */
|
|
static unsigned int memtest_pattern __initdata =
|
|
CONFIG_MEMTEST_ENABLE_DEFAULT;
|
|
static int __init parse_memtest(char *arg)
|
|
{
|
|
int ret = 0;
|
|
|
|
if (arg)
|
|
ret = kstrtouint(arg, 0, &memtest_pattern);
|
|
else
|
|
memtest_pattern = ARRAY_SIZE(patterns);
|
|
|
|
return ret;
|
|
}
|
|
|
|
early_param("memtest", parse_memtest);
|
|
|
|
void __init early_memtest(phys_addr_t start, phys_addr_t end)
|
|
{
|
|
unsigned int i;
|
|
unsigned int idx = 0;
|
|
|
|
if (!memtest_pattern)
|
|
return;
|
|
|
|
pr_info("early_memtest: # of tests: %u\n", memtest_pattern);
|
|
for (i = memtest_pattern-1; i < UINT_MAX; --i) {
|
|
idx = i % ARRAY_SIZE(patterns);
|
|
do_one_pass(patterns[idx], start, end);
|
|
}
|
|
}
|