We want to avoid lots of different copy_page implementations, settling
for something that is "good enough" everywhere and hopefully easy to
understand and maintain whilst we're at it.
This patch reworks our copy_page implementation based on discussions
with Cavium on the list and benchmarking on Cortex-A processors so that:
- The loop is unrolled to copy 128 bytes per iteration
- The reads are offset so that we read from the next 128-byte block
in the same iteration that we store the previous block
- Explicit prefetch instructions are removed for now, since they hurt
performance on CPUs with hardware prefetching
- The loop exit condition is calculated at the start of the loop
Change-Id: I0d9f3bbe4efa2751f41432a3b4b299fbb0e494be
Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
commit 23e94994464a7281838785675e09c8ed1055f62f upstream.
The AArch64 instruction set contains load/store pair memory accessors,
so use these in our copy_*_user routines to transfer 16 bytes per
iteration.
Change-Id: Ie9874b067ff7450a40b29a760f0c6e742f750adc
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: David Brown <david.brown@linaro.org>
The arm64 CRC32 (not CRC32c) implementation was not quite doing
the same thing as the generic one. Fix that.
Change-Id: Ia994facbe7ca05ab852919731eb4c5fb62810919
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Steve Capper <steve.capper@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This module registers a crc32 algorithm and a crc32c algorithm
that use the optional CRC32 and CRC32C instructions in ARMv8.
Tested on AMD Seattle.
Improvement compared to crc32c-generic algorithm:
TCRYPT CRC32C speed test shows ~450% speedup.
Simple dd write tests to btrfs filesystem show ~30% speedup.
Change-Id: I733dfcfc4a17493fd5d9e63cd30ec394f4ab1f9d
Signed-off-by: Yazen Ghannam <yazen.ghannam@linaro.org>
Acked-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Enable config IP_NF_MATCH_RPFILTER.
This option allows you to match packets whose replies would go out via
the interface the packet came in
Change-Id: I2a23346e726a8df8487aeb664d6316b3cf2b9d77
Signed-off-by: Bharat Pawar <bpawar@codeaurora.org>
As with x86, mark the sys_call_table const such that it will be placed
in the .rodata section. This will cause attempts to modify the table
(accidental or deliberate) to fail when strict page permissions are in
place. In the absence of strict page permissions, there should be no
functional change.
Change-Id: I5b8fcf486c59cb1d83c117c5246eeb2447ccfb65
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Git-commit: c623b33b4e9599c6ac5076f7db7369eb9869aa04
Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
start and end must be page aligned while calling
flush_tlb_kernel_range else the last page may get
missed while invalidation.
Change-Id: Ibaab202c47a475623e197a13191b2fed638ce20b
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
The perf core implicitly rejects events spanning multiple HW PMUs, as in
these cases the event->ctx will differ. However this validation is
performed after pmu::event_init() is called in perf_init_event(), and
thus pmu::event_init() may be called with a group leader from a
different HW PMU.
The ARM64 PMU driver does not take this fact into account, and when
validating groups assumes that it can call to_arm_pmu(event->pmu) for
any HW event. When the event in question is from another HW PMU this is
wrong, and results in dereferencing garbage.
This patch updates the ARM64 PMU driver to first test for and reject
events from other PMUs, moving the to_arm_pmu and related logic after
this test. Fixes a crash triggered by perf_fuzzer on Linux-4.0-rc2, with
a CCI PMU present:
Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
CPU: 0 PID: 1371 Comm: perf_fuzzer Not tainted 3.19.0+ #249
Hardware name: V2F-1XV7 Cortex-A53x2 SMM (DT)
task: ffffffc07c73a280 ti: ffffffc07b0a0000 task.ti: ffffffc07b0a0000
PC is at 0x0
LR is at validate_event+0x90/0xa8
pc : [<0000000000000000>] lr : [<ffffffc000090228>] pstate: 00000145
sp : ffffffc07b0a3ba0
[< (null)>] (null)
[<ffffffc0000907d8>] armpmu_event_init+0x174/0x3cc
[<ffffffc00015d870>] perf_try_init_event+0x34/0x70
[<ffffffc000164094>] perf_init_event+0xe0/0x10c
[<ffffffc000164348>] perf_event_alloc+0x288/0x358
[<ffffffc000164c5c>] SyS_perf_event_open+0x464/0x98c
Code: bad PC value
Also cleans up the code to use the arm_pmu only when we know
that we are dealing with an arm pmu event.
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Peter Ziljstra (Intel) <peterz@infradead.org>
Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: 8fff105e13041e49b82f92eef034f363a6b1c071
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: I2ab941e9936726c6222975bdfc9f98e46284fe25
Signed-off-by: Patrick Fay <pfay@codeaurora.com>
Peripheral Access Control Manager (PACMan) is a test driver
and isn't need to be enabled by default on any target.
Also, causing OOM issues during ADSP SSR on 8937.
CRs-Fixed: 979581
Change-Id: I4a91239fb5c56c5a3e9e6a85bc1430a3060d02f1
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Disable MSM Serial HSlite and HSConsole driver on perf image.
Change-Id: I98b7200668f589db7fa48291ff48312545ea948d
Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
Set the appropriate permissions on module text and read-only sections.
Change-Id: Iab9e733040ffd6d048258b94e05537884bc8fc4a
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
This reverts commit f72129c220.
While the aim is increased security for --x memory maps, it does not
protect against kernel level reads. Until SECCOMP is implemented for
arm64, revert this patch to avoid giving a false idea of execute-only
mappings.
Change-Id: Ifb2fb182450bc656189738842f344f63daa5e317
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-commit:5a0fdfada3a2aa50d7b947a2e958bf00cbe0d830
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
Sockets that are opened before VPN is connected
are supposed to be destroyed once it is connected.
VPN related CTS testcases are failing without the
ability to destroy sockets. Enabling INET_DIAG_DESTROY
to fix these testcases.
CRs-Fixed: 1043997
Change-Id: Iffd056fb29a7e16556ec9502a3d005c5bb35be50
Signed-off-by: Devi Sandeep Endluri V V <dendluri@codeaurora.org>
Restriction of kernel performance events requires
a change to the defconfig.
Bug: 29119870
Change-Id: Ib7e565a52446e2dcae1aa8c561d4770f2762a4d7
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
[ Upstream commit 6829e274a623187c24f7cfc0e3d35f25d087fcc5 ]
Buffers allocated by dma_alloc_coherent() are always zeroed on Alpha,
ARM (32bit), MIPS, PowerPC, x86/x86_64 and probably other architectures.
It turned out that some drivers rely on this 'feature'. Allocated buffer
might be also exposed to userspace with dma_mmap() call, so clearing it
is desired from security point of view to avoid exposing random memory
to userspace. This patch unifies dma_alloc_coherent() behavior on ARM64
architecture with other implementations by unconditionally zeroing
allocated buffer.
CRs-Fixed: 1041735
Change-Id: I74bf024e0f603ca8c0b05430dc2ee154d579cfb2
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Git-commit: a142e9641dcbead2c8845c949ad518acac96ed28
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lmark@codeaurora.org: resolve merge conflicts]
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Enable config flags for QCA SDIO 8976 targets.
This flags enable SDIO platform driver and the
Features for WLAN.
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
Change-Id: I388e64bc4e99426141f7d9630bc03ff7817a8cfc
CRs-Fixed: 944601
When an attempt is made to free an event on a CPU which is
no longer online, perf tries to bring the CPU online. This
can fail, resulting in an UP_CANCELLED notifier, which
eventually tries to acquire the ctx->mutex which is already
being held by the cpu_up code.
Removing the attempt to bring the cpu up will remove this
deadlock, but also requires temporarily removing support of
counting events across hotplug. This will be restored in a
later patch.
CRs-fixed: 912295
Change-Id: Iaafa3c6688d26508857472fd5bb32139a137880e
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Enable CONFIG_WLAN_FEATURE_RX_WAKELOCK to define
WLAN_FEATURE_HOLD_RX_WAKELOCK to be able to define
qcom_rx_wakelock to prevent device from going in suspend
state while running throughput when USB is disconnected with
LCD off
Change-Id: Ic06fadc2293247a8237e426b479ce82c7dd39ede
Signed-off-by: Himanshu Agarwal <himanaga@codeaurora.org>
Separate the WLAN CNSS platform driver according to
the bus interface PCIe and SDIO. Add separate Kernel
Config file for the WLAN CNSS platform Driver and its
necessary module which has support for the CNSS
connectivity Subsystem.
Add Kernel Config flag to refactoring the CNSS platform Driver:
CONFIG_CNSS Kernel Config add support to CNSS Core
driver compilation and export Generic GPL wrappers.
CONFIG_CNSS_SDIO Kernel Config add support to CNSS
Platform Driver compilation for SDIO based WiFi Devices
and export platform driver API's based on the SDIO bus.
CONFIG_CNSS_PCI Kernel Config add support to CNSS
Platform Driver compilation for PCIe based WiFi Devices
and export platform driver API's based on the PCIe bus.
Change-Id: I8cce5bbc87e6742179a7967ccba295f55c444b28
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
CRs-fixed: 944601
[ Upstream commit 6829e274a623187c24f7cfc0e3d35f25d087fcc5 ]
Buffers allocated by dma_alloc_coherent() are always zeroed on Alpha,
ARM (32bit), MIPS, PowerPC, x86/x86_64 and probably other architectures.
It turned out that some drivers rely on this 'feature'. Allocated buffer
might be also exposed to userspace with dma_mmap() call, so clearing it
is desired from security point of view to avoid exposing random memory
to userspace. This patch unifies dma_alloc_coherent() behavior on ARM64
architecture with other implementations by unconditionally zeroing
allocated buffer.
CRs-Fixed: 1041735
Change-Id: I74bf024e0f603ca8c0b05430dc2ee154d579cfb2
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Git-commit: a142e9641dcbead2c8845c949ad518acac96ed28
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[lmark@codeaurora.org: resolve merge conflicts]
Signed-off-by: Liam Mark <lmark@codeaurora.org>