* [GIT PULL 00/27] perf/core improvements and fixes
From: Ingo Molnar @ 2016-09-29 17:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling, more to come soon,
>
> - Arnaldo
>
> Build and test results at the end of this message.
>
> The following changes since commit 6b652de2b27c0a4020ce0e8f277e782b6af76096:
>
> Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-23 07:21:38 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160929
>
> for you to fetch changes up to d18019a53a07e009899ff6b8dc5ec30f249360d9:
>
> perf tests: Add dwarf unwind test for powerpc (2016-09-29 11:18:21 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
> -------------
>
> New features:
>
> - Add support for using symbols in address filters with Intel PT and ARM
> CoreSight (hardware assisted tracing facilities) (Adrian Hunter, Mathieu Poirier)
>
> Fixes:
>
> - Fix MMAP event synthesis for pre-existing threads when no hugetlbfs
> mount is in place (Adrian Hunter)
>
> - Don't ignore kernel idle symbols in 'perf script' (Adrian Hunter)
>
> - Assorted Intel PT fixes (Adrian Hunter)
>
> Improvements:
>
> - Fix handling of C++ symbols in 'perf probe' (Masami Hiramatsu)
>
> - Beautify sched_[gs]et_attr return value in 'perf trace' (Arnaldo Carvalho de Melo)
>
> Infrastructure:
> ---------------
>
> New features:
>
> - Add dwarf unwind 'perf test' for powerpc (Ravi Bangoria)
>
> Fixes:
>
> - Fix error paths in 'perf record' (Adrian Hunter)
>
> Documentation:
>
> - Update documentation info about quipper, a C++ parser for converting
> to/from perf.data/chromium profiling format (Simon Que)
>
> Build Fixes:
>
> Fix building in 32 bit platform with libbabeltrace (Wang Nan)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (16):
> perf record: Fix documentation 'event_sources' -> 'event_source'
> perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
> perf script: Fix vanished idle symbols
> perf record: Rename label 'out_symbol_exit'
> perf record: Fix error paths
> perf symbols: Add dso__last_symbol()
> perf record: Add support for using symbols in address filters
> perf probe: Increase debug level of SDT debug messages
> perf intel-pt: Fix snapshot overlap detection decoder errors
> perf intel-pt: Add support for recording the max non-turbo ratio
> perf intel-pt: Fix missing error codes processing auxtrace_info
> perf intel-pt: Add a helper function for processing AUXTRACE_INFO
> perf intel-pt: Record address filter in AUXTRACE_INFO event
> perf intel-pt: Read address filter from AUXTRACE_INFO event
> perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
> perf intel-pt: Fix decoding when there are address filters
>
> Arnaldo Carvalho de Melo (1):
> perf trace: Beautify sched_[gs]et_attr return value
>
> Masami Hiramatsu (4):
> perf probe: Ignore the error of finding inline instance
> perf probe: Skip if the function address is 0
> perf probe: Fix to cut off incompatible chars from group name
> perf probe: Match linkage name with mangled name
>
> Mathieu Poirier (3):
> perf tools: Make perf_evsel__append_filter() generic
> perf evsel: New tracepoint specific function
> perf evsel: Add support for address filters
>
> Ravi Bangoria (1):
> perf tests: Add dwarf unwind test for powerpc
>
> Simon Que (1):
> perf tools: Update documentation info about quipper
>
> Wang Nan (1):
> perf data: Fix building in 32 bit platform with libbabeltrace
>
> tools/perf/Documentation/perf-record.txt | 61 +-
> tools/perf/Documentation/perf.data-file-format.txt | 6 +-
> tools/perf/arch/powerpc/Build | 1 +
> tools/perf/arch/powerpc/include/arch-tests.h | 13 +
> tools/perf/arch/powerpc/include/perf_regs.h | 2 +
> tools/perf/arch/powerpc/tests/Build | 4 +
> tools/perf/arch/powerpc/tests/arch-tests.c | 15 +
> tools/perf/arch/powerpc/tests/dwarf-unwind.c | 62 ++
> tools/perf/arch/powerpc/tests/regs_load.S | 94 +++
> tools/perf/arch/x86/util/intel-pt.c | 57 +-
> tools/perf/builtin-record.c | 32 +-
> tools/perf/builtin-trace.c | 10 +-
> tools/perf/tests/Build | 2 +-
> tools/perf/tests/dwarf-unwind.c | 2 +-
> tools/perf/util/auxtrace.c | 737 +++++++++++++++++++++
> tools/perf/util/auxtrace.h | 54 ++
> tools/perf/util/build-id.c | 4 +-
> tools/perf/util/data-convert-bt.c | 2 +-
> tools/perf/util/dwarf-aux.c | 28 +-
> tools/perf/util/dwarf-aux.h | 3 +
> tools/perf/util/event.c | 3 +-
> tools/perf/util/evsel.c | 16 +-
> tools/perf/util/evsel.h | 5 +-
> tools/perf/util/evsel_fprintf.c | 7 +-
> .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 30 +
> .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 +
> tools/perf/util/intel-pt.c | 172 ++++-
> tools/perf/util/intel-pt.h | 4 +-
> tools/perf/util/parse-events.c | 41 +-
> tools/perf/util/probe-event.c | 10 +-
> tools/perf/util/probe-file.c | 2 +-
> tools/perf/util/probe-finder.c | 17 +-
> tools/perf/util/symbol.c | 15 +
> tools/perf/util/symbol.h | 1 +
> 34 files changed, 1451 insertions(+), 62 deletions(-)
> create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
> create mode 100644 tools/perf/arch/powerpc/tests/Build
> create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
> create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
> create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S
>
> # time dm
> 1 alpine:3.4: Ok
> 2 android-ndk:r12b-arm: Ok
> 3 archlinux:latest: Ok
> 4 centos:5: Ok
> 5 centos:6: Ok
> 6 centos:7: Ok
> 7 debian:7: Ok
> 8 debian:8: Ok
> 9 debian:experimental: Ok
> 10 fedora:20: Ok
> 11 fedora:21: Ok
> 12 fedora:22: Ok
> 13 fedora:23: Ok
> 14 fedora:24: Ok
> 15 fedora:24-x-ARC-uClibc: Ok
> 16 fedora:rawhide: Ok
> 17 mageia:5: Ok
> 18 opensuse:13.2: Ok
> 19 opensuse:42.1: Ok
> 20 opensuse:tumbleweed: Ok
> 21 ubuntu:12.04.5: Ok
> 22 ubuntu:14.04: Ok
> 23 ubuntu:14.04.4: Ok
> 24 ubuntu:15.10: Ok
> 25 ubuntu:16.04: Ok
> 26 ubuntu:16.04-x-arm: Ok
> 27 ubuntu:16.04-x-arm64: Ok
> 28 ubuntu:16.04-x-powerpc: Ok
> 29 ubuntu:16.04-x-powerpc64: Ok
> 30 ubuntu:16.04-x-powerpc64el: Ok
> 31 ubuntu:16.04-x-s390: Ok
> 32 ubuntu:16.10: Ok
> 33 2246.21
>
> real 37m26.862s
> user 0m2.148s
> sys 0m2.256s
> #
>
> # perf test
> 1: vmlinux symtab matches kallsyms : Ok
> 2: detect openat syscall event : Ok
> 3: detect openat syscall event on all cpus : Ok
> 4: read samples using the mmap interface : Ok
> 5: parse events tests : Ok
> 6: Validate PERF_RECORD_* events & perf_sample fields : Ok
> 7: Test perf pmu format parsing : Ok
> 8: Test dso data read : Ok
> 9: Test dso data cache : Ok
> 10: Test dso data reopen : Ok
> 11: roundtrip evsel->name check : Ok
> 12: Check parsing of sched tracepoints fields : Ok
> 13: Generate and check syscalls:sys_enter_openat event fields: Ok
> 14: struct perf_event_attr setup : Ok
> 15: Test matching and linking multiple hists : Ok
> 16: Try 'import perf' in python, checking link problems : Ok
> 17: Test breakpoint overflow signal handler : Ok
> 18: Test breakpoint overflow sampling : Ok
> 19: Test number of exit event of a simple workload : Ok
> 20: Test software clock events have valid period values : Ok
> 21: Test object code reading : Ok
> 22: Test sample parsing : Ok
> 23: Test using a dummy software event to keep tracking : Ok
> 24: Test parsing with no sample_id_all bit set : Ok
> 25: Test filtering hist entries : Ok
> 26: Test mmap thread lookup : Ok
> 27: Test thread mg sharing : Ok
> 28: Test output sorting of hist entries : Ok
> 29: Test cumulation of child hist entries : Ok
> 30: Test tracking with sched_switch : Ok
> 31: Filter fds with revents mask in a fdarray : Ok
> 32: Add fd to a fdarray, making it autogrow : Ok
> 33: Test kmod_path__parse function : Ok
> 34: Test thread map : Ok
> 35: Test LLVM searching and compiling :
> 35.1: Basic BPF llvm compiling test : Ok
> 35.2: Test kbuild searching : Ok
> 35.3: Compile source for BPF prologue generation test : Ok
> 35.4: Compile source for BPF relocation test : Ok
> 36: Test topology in session : Ok
> 37: Test BPF filter :
> 37.1: Test basic BPF filtering : Ok
> 37.2: Test BPF prologue generation : Ok
> 37.3: Test BPF relocation checker : Ok
> 38: Test thread map synthesize : Ok
> 39: Test cpu map synthesize : Ok
> 40: Test stat config synthesize : Ok
> 41: Test stat synthesize : Ok
> 42: Test stat round synthesize : Ok
> 43: Test attr update synthesize : Ok
> 44: Test events times : Ok
> 45: Test backward reading from ring buffer : Ok
> 46: Test cpu map print : Ok
> 47: Test SDT event probing : Ok
> 48: Test is_printable_array function : Ok
> 49: Test bitmap print : Ok
> 50: x86 rdpmc test : Ok
> 51: Test converting perf time to TSC : Ok
> 52: Test dwarf unwind : Ok
> 53: Test x86 instruction decoder - new instructions : Ok
> 54: Test intel cqm nmi context read : Skip
> #
>
> $ make -C tools/perf build-test
> make: Entering directory '/home/acme/git/linux/tools/perf'
> tarpkg: ./tests/perf-targz-src-pkg .
> make_debug_O: make DEBUG=1
> make_no_libnuma_O: make NO_LIBNUMA=1
> make_no_slang_O: make NO_SLANG=1
> make_no_libaudit_O: make NO_LIBAUDIT=1
> make_no_libbpf_O: make NO_LIBBPF=1
> make_install_prefix_slash_O: make install prefix=/tmp/krava/
> make_tags_O: make tags
> make_doc_O: make doc
> make_no_libunwind_O: make NO_LIBUNWIND=1
> make_install_bin_O: make install-bin
> make_no_libbionic_O: make NO_LIBBIONIC=1
> make_with_babeltrace_O: make LIBBABELTRACE=1
> make_no_demangle_O: make NO_DEMANGLE=1
> make_perf_o_O: make perf.o
> make_no_auxtrace_O: make NO_AUXTRACE=1
> make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
> make_pure_O: make
> make_util_map_o_O: make util/map.o
> make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
> make_no_newt_O: make NO_NEWT=1
> make_no_libpython_O: make NO_LIBPYTHON=1
> make_util_pmu_bison_o_O: make util/pmu-bison.o
> make_help_O: make help
> make_install_prefix_O: make install prefix=/tmp/krava
> make_static_O: make LDFLAGS=-static
> make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
> make_no_backtrace_O: make NO_BACKTRACE=1
> make_clean_all_O: make clean all
> make_install_O: make install
> make_no_libelf_O: make NO_LIBELF=1
> make_no_libperl_O: make NO_LIBPERL=1
> make_no_gtk2_O: make NO_GTK2=1
> make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1
> OK
> make: Leaving directory '/home/acme/git/linux/tools/perf'
> $
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply
* [PATCH v12 0/8] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer
From: Fu Wei @ 2016-09-29 16:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <6a1af526-3500-e603-351f-2b2da5726140@huawei.com>
Hi Wang Xiongfeng
On 29 September 2016 at 16:33, wangxiongfeng (C)
<wangxiongfeng2@huawei.com> wrote:
> for sbsa watchdog part, Tested-by: wangxiongfeng2 at huawei.com on D05 board.
Great thanks for your testing. :-)
>
> On 2016/9/13 18:38, fu.wei at linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> This patchset:
>> (1)Preparation for adding GTDT support in arm_arch_timer:
>> 1. Move some enums and marcos to header file;
>> 2. Add a new enum for spi type;
>> 3. Improve printk relevant code.
>>
>> (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c
>> Parse all kinds of timer in GTDT table of ACPI:arch timer,
>> memory-mapped timer and SBSA Generic Watchdog timer.
>> This driver can help to simplify all the relevant timer drivers,
>> and separate all the ACPI GTDT knowledge from them.
>>
>> (3)Simplify ACPI code for arm_arch_timer
>>
>> (4)Add GTDT support for ARM memory-mapped timer
>>
>> This patchset depends on the following patchset:
>> [UPDATE PATCH V11 1/8] ACPI: I/O Remapping Table (IORT) initial support
>> https://lkml.org/lkml/2016/9/12/949
>>
>> This patchset has been tested on the following platforms:
>> (1)ARM Foundation v8 model
>>
>> Changelog:
>> v12: https://lkml.org/lkml/2016/9/13/
>> Rebase to latest Linux 4.8-rc6
>> Delete the confusing "skipping" in the error message.
>>
>> V11: https://lkml.org/lkml/2016/9/6/354
>> Rebase to latest Linux 4.8-rc5
>> Delete typedef (suggested by checkpatch.pl)
>>
>> V10: https://lkml.org/lkml/2016/7/26/215
>> Drop the "readq" patch.
>> Rebase to latest Linux 4.7.
>>
>> V9: https://lkml.org/lkml/2016/7/25/345
>> Improve pr_err message in acpi gtdt driver.
>> Update Commit message for 7/9
>> shorten the irq mapping function name
>> Improve GTDT driver for memory-mapped timer
>>
>> v8: https://lkml.org/lkml/2016/7/19/660
>> Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT",
>> and also improve printk message.
>> Simplify is_timer_block and is_watchdog.
>> Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init();
>> Delete __init in include/linux/acpi.h for GTDT API
>> Make ARM64 select GTDT.
>> Delete "#include <linux/module.h>" from acpi_gtdt.c
>> Simplify GT block parse code.
>>
>> v7: https://lkml.org/lkml/2016/7/13/769
>> Move the GTDT driver to drivers/acpi/arm64
>> Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS
>> Merge 3 patches of GTDT parser driver.
>> Fix the for_each_platform_timer bug.
>>
>> v6: https://lkml.org/lkml/2016/6/29/580
>> split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer,
>> and SBSA Generic Watchdog timer
>> Improve driver by suggestions and example code from Daniel Lezcano
>>
>> v5: https://lkml.org/lkml/2016/5/24/356
>> Sorting out all patches, simplify the API of GTDT driver:
>> GTDT driver just fills the data struct for arm_arch_timer driver.
>>
>> v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html
>> Delete the kvm relevant patches
>> Separate two patches for sorting out the code for arm_arch_timer.
>> Improve irq info export code to allow missing irq info in GTDT table.
>>
>> v3: https://lkml.org/lkml/2016/2/1/658
>> Improve GTDT driver code:
>> (1)improve pr_* by defining pr_fmt(fmt)
>> (2)simplify gtdt_sbsa_gwdt_init
>> (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try
>> to get GTDT table.
>> Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr.
>> Add arm_arch_timer get ppi from DT and GTDT support for kvm.
>>
>> v2: https://lkml.org/lkml/2015/12/2/10
>> Rebase to latest kernel version(4.4-rc3).
>> Fix the bug about the config problem,
>> use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c
>>
>> v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553
>>
>> Fu Wei (8):
>> clocksource/drivers/arm_arch_timer: Move enums and defines to header
>> file
>> clocksource/drivers/arm_arch_timer: Add a new enum for spi type
>> clocksource/drivers/arm_arch_timer: Improve printk relevant code
>> acpi/arm64: Add GTDT table parse driver
>> clocksource/drivers/arm_arch_timer: Simplify ACPI support code.
>> acpi/arm64: Add memory-mapped timer support in GTDT driver
>> clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped
>> timer
>> acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
>>
>> arch/arm64/Kconfig | 1 +
>> drivers/acpi/arm64/Kconfig | 3 +
>> drivers/acpi/arm64/Makefile | 1 +
>> drivers/acpi/arm64/gtdt.c | 309 +++++++++++++++++++++++++++++++++++
>> drivers/clocksource/Kconfig | 2 +-
>> drivers/clocksource/arm_arch_timer.c | 225 +++++++++++++++++--------
>> drivers/watchdog/Kconfig | 1 +
>> include/clocksource/arm_arch_timer.h | 32 ++++
>> include/linux/acpi.h | 7 +
>> 9 files changed, 510 insertions(+), 71 deletions(-)
>> create mode 100644 drivers/acpi/arm64/gtdt.c
>>
>
--
Best regards,
Fu Wei
Software Engineer
Red Hat
^ permalink raw reply
* [PATCH 1/1] crypto: atmel-aes: add support to the XTS mode
From: Cyrille Pitchen @ 2016-09-29 16:49 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds the xts(aes) algorithm, which is supported from
hardware version 0x500 and above (sama5d2x).
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
---
drivers/crypto/atmel-aes-regs.h | 4 +
drivers/crypto/atmel-aes.c | 186 ++++++++++++++++++++++++++++++++++++++--
2 files changed, 184 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/atmel-aes-regs.h b/drivers/crypto/atmel-aes-regs.h
index 6c2951bb70b1..0ec04407b533 100644
--- a/drivers/crypto/atmel-aes-regs.h
+++ b/drivers/crypto/atmel-aes-regs.h
@@ -28,6 +28,7 @@
#define AES_MR_OPMOD_CFB (0x3 << 12)
#define AES_MR_OPMOD_CTR (0x4 << 12)
#define AES_MR_OPMOD_GCM (0x5 << 12)
+#define AES_MR_OPMOD_XTS (0x6 << 12)
#define AES_MR_LOD (0x1 << 15)
#define AES_MR_CFBS_MASK (0x7 << 16)
#define AES_MR_CFBS_128b (0x0 << 16)
@@ -67,6 +68,9 @@
#define AES_CTRR 0x98
#define AES_GCMHR(x) (0x9c + ((x) * 0x04))
+#define AES_TWR(x) (0xc0 + ((x) * 0x04))
+#define AES_ALPHAR(x) (0xd0 + ((x) * 0x04))
+
#define AES_HW_VERSION 0xFC
#endif /* __ATMEL_AES_REGS_H__ */
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 1d9e7bd3f377..b14c10e98a06 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -68,6 +68,7 @@
#define AES_FLAGS_CFB8 (AES_MR_OPMOD_CFB | AES_MR_CFBS_8b)
#define AES_FLAGS_CTR AES_MR_OPMOD_CTR
#define AES_FLAGS_GCM AES_MR_OPMOD_GCM
+#define AES_FLAGS_XTS AES_MR_OPMOD_XTS
#define AES_FLAGS_MODE_MASK (AES_FLAGS_OPMODE_MASK | \
AES_FLAGS_ENCRYPT | \
@@ -89,6 +90,7 @@ struct atmel_aes_caps {
bool has_cfb64;
bool has_ctr32;
bool has_gcm;
+ bool has_xts;
u32 max_burst_size;
};
@@ -135,6 +137,12 @@ struct atmel_aes_gcm_ctx {
atmel_aes_fn_t ghash_resume;
};
+struct atmel_aes_xts_ctx {
+ struct atmel_aes_base_ctx base;
+
+ u32 key2[AES_KEYSIZE_256 / sizeof(u32)];
+};
+
struct atmel_aes_reqctx {
unsigned long mode;
};
@@ -282,6 +290,20 @@ static const char *atmel_aes_reg_name(u32 offset, char *tmp, size_t sz)
snprintf(tmp, sz, "GCMHR[%u]", (offset - AES_GCMHR(0)) >> 2);
break;
+ case AES_TWR(0):
+ case AES_TWR(1):
+ case AES_TWR(2):
+ case AES_TWR(3):
+ snprintf(tmp, sz, "TWR[%u]", (offset - AES_TWR(0)) >> 2);
+ break;
+
+ case AES_ALPHAR(0):
+ case AES_ALPHAR(1):
+ case AES_ALPHAR(2):
+ case AES_ALPHAR(3):
+ snprintf(tmp, sz, "ALPHAR[%u]", (offset - AES_ALPHAR(0)) >> 2);
+ break;
+
default:
snprintf(tmp, sz, "0x%02x", offset);
break;
@@ -453,15 +475,15 @@ static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err)
return err;
}
-static void atmel_aes_write_ctrl(struct atmel_aes_dev *dd, bool use_dma,
- const u32 *iv)
+static void atmel_aes_write_ctrl_key(struct atmel_aes_dev *dd, bool use_dma,
+ const u32 *iv, const u32 *key, int keylen)
{
u32 valmr = 0;
/* MR register must be set before IV registers */
- if (dd->ctx->keylen == AES_KEYSIZE_128)
+ if (keylen == AES_KEYSIZE_128)
valmr |= AES_MR_KEYSIZE_128;
- else if (dd->ctx->keylen == AES_KEYSIZE_192)
+ else if (keylen == AES_KEYSIZE_192)
valmr |= AES_MR_KEYSIZE_192;
else
valmr |= AES_MR_KEYSIZE_256;
@@ -478,13 +500,19 @@ static void atmel_aes_write_ctrl(struct atmel_aes_dev *dd, bool use_dma,
atmel_aes_write(dd, AES_MR, valmr);
- atmel_aes_write_n(dd, AES_KEYWR(0), dd->ctx->key,
- SIZE_IN_WORDS(dd->ctx->keylen));
+ atmel_aes_write_n(dd, AES_KEYWR(0), key, SIZE_IN_WORDS(keylen));
if (iv && (valmr & AES_MR_OPMOD_MASK) != AES_MR_OPMOD_ECB)
atmel_aes_write_block(dd, AES_IVR(0), iv);
}
+static inline void atmel_aes_write_ctrl(struct atmel_aes_dev *dd, bool use_dma,
+ const u32 *iv)
+
+{
+ atmel_aes_write_ctrl_key(dd, use_dma, iv,
+ dd->ctx->key, dd->ctx->keylen);
+}
/* CPU transfer */
@@ -1769,6 +1797,139 @@ static struct aead_alg aes_gcm_alg = {
};
+/* xts functions */
+
+static inline struct atmel_aes_xts_ctx *
+atmel_aes_xts_ctx_cast(struct atmel_aes_base_ctx *ctx)
+{
+ return container_of(ctx, struct atmel_aes_xts_ctx, base);
+}
+
+static int atmel_aes_xts_process_data(struct atmel_aes_dev *dd);
+
+static int atmel_aes_xts_start(struct atmel_aes_dev *dd)
+{
+ struct atmel_aes_xts_ctx *ctx = atmel_aes_xts_ctx_cast(dd->ctx);
+ struct ablkcipher_request *req = ablkcipher_request_cast(dd->areq);
+ struct atmel_aes_reqctx *rctx = ablkcipher_request_ctx(req);
+ unsigned long flags;
+ int err;
+
+ atmel_aes_set_mode(dd, rctx);
+
+ err = atmel_aes_hw_init(dd);
+ if (err)
+ return atmel_aes_complete(dd, err);
+
+ /* Compute the tweak value from req->info with ecb(aes). */
+ flags = dd->flags;
+ dd->flags &= ~AES_FLAGS_MODE_MASK;
+ dd->flags |= (AES_FLAGS_ECB | AES_FLAGS_ENCRYPT);
+ atmel_aes_write_ctrl_key(dd, false, NULL,
+ ctx->key2, ctx->base.keylen);
+ dd->flags = flags;
+
+ atmel_aes_write_block(dd, AES_IDATAR(0), req->info);
+ return atmel_aes_wait_for_data_ready(dd, atmel_aes_xts_process_data);
+}
+
+static int atmel_aes_xts_process_data(struct atmel_aes_dev *dd)
+{
+ struct ablkcipher_request *req = ablkcipher_request_cast(dd->areq);
+ bool use_dma = (req->nbytes >= ATMEL_AES_DMA_THRESHOLD);
+ u32 tweak[AES_BLOCK_SIZE / sizeof(u32)];
+ static const u32 one[AES_BLOCK_SIZE / sizeof(u32)] = {cpu_to_le32(1), };
+ u8 *tweak_bytes = (u8 *)tweak;
+ int i;
+
+ /* Read the computed ciphered tweak value. */
+ atmel_aes_read_block(dd, AES_ODATAR(0), tweak);
+ /*
+ * Hardware quirk:
+ * the order of the ciphered tweak bytes need to be reverted before
+ * writing them into the ODATARx registers.
+ */
+ for (i = 0; i < AES_BLOCK_SIZE/2; ++i) {
+ u8 tmp = tweak_bytes[AES_BLOCK_SIZE - 1 - i];
+
+ tweak_bytes[AES_BLOCK_SIZE - 1 - i] = tweak_bytes[i];
+ tweak_bytes[i] = tmp;
+ }
+
+ /* Process the data. */
+ atmel_aes_write_ctrl(dd, use_dma, NULL);
+ atmel_aes_write_block(dd, AES_TWR(0), tweak);
+ atmel_aes_write_block(dd, AES_ALPHAR(0), one);
+ if (use_dma)
+ return atmel_aes_dma_start(dd, req->src, req->dst, req->nbytes,
+ atmel_aes_transfer_complete);
+
+ return atmel_aes_cpu_start(dd, req->src, req->dst, req->nbytes,
+ atmel_aes_transfer_complete);
+}
+
+static int atmel_aes_xts_setkey(struct crypto_ablkcipher *tfm, const u8 *key,
+ unsigned int keylen)
+{
+ struct atmel_aes_xts_ctx *ctx = crypto_ablkcipher_ctx(tfm);
+
+ if (keylen != AES_KEYSIZE_128 * 2 &&
+ keylen != AES_KEYSIZE_192 * 2 &&
+ keylen != AES_KEYSIZE_256 * 2) {
+ crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
+ return -EINVAL;
+ }
+
+ memcpy(ctx->base.key, key, keylen/2);
+ memcpy(ctx->key2, key + keylen/2, keylen/2);
+ ctx->base.keylen = keylen/2;
+
+ return 0;
+}
+
+static int atmel_aes_xts_encrypt(struct ablkcipher_request *req)
+{
+ return atmel_aes_crypt(req, AES_FLAGS_XTS | AES_FLAGS_ENCRYPT);
+}
+
+static int atmel_aes_xts_decrypt(struct ablkcipher_request *req)
+{
+ return atmel_aes_crypt(req, AES_FLAGS_XTS);
+}
+
+static int atmel_aes_xts_cra_init(struct crypto_tfm *tfm)
+{
+ struct atmel_aes_xts_ctx *ctx = crypto_tfm_ctx(tfm);
+
+ tfm->crt_ablkcipher.reqsize = sizeof(struct atmel_aes_reqctx);
+ ctx->base.start = atmel_aes_xts_start;
+
+ return 0;
+}
+
+static struct crypto_alg aes_xts_alg = {
+ .cra_name = "xts(aes)",
+ .cra_driver_name = "atmel-xts-aes",
+ .cra_priority = ATMEL_AES_PRIORITY,
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
+ .cra_blocksize = AES_BLOCK_SIZE,
+ .cra_ctxsize = sizeof(struct atmel_aes_xts_ctx),
+ .cra_alignmask = 0xf,
+ .cra_type = &crypto_ablkcipher_type,
+ .cra_module = THIS_MODULE,
+ .cra_init = atmel_aes_xts_cra_init,
+ .cra_exit = atmel_aes_cra_exit,
+ .cra_u.ablkcipher = {
+ .min_keysize = 2 * AES_MIN_KEY_SIZE,
+ .max_keysize = 2 * AES_MAX_KEY_SIZE,
+ .ivsize = AES_BLOCK_SIZE,
+ .setkey = atmel_aes_xts_setkey,
+ .encrypt = atmel_aes_xts_encrypt,
+ .decrypt = atmel_aes_xts_decrypt,
+ }
+};
+
+
/* Probe functions */
static int atmel_aes_buff_init(struct atmel_aes_dev *dd)
@@ -1877,6 +2038,9 @@ static void atmel_aes_unregister_algs(struct atmel_aes_dev *dd)
{
int i;
+ if (dd->caps.has_xts)
+ crypto_unregister_alg(&aes_xts_alg);
+
if (dd->caps.has_gcm)
crypto_unregister_aead(&aes_gcm_alg);
@@ -1909,8 +2073,16 @@ static int atmel_aes_register_algs(struct atmel_aes_dev *dd)
goto err_aes_gcm_alg;
}
+ if (dd->caps.has_xts) {
+ err = crypto_register_alg(&aes_xts_alg);
+ if (err)
+ goto err_aes_xts_alg;
+ }
+
return 0;
+err_aes_xts_alg:
+ crypto_unregister_aead(&aes_gcm_alg);
err_aes_gcm_alg:
crypto_unregister_alg(&aes_cfb64_alg);
err_aes_cfb64_alg:
@@ -1928,6 +2100,7 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
dd->caps.has_cfb64 = 0;
dd->caps.has_ctr32 = 0;
dd->caps.has_gcm = 0;
+ dd->caps.has_xts = 0;
dd->caps.max_burst_size = 1;
/* keep only major version number */
@@ -1937,6 +2110,7 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
dd->caps.has_cfb64 = 1;
dd->caps.has_ctr32 = 1;
dd->caps.has_gcm = 1;
+ dd->caps.has_xts = 1;
dd->caps.max_burst_size = 4;
break;
case 0x200:
--
2.7.4
^ permalink raw reply related
* [PATCH v19 12/12] fpga-manager: Add Socfpga Arria10 support
From: Moritz Fischer @ 2016-09-29 16:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160928182200.15800-13-atull@opensource.altera.com>
Hi Alan,
On Wed, Sep 28, 2016 at 11:22 AM, Alan Tull <atull@opensource.altera.com> wrote:
> +static void socfpga_a10_fpga_generate_dclks(struct a10_fpga_priv *priv,
> + u32 count)
> +{
> + u32 val;
> + unsigned int i;
> +
> + /* Clear any existing DONE status. */
> + regmap_write(priv->regmap, A10_FPGAMGR_DCLKSTAT_OFST,
> + A10_FPGAMGR_DCLKSTAT_DCLKDONE);
> +
> + /* Issue the DCLK regmap. */
> + regmap_write(priv->regmap, A10_FPGAMGR_DCLKCNT_OFST, count);
> +
> + /* wait till the dclkcnt done */
> + for (i = 0; i < 100; i++) {
> + regmap_read(priv->regmap, A10_FPGAMGR_DCLKSTAT_OFST, &val);
> + if (val)
> + break;
> + udelay(1);
> + }
It's quite new, but regmap_read_poll_timeout() might be a good fit here?
> +static int socfpga_a10_fpga_encrypted(struct fpga_manager *mgr,
> + u32 *buf32, size_t buf32_size)
> +{
> + int encrypt;
> +
> + if (buf32_size < 70)
> + return -EINVAL;
> +
> + encrypt = ((buf32[69] >> 2) & 3) != 0;
> +
> + dev_dbg(&mgr->dev, "header word %d = %08x encrypt=%d\n",
> + 69, buf32[69], encrypt);
Maybe a named constants for magic 69 / 70 value :)
> +static int socfpga_a10_fpga_compressed(struct fpga_manager *mgr,
> + u32 *buf32, size_t buf32_size)
> +{
> + int compress;
> +
> + if (buf32_size < 230)
> + return -EINVAL;
> +
> + compress = !((buf32[229] >> 1) & 1);
> +
> + dev_dbg(&mgr->dev, "header word %d = %08x compress=%d\n",
> + 229, buf32[229], compress);
> +
> + return compress;
> +}
Same here, a comment on 229/230 would work too I guess.
> +/* Start the FPGA programming by initialize the FPGA Manager */
> +static int socfpga_a10_fpga_write_init(struct fpga_manager *mgr,
> + struct fpga_image_info *info,
> + const char *buf, size_t count)
> +{
> + struct a10_fpga_priv *priv = mgr->priv;
> + unsigned int cfg_width;
> + u32 msel, stat, mask;
> + int ret;
> +
> + if (info->flags & FPGA_MGR_PARTIAL_RECONFIG)
> + cfg_width = CFGWDTH_16;
> + else
> + return -EINVAL;
So we can *only* do partial reconfig? Am I missing something here?
> + /* Do some dclks, wait for pr_ready */
> + socfpga_a10_fpga_generate_dclks(priv, 0x7ff);
Maybe a named constant?
Cheers,
Moritz
^ permalink raw reply
* [PATCH 1/1] crypto: atmel-aes: fix compiler error when VERBOSE_DEBUG is defined
From: Cyrille Pitchen @ 2016-09-29 16:46 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes a compiler error when VERBOSE_DEBUG is defined. Indeed,
in atmel_aes_write(), the 3rd argument of atmel_aes_reg_name() was
missing.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Reported-by: Levent Demir <levent.demir@inria.fr>
---
drivers/crypto/atmel-aes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index e3d40a8dfffb..1d9e7bd3f377 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -317,7 +317,7 @@ static inline void atmel_aes_write(struct atmel_aes_dev *dd,
char tmp[16];
dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
- atmel_aes_reg_name(offset, tmp));
+ atmel_aes_reg_name(offset, tmp, sizeof(tmp)));
}
#endif /* VERBOSE_DEBUG */
--
2.7.4
^ permalink raw reply related
* [PATCH 6/6] ARM: da850: adjust memory settings for tilcdc
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
Default memory settings of da850 do not meet the throughput/latency
requirements of tilcdc. This results in the image displayed being
incorrect and the following warning being displayed by the LCDC
drm driver:
tilcdc da8xx_lcdc.0: tilcdc_crtc_irq(0x00000020): FIFO underfow
Reconfigure the LCDC priority to the highest. This is a workaround
for the da850-lcdk board which has the LCD controller enabled in
the device tree, but a long-term, system-wide fix is needed for
all davinci boards.
This patch has been modified for mainline linux. It comes from a
downstream TI release for da850[1].
Original author: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
[1] http://arago-project.org/git/projects/linux-davinci.git?p=projects/linux-davinci.git;a=commitdiff;h=b9bd39a34cc02c3ba2fc15539a2f0bc2b68d25da;hp=6f6c795faa6366a4ebc1037a0235edba6018a991
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/mach-davinci/da8xx-dt.c | 43 ++++++++++++++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 4 +++
2 files changed, 47 insertions(+)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index f8ecc02..9d29670 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -44,9 +44,52 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
#ifdef CONFIG_ARCH_DAVINCI_DA850
+/*
+ * Adjust the default memory settings to cope with the LCDC
+ *
+ * REVISIT: This issue occurs on other davinci boards as well. Find
+ * a proper system-wide fix.
+ */
+static void da850_lcdc_adjust_memory_bandwidth(void)
+{
+ void __iomem *cfg_mstpri1_base;
+ void __iomem *cfg_mstpri2_base;
+ void __iomem *emifb;
+ u32 val;
+
+ /*
+ * Default master priorities in reg 0 are all lower by default than LCD
+ * which is set below to 0. Hence don't need to change here.
+ */
+
+ /* set EDMA30TC0 and TC1 to lower than LCDC (4 < 0) */
+ cfg_mstpri1_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI1_REG);
+ val = __raw_readl(cfg_mstpri1_base);
+ val &= 0xFFFF00FF;
+ val |= 4 << 8; /* 0-high, 7-low priority*/
+ val |= 4 << 12; /* 0-high, 7-low priority*/
+ __raw_writel(val, cfg_mstpri1_base);
+
+ /*
+ * Reconfigure the LCDC priority to the highest to ensure that
+ * the throughput/latency requirements for the LCDC are met.
+ */
+ cfg_mstpri2_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI2_REG);
+
+ val = __raw_readl(cfg_mstpri2_base);
+ val &= 0x0fffffff;
+ __raw_writel(val, cfg_mstpri2_base);
+
+ /* set BPRIO */
+ emifb = ioremap(DA8XX_DDR_CTL_BASE, SZ_4K);
+ __raw_writel(0x20, emifb + DA8XX_PBBPR_REG);
+ iounmap(emifb);
+}
+
static void __init da850_init_machine(void)
{
of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
+ da850_lcdc_adjust_memory_bandwidth();
}
static const char *const da850_boards_compat[] __initconst = {
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index f9f9713..5549eff 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -56,6 +56,8 @@ extern unsigned int da850_max_speed;
#define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x))
#define DA8XX_JTAG_ID_REG 0x18
#define DA8XX_HOST1CFG_REG 0x44
+#define DA8XX_MSTPRI1_REG 0x114
+#define DA8XX_MSTPRI2_REG 0x118
#define DA8XX_CHIPSIG_REG 0x174
#define DA8XX_CFGCHIP0_REG 0x17c
#define DA8XX_CFGCHIP1_REG 0x180
@@ -79,6 +81,8 @@ extern unsigned int da850_max_speed;
#define DA8XX_AEMIF_CTL_BASE 0x68000000
#define DA8XX_SHARED_RAM_BASE 0x80000000
#define DA8XX_ARM_RAM_BASE 0xffff0000
+#define DA8XX_DDR_CTL_BASE 0xB0000000
+#define DA8XX_PBBPR_REG 0x00000020
void da830_init(void);
void da850_init(void);
--
2.7.4
^ permalink raw reply related
* [PATCH 5/6] ARM: davinci: enable the LCDC DRM driver in defconfig
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
With the device tree changes for tilcdc in place, we can now enable
the driver by default in the davinci_all defconfig file.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/configs/davinci_all_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 5e5dd6b..58d04f1 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -123,6 +123,8 @@ CONFIG_TPS6507X=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_TPS6507X=y
+CONFIG_DRM=m
+CONFIG_DRM_TILCDC=m
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_DA8XX=y
--
2.7.4
^ permalink raw reply related
* [PATCH 4/6] ARM: dts: da850-lcdk: add support for 1024x768 resolution
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
Add svga timings for 1024x768 resolution to the da850-lcdk
device tree.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/boot/dts/da850-lcdk.dts | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 6ca5d48..6e4288c 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -70,8 +70,8 @@
};
display-timings {
- native-mode = <&svga_timings>;
- svga_timings: 800x600 {
+ native-mode = <&svga_timing0>;
+ svga_timing0: 800x600 {
clock-frequency = <37500000>;
hactive = <800>;
hback-porch = <140>;
@@ -82,6 +82,17 @@
vfront-porch = <1>;
vsync-len = <4>;
};
+ svga_timing1: 1024x768 {
+ clock-frequency = <72000000>;
+ hactive = <1024>;
+ hback-porch = <140>;
+ hfront-porch = <40>;
+ hsync-len = <128>;
+ vactive = <768>;
+ vback-porch = <23>;
+ vfront-porch = <1>;
+ vsync-len = <4>;
+ };
};
};
};
--
2.7.4
^ permalink raw reply related
* [PATCH 3/6] ARM: dts: da850-lcdk: enable the LCD controller
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
From: Karl Beldan <kbeldan@baylibre.com>
This adds the pins used by the LCD controller, and uses 'tilcdc,panel'
with some default timings for 800x600.
Tested on an LCDK connected on the VGA port (the LCDC is connected to
this port via a THS8135).
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
[Bartosz:
- fixed whitespace errors
- tweaked the description
- fixed the incorrect hback-porch value
- other minor tweaks]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/boot/dts/da850-lcdk.dts | 60 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 7b8ab21..6ca5d48 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -50,6 +50,40 @@
system-clock-frequency = <24576000>;
};
};
+
+ panel {
+ compatible = "ti,tilcdc,panel";
+ pinctrl-names = "default";
+ pinctrl-0 = <&lcd_pins>;
+ status = "okay";
+
+ panel-info {
+ ac-bias = <0>;
+ ac-bias-intrpt = <0>;
+ dma-burst-sz = <16>;
+ bpp = <16>;
+ fdd = <255>;
+ sync-edge = <0>;
+ sync-ctrl = <0>;
+ raster-order = <0>;
+ fifo-th = <5>;
+ };
+
+ display-timings {
+ native-mode = <&svga_timings>;
+ svga_timings: 800x600 {
+ clock-frequency = <37500000>;
+ hactive = <800>;
+ hback-porch = <140>;
+ hfront-porch = <40>;
+ hsync-len = <128>;
+ vactive = <600>;
+ vback-porch = <23>;
+ vfront-porch = <1>;
+ vsync-len = <4>;
+ };
+ };
+ };
};
&pmx_core {
@@ -84,6 +118,28 @@
0x30 0x01100000 0x0ff00000
>;
};
+
+ lcd_pins: pinmux_lcd_pins {
+ pinctrl-single,bits = <
+ /*
+ * LCD_D[2], LCD_D[3], LCD_D[4], LCD_D[5],
+ * LCD_D[6], LCD_D[7]
+ */
+ 0x40 0x22222200 0xffffff00
+ /*
+ * LCD_D[10], LCD_D[11], LCD_D[12], LCD_D[13],
+ * LCD_D[14], LCD_D[15], LCD_D[0], LCD_D[1]
+ */
+ 0x44 0x22222222 0xffffffff
+ /* LCD_D[8], LCD_D[9] */
+ 0x48 0x00000022 0x000000ff
+
+ /* LCD_PCLK */
+ 0x48 0x02000000 0x0f000000
+ /* LCD_AC_ENB_CS, LCD_VSYNC, LCD_HSYNC */
+ 0x4c 0x02000022 0x0f0000ff
+ >;
+ };
};
&serial2 {
@@ -219,3 +275,7 @@
};
};
};
+
+&lcdc {
+ status = "okay";
+};
--
2.7.4
^ permalink raw reply related
* [PATCH 2/6] ARM: dts: da850: add a node for the LCD controller
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
From: Karl Beldan <kbeldan@baylibre.com>
Add a disabled LCDC node to be reused in device trees including
da850.dtsi for boards equipped with tilcdc enabled.
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
[Bartosz: added the commit description]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/boot/dts/da850.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index f79e1b9..9f39296 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -399,6 +399,14 @@
<&edma0 0 1>;
dma-names = "tx", "rx";
};
+
+ lcdc: lcdc at 213000 {
+ compatible = "ti,am33xx-tilcdc";
+ reg = <0x213000 0x1000>;
+ interrupt-parent = <&intc>;
+ interrupts = <52>;
+ status = "disabled";
+ };
};
aemif: aemif at 68000000 {
compatible = "ti,da850-aemif";
--
2.7.4
^ permalink raw reply related
* [PATCH 1/6] ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for lcdc
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com>
From: Karl Beldan <kbeldan@baylibre.com>
This is required for tilcdc to be able to acquire a functional clock.
Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
[Bartosz: added the commit description]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/mach-davinci/da8xx-dt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index c9f7e92..f8ecc02 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -38,6 +38,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
NULL),
OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
+ OF_DEV_AUXDATA("ti,am33xx-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL),
{}
};
--
2.7.4
^ permalink raw reply related
* [PATCH 0/6] ARM: davinci: da850-lcdk: add support for tilcdc
From: Bartosz Golaszewski @ 2016-09-29 16:31 UTC (permalink / raw)
To: linux-arm-kernel
This series enables the tilcdc support for da850-lcdk. Besides the
device tree changes it contains some tweaks needed to make it work.
Tested with a da850-lcdk board with an LCD display connected over
VGA with the following modes:
modetest -M tilcdc -s 26:800x600 at RG16
modetest -M tilcdc -s 26:1024x768 at RG16
Rebased on top of some necessary changes in the tilcdc drm driver.
These changes will go upstream through the drm tree.
Bartosz Golaszewski (3):
ARM: dts: da850-lcdk: add support for 1024x768 resolution
ARM: davinci: enable the LCDC DRM driver in defconfig
ARM: da850: adjust memory settings for tilcdc
Karl Beldan (3):
ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for lcdc
ARM: dts: da850: add a node for the LCD controller
ARM: dts: da850-lcdk: enable the LCD controller
arch/arm/boot/dts/da850-lcdk.dts | 71 ++++++++++++++++++++++++++++++
arch/arm/boot/dts/da850.dtsi | 8 ++++
arch/arm/configs/davinci_all_defconfig | 2 +
arch/arm/mach-davinci/da8xx-dt.c | 44 ++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 4 ++
5 files changed, 129 insertions(+)
--
2.7.4
^ permalink raw reply
* [PATCH] KVM: arm/arm64: Fix occasional warning from the timer work function
From: Christoffer Dall @ 2016-09-29 16:26 UTC (permalink / raw)
To: linux-arm-kernel
When a VCPU blocks (WFI) we arm (the verb, not the architecture) any
timers scheduled to expire in the future to wake up the vcpu thread when
appropriate. Because such as wake up involves a vcpu kick, and the
timer expire function can get called from interrupt context, and the
kick may sleep, we have to schedule the kick in the work function.
The work function currently has a warning that gets raised if it turns
out that the timer shouldn't fire when it's run, which was added because
the idea was that then the work should never have been cancelled.
However, the work function can run long after a vcpu thread gets
scheduled again and the timer conditions can have changed as a result of
running the vcpu, which would raise this warning. This can happen on a
busy system, for example.
The solution is to simply not raise this warning, because a kick is
never harmful. Also, cancel any scheduled work when the vcpu thread is
running anyway, since there is no need to run the work function anymore.
Reported-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
virt/kvm/arm/arch_timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 27a1f63..e136902 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -91,8 +91,6 @@ static void kvm_timer_inject_irq_work(struct work_struct *work)
vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired);
vcpu->arch.timer_cpu.armed = false;
- WARN_ON(!kvm_timer_should_fire(vcpu));
-
/*
* If the vcpu is blocked we want to wake it up so that it will see
* the timer has expired when entering the guest.
@@ -240,6 +238,9 @@ void kvm_timer_unschedule(struct kvm_vcpu *vcpu)
{
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
timer_disarm(timer);
+
+ /* No need for another thread to kick us if we're already running */
+ cancel_work_sync(&timer->expired);
}
/**
--
2.9.0
^ permalink raw reply related
* [PATCH] clocksource: arm_arch_timer: Don't assume clock runs in suspend
From: Marc Zyngier @ 2016-09-29 16:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160928012309.GA29518@localhost>
On Tue, 27 Sep 2016 18:23:11 -0700
Brian Norris <briannorris@chromium.org> wrote:
Hi Brian,
> Hi Marc,
>
> Thanks again for the help. I was checking with Rockchip on the details.
>
> On Tue, Sep 20, 2016 at 08:47:07AM +0100, Marc Zyngier wrote:
> > The counter is allowed to be clocked at a different rate, as long as it
> > is incremented by the frequency ratio on each tick of the new frequency.
> > In your case, the counter should increment by 750 on each tick of the
> > 32kHz clock. If the rk3399 implementation doesn't do this, then this is
> > a bug, and we need a quirk to work around it.
>
> I had hope that we could find a switch that would do the above for
> rk3399, since other parts of the system (e.g., the PMU itself) support
> switching from the 24MHz to 32KHz clock, but Rockchip confirmed that it
> is indeed a HW quirk that the arch timer's counter does not support
> clocking out ticks based on the 32KHz clock. So I'm planning to send a
> v2 that adds a "arm,no-tick-in-suspend" property.
Fair enough.
>
> <Begin side note>
> rk3288 (ARMv7 system widely used for our Chromebooks) has the same
> issue, except the kernel we're using for production (based on v3.14)
> doesn't have the following commit, which stopped utilizing the RTC:
>
> commit 0fa88cb4b82b5cf7429bc1cef9db006ca035754e
> Author: Xunlei Pang <pang.xunlei@linaro.org>
> Date: Wed Apr 1 20:34:38 2015 -0700
>
> time, drivers/rtc: Don't bother with rtc_resume() for the nonstop clocksource
>
> And any mainline testing on rk3288 doesn't see the problem, because
> mainline doesn't support its lowest-power sleep modes well enough (see
> ROCKCHIP_ARM_OFF_LOGIC_DEEP in arch/arm/mach-rockchip/pm.c).
Arghh... So even my favourite Chromebook (from which I'm typing this
email) is affected? Not very nice...
> <End side note>
>
> > Note that such a quirk will have some other impacts, such as the
> > gettimeofday implementation in the VDSO (which relies on the counter
> > making forward progress). There could be other issues in the timer
> > subsystem as well... This doesn't look like a pleasant thing to fix.
>
> How sure are you of these problems? I'm a bit new to the kernel
> timekeeping subsystem, but doesn't this kind of code already have to
> handle time adjustments like this when reprogramming the system time
> (settimeofday())? And might we be covered for the suspend/resume case
> when we allow the kernel to fall back to the RTC instead, which adjusts
> the sleep delta with timekeeping_inject_sleeptime64()? And (weaker
> evidence here) we haven't seen problems on rk3288 so far, at least
> without the above referenced rtc commit 0fa88cb4b82. But admittedly
> there are some differences between arch/{arm,arm64}/.
The 32bit port only gained a VDSO recently (3.14 doesn't have it), and
mainline doesn't switch the counter off, as you noted above.
As for the 64bit kernel, it would be interesting to verify that on
resume, the VDSO does return the right (corrected) value, and not
something stale.
Thanks,
M.
--
Jazz is not dead. It just smells funny.
^ permalink raw reply
* [PATCH] dmaengine: pxa_dma: remove unused function
From: Robert Jarzmik @ 2016-09-29 15:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475154561-12327-1-git-send-email-baoyou.xie@linaro.org>
Baoyou Xie <baoyou.xie@linaro.org> writes:
> We get 1 warning when building kernel with W=1:
> drivers/dma/pxa_dma.c:1525:5: warning: no previous prototype for 'pxad_toggle_reserved_channel' [-Wmissing-prototypes]
>
> In fact, this function is called by no one, so this patch removes it.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Okay, yet I'd rather have a revert of commit c91134d91944 ("dmaengine: pxa_dma:
add support for legacy transition") , with the commit message saying:
The conversion of the pxa architecture is now finished for all drivers, so this
functions has fullfilled its purpose and can now be removed.
I have a similar patch in my internal tree, but yours can very well go in, as
long as it is a revert with a statement explaining why it is necessary now and
not before.
Cheers.
--
Robert
^ permalink raw reply
* [PATCH] arm64: KVM: Take S1 walks into account when determining S2 write faults
From: Marc Zyngier @ 2016-09-29 15:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475149021-13288-1-git-send-email-will.deacon@arm.com>
On Thu, 29 Sep 2016 12:37:01 +0100
Will Deacon <will.deacon@arm.com> wrote:
> The WnR bit in the HSR/ESR_EL2 indicates whether a data abort was
> generated by a read or a write instruction. For stage 2 data aborts
> generated by a stage 1 translation table walk (i.e. the actual page
> table access faults at EL2), the WnR bit therefore reports whether the
> instruction generating the walk was a load or a store, *not* whether the
> page table walker was reading or writing the entry.
>
> For page tables marked as read-only at stage 2 (e.g. due to KSM merging
> them with the tables from another guest), this could result in livelock,
> where a page table walk generated by a load instruction attempts to
> set the access flag in the stage 1 descriptor, but fails to trigger
> CoW in the host since only a read fault is reported.
>
> This patch modifies the arm64 kvm_vcpu_dabt_iswrite function to
> take into account stage 2 faults in stage 1 walks. Since DBM cannot be
> disabled at EL2 for CPUs that implement it, we assume that these faults
> are always causes by writes, avoiding the livelock situation at the
> expense of occasional, spurious CoWs.
>
> We could, in theory, do a bit better by checking the guest TCR
> configuration and inspecting the page table to see why the PTE faulted.
> However, I doubt this is measurable in practice, and the threat of
> livelock is real.
>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Cc: Julien Grall <julien.grall@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/include/asm/kvm_emulate.h | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index 4cdeae3b17c6..948a9a8a9297 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -167,11 +167,6 @@ static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
> }
>
> -static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
> -{
> - return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR);
> -}
> -
> static inline bool kvm_vcpu_dabt_issext(const struct kvm_vcpu *vcpu)
> {
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SSE);
> @@ -192,6 +187,12 @@ static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
> }
>
> +static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
> +{
> + return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
> + kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
> +}
> +
> static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
> {
> return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Thanks,
M.
--
Jazz is not dead. It just smells funny.
^ permalink raw reply
* [PATCH 0/3] Support userspace irqchip with arch timers
From: Alexander Graf @ 2016-09-29 15:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160927190806.22988-1-christoffer.dall@linaro.org>
On 09/27/2016 09:08 PM, Christoffer Dall wrote:
> Hi Alex,
>
> Marc and I have been looking at this during Linaro connect and have
> slightly reworked your patch into this small series.
>
> It would be good if you could have a look at it and test it out.
Tested-by: Alexander Graf <agraf@suse.de>
Works fine so far :).
> I've tested it with your QEMU, and it works for UP, but secondary CPUs
> fail to come up, and it looks like the kernel never gets an IPI for
> those CPUs from userspace. Any chance you're willing to take a look at
> that?
I can try, but not very soon. I doubt it's something fundamental - we
probably just don't synchronize kvm/qemu state properly on IPIs (read: a
QEMU bug).
> Also, let me know if the split of your patch with preserving your
> authorship is ok with you.
Works for me :)
Alex
^ permalink raw reply
* [PATCH v2] arm64: make rpm failed due to incorrect path to Image.gz
From: Vadim Lomovtsev @ 2016-09-29 14:46 UTC (permalink / raw)
To: linux-arm-kernel
The "make rpm" and "make rpm-pkg" commands for arm64 platform
are broken due to rpmbuild couldn't find Image.gz file at
default location (which is kernel src root):
cp: cannot stat 'Image.gz': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.ocFBmP (%install)
While the correct path to arm64 kernel image file
is "arch/arm64/boot/Image.gz".
The exact file name (Image.gz) is stored at KBUILD_IMAGE variable
and read by rpmbuild with "make image_name" command at
install phase after kernel build is complete.
Accordingly to Michal's Marek comment the KBUILD_IMAGE
variable has to be set to point to actual file.
Since the KBUILD_IMAGE variable is used in general cases of
build we need to prevent other build types breakage by changing it.
The solution is to add to arch/arm64/Makefie extra target "image_name"
with dependency "KBUILD_IMAGE:=<proper path to Image.gz file>".
Thus it will allow to set proper path to Image.gz file only for
the "image_name" build target and this exact value will be picked up
while rpm build install phase.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ab51aed..09926d3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -101,6 +101,8 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
boot := arch/arm64/boot
+image_name: KBUILD_IMAGE :=$(boot)/$(KBUILD_IMAGE)
+
Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
--
1.8.3.1
^ permalink raw reply related
* [PULL 00/50] KVM/ARM Changes for v4.9
From: Radim Krčmář @ 2016-09-29 14:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160927180558.14699-1-christoffer.dall@linaro.org>
2016-09-27 20:05+0200, Christoffer Dall:
> Hi Paolo and Radim,
>
> Here are the KVM/ARM Changes for v4.9. They include:
>
> - Various cleanups and removal of redundant code
> - Two important fixes for not using an in-kernel irqchip
> - A bit of optimizations
> - Handle SError exceptions and present them to guests if appropriate
> - Proxying of GICV access at EL2 if guest mappings are unsafe
> - GICv3 on AArch32 on ARMv8
> - Preparations for GICv3 save/restore, including ABI docs
Pulled to kvm/next, thanks.
^ permalink raw reply
* [PATCH] arm64: make rpm failed due to incorrect path to Image.gz
From: Lomovtsev, Vadim @ 2016-09-29 14:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159543-2519-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com>
The mcommit message is not correct.
Sorry guys, please ignore this.
Vadim.
________________________________________
From: Lomovtsev, Vadim
Sent: Thursday, September 29, 2016 5:32:23 PM
To: linux-arm-kernel at lists.infradead.org; mmarek at suse.com
Cc: Lomovtsev, Vadim
Subject: [PATCH] arm64: make rpm failed due to incorrect path to Image.gz
The "make rpm" and "make rpm-pkg" commands for arm64 platform are broken
due to rpmbuild couldn't find Image.gz file at default location (which
is kernel src root):
cp: cannot stat 'Image.gz': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.ocFBmP (%install)
While the correct path to arm64 kernel image file
is "arch/arm64/boot/Image.gz".
The exact file name (Image.gz) is stored at KBUILD_IMAGE variable
and read by rpmbuild with "make image_name" command at
install phase after kernel build is complete.
Accordingly to Michal's Marek comment it is necesary
that the KBUILD_IMAGE variable value has to be set
accordingly to point to actual file and thus fix that issue.
Since the KBUILD_IMAGE variable is used in general cases of
build we need to prevent other build types breakage by changing it.
The solution is to add to arch/arm64/Makefie extra target "image_name"
with dependency "KBUILD_IMAGE:=<proper path to Image.gz file>".
Thus it will allow to set proper path to Image.gz file only for
the "image_name" build target and this exact value will be picked up
while rpm build install phase.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index ab51aed..09926d3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -101,6 +101,8 @@ all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
boot := arch/arm64/boot
+image_name: KBUILD_IMAGE :=$(boot)/$(KBUILD_IMAGE)
+
Image: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
--
1.8.3.1
^ permalink raw reply related
* [PATCH 08/27] perf evsel: Add support for address filters
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
This patch makes it possible to use the current filter framework with
address filters. That way address filters for HW tracers such as
CoreSight and Intel PT can be communicated to the kernel drivers.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-4-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.c | 5 +++++
tools/perf/util/evsel.h | 2 ++
tools/perf/util/parse-events.c | 39 ++++++++++++++++++++++++++++++++++-----
3 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3b4e7c452e43..380e84c3af3d 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1067,6 +1067,11 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
}
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
+{
+ return perf_evsel__append_filter(evsel, "%s,%s", filter);
+}
+
int perf_evsel__enable(struct perf_evsel *evsel)
{
int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 1f8c48f87f7d..b1503b0ecdff 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,6 +236,8 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel,
+ const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 16bf09cc3e8d..33546c3ac1fe 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1760,20 +1760,49 @@ foreach_evsel_in_last_glob(struct perf_evlist *evlist,
static int set_filter(struct perf_evsel *evsel, const void *arg)
{
const char *str = arg;
+ bool found = false;
+ int nr_addr_filters = 0;
+ struct perf_pmu *pmu = NULL;
- if (evsel == NULL || evsel->attr.type != PERF_TYPE_TRACEPOINT) {
- fprintf(stderr,
- "--filter option should follow a -e tracepoint option\n");
- return -1;
+ if (evsel == NULL)
+ goto err;
+
+ if (evsel->attr.type == PERF_TYPE_TRACEPOINT) {
+ if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+ fprintf(stderr,
+ "not enough memory to hold filter string\n");
+ return -1;
+ }
+
+ return 0;
}
- if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+ while ((pmu = perf_pmu__scan(pmu)) != NULL)
+ if (pmu->type == evsel->attr.type) {
+ found = true;
+ break;
+ }
+
+ if (found)
+ perf_pmu__scan_file(pmu, "nr_addr_filters",
+ "%d", &nr_addr_filters);
+
+ if (!nr_addr_filters)
+ goto err;
+
+ if (perf_evsel__append_addr_filter(evsel, str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
}
return 0;
+
+err:
+ fprintf(stderr,
+ "--filter option should follow a -e tracepoint or HW tracer option\n");
+
+ return -1;
}
int parse_filter(const struct option *opt, const char *str,
--
2.7.4
^ permalink raw reply related
* [PATCH 07/27] perf evsel: New tracepoint specific function
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
Making function perf_evsel__append_filter() static and introducing a new
tracepoint specific function to append filters. That way we eliminate
redundant code and avoid formatting mistake.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-3-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 7 +++----
tools/perf/util/evsel.c | 9 +++++++--
tools/perf/util/evsel.h | 3 +--
tools/perf/util/parse-events.c | 4 ++--
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index e04ba9d852d4..c298bd3e1d90 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2151,11 +2151,10 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
if (filter == NULL)
goto out_enomem;
- if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
- "(%s) && (%s)", filter)) {
+ if (!perf_evsel__append_tp_filter(trace->syscalls.events.sys_enter,
+ filter)) {
sys_exit = trace->syscalls.events.sys_exit;
- err = perf_evsel__append_filter(sys_exit,
- "(%s) && (%s)", filter);
+ err = perf_evsel__append_tp_filter(sys_exit, filter);
}
free(filter);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 4f327b522e5c..3b4e7c452e43 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1045,8 +1045,8 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
return -1;
}
-int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *fmt, const char *filter)
+static int perf_evsel__append_filter(struct perf_evsel *evsel,
+ const char *fmt, const char *filter)
{
char *new_filter;
@@ -1062,6 +1062,11 @@ int perf_evsel__append_filter(struct perf_evsel *evsel,
return -1;
}
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
+{
+ return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
+}
+
int perf_evsel__enable(struct perf_evsel *evsel)
{
int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 7ef960298b3d..1f8c48f87f7d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -235,8 +235,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
bool use_sample_identifier);
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
-int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *fmt, const char *filter);
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index b14784c765eb..16bf09cc3e8d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
return -1;
}
- if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
+ if (perf_evsel__append_tp_filter(evsel, str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
- if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
+ if (perf_evsel__append_tp_filter(evsel, new_filter) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
--
2.7.4
^ permalink raw reply related
* [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475159756-21326-1-git-send-email-acme@kernel.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
By making function perf_evsel__append_filter() take a format rather than
an operator it is possible to reuse the code for other purposes (ex.
Intel PT and CoreSight) than tracepoints.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-2-git-send-email-mathieu.poirier at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 9 +++++++--
tools/perf/util/evsel.c | 4 ++--
tools/perf/util/evsel.h | 2 +-
tools/perf/util/parse-events.c | 4 ++--
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 1a54ce9d101c..e04ba9d852d4 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2143,6 +2143,7 @@ out_delete_sys_enter:
static int trace__set_ev_qualifier_filter(struct trace *trace)
{
int err = -1;
+ struct perf_evsel *sys_exit;
char *filter = asprintf_expr_inout_ints("id", !trace->not_ev_qualifier,
trace->ev_qualifier_ids.nr,
trace->ev_qualifier_ids.entries);
@@ -2150,8 +2151,12 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
if (filter == NULL)
goto out_enomem;
- if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter, "&&", filter))
- err = perf_evsel__append_filter(trace->syscalls.events.sys_exit, "&&", filter);
+ if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
+ "(%s) && (%s)", filter)) {
+ sys_exit = trace->syscalls.events.sys_exit;
+ err = perf_evsel__append_filter(sys_exit,
+ "(%s) && (%s)", filter);
+ }
free(filter);
out:
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f3225a2e6eee..4f327b522e5c 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1046,14 +1046,14 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
}
int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *op, const char *filter)
+ const char *fmt, const char *filter)
{
char *new_filter;
if (evsel->filter == NULL)
return perf_evsel__set_filter(evsel, filter);
- if (asprintf(&new_filter,"(%s) %s (%s)", evsel->filter, op, filter) > 0) {
+ if (asprintf(&new_filter, fmt, evsel->filter, filter) > 0) {
free(evsel->filter);
evsel->filter = new_filter;
return 0;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 323806082c58..7ef960298b3d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,7 +236,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
int perf_evsel__append_filter(struct perf_evsel *evsel,
- const char *op, const char *filter);
+ const char *fmt, const char *filter);
int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2eb8b1ed4cc8..b14784c765eb 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
return -1;
}
- if (perf_evsel__append_filter(evsel, "&&", str) < 0) {
+ if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
- if (perf_evsel__append_filter(evsel, "&&", new_filter) < 0) {
+ if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
fprintf(stderr,
"not enough memory to hold filter string\n");
return -1;
--
2.7.4
^ permalink raw reply related
* [GIT PULL 00/27] perf/core improvements and fixes
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
To: linux-arm-kernel
Hi Ingo,
Please consider pulling, more to come soon,
- Arnaldo
Build and test results at the end of this message.
The following changes since commit 6b652de2b27c0a4020ce0e8f277e782b6af76096:
Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-23 07:21:38 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160929
for you to fetch changes up to d18019a53a07e009899ff6b8dc5ec30f249360d9:
perf tests: Add dwarf unwind test for powerpc (2016-09-29 11:18:21 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
-------------
New features:
- Add support for using symbols in address filters with Intel PT and ARM
CoreSight (hardware assisted tracing facilities) (Adrian Hunter, Mathieu Poirier)
Fixes:
- Fix MMAP event synthesis for pre-existing threads when no hugetlbfs
mount is in place (Adrian Hunter)
- Don't ignore kernel idle symbols in 'perf script' (Adrian Hunter)
- Assorted Intel PT fixes (Adrian Hunter)
Improvements:
- Fix handling of C++ symbols in 'perf probe' (Masami Hiramatsu)
- Beautify sched_[gs]et_attr return value in 'perf trace' (Arnaldo Carvalho de Melo)
Infrastructure:
---------------
New features:
- Add dwarf unwind 'perf test' for powerpc (Ravi Bangoria)
Fixes:
- Fix error paths in 'perf record' (Adrian Hunter)
Documentation:
- Update documentation info about quipper, a C++ parser for converting
to/from perf.data/chromium profiling format (Simon Que)
Build Fixes:
Fix building in 32 bit platform with libbabeltrace (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (16):
perf record: Fix documentation 'event_sources' -> 'event_source'
perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
perf script: Fix vanished idle symbols
perf record: Rename label 'out_symbol_exit'
perf record: Fix error paths
perf symbols: Add dso__last_symbol()
perf record: Add support for using symbols in address filters
perf probe: Increase debug level of SDT debug messages
perf intel-pt: Fix snapshot overlap detection decoder errors
perf intel-pt: Add support for recording the max non-turbo ratio
perf intel-pt: Fix missing error codes processing auxtrace_info
perf intel-pt: Add a helper function for processing AUXTRACE_INFO
perf intel-pt: Record address filter in AUXTRACE_INFO event
perf intel-pt: Read address filter from AUXTRACE_INFO event
perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
perf intel-pt: Fix decoding when there are address filters
Arnaldo Carvalho de Melo (1):
perf trace: Beautify sched_[gs]et_attr return value
Masami Hiramatsu (4):
perf probe: Ignore the error of finding inline instance
perf probe: Skip if the function address is 0
perf probe: Fix to cut off incompatible chars from group name
perf probe: Match linkage name with mangled name
Mathieu Poirier (3):
perf tools: Make perf_evsel__append_filter() generic
perf evsel: New tracepoint specific function
perf evsel: Add support for address filters
Ravi Bangoria (1):
perf tests: Add dwarf unwind test for powerpc
Simon Que (1):
perf tools: Update documentation info about quipper
Wang Nan (1):
perf data: Fix building in 32 bit platform with libbabeltrace
tools/perf/Documentation/perf-record.txt | 61 +-
tools/perf/Documentation/perf.data-file-format.txt | 6 +-
tools/perf/arch/powerpc/Build | 1 +
tools/perf/arch/powerpc/include/arch-tests.h | 13 +
tools/perf/arch/powerpc/include/perf_regs.h | 2 +
tools/perf/arch/powerpc/tests/Build | 4 +
tools/perf/arch/powerpc/tests/arch-tests.c | 15 +
tools/perf/arch/powerpc/tests/dwarf-unwind.c | 62 ++
tools/perf/arch/powerpc/tests/regs_load.S | 94 +++
tools/perf/arch/x86/util/intel-pt.c | 57 +-
tools/perf/builtin-record.c | 32 +-
tools/perf/builtin-trace.c | 10 +-
tools/perf/tests/Build | 2 +-
tools/perf/tests/dwarf-unwind.c | 2 +-
tools/perf/util/auxtrace.c | 737 +++++++++++++++++++++
tools/perf/util/auxtrace.h | 54 ++
tools/perf/util/build-id.c | 4 +-
tools/perf/util/data-convert-bt.c | 2 +-
tools/perf/util/dwarf-aux.c | 28 +-
tools/perf/util/dwarf-aux.h | 3 +
tools/perf/util/event.c | 3 +-
tools/perf/util/evsel.c | 16 +-
tools/perf/util/evsel.h | 5 +-
tools/perf/util/evsel_fprintf.c | 7 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 30 +
.../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 +
tools/perf/util/intel-pt.c | 172 ++++-
tools/perf/util/intel-pt.h | 4 +-
tools/perf/util/parse-events.c | 41 +-
tools/perf/util/probe-event.c | 10 +-
tools/perf/util/probe-file.c | 2 +-
tools/perf/util/probe-finder.c | 17 +-
tools/perf/util/symbol.c | 15 +
tools/perf/util/symbol.h | 1 +
34 files changed, 1451 insertions(+), 62 deletions(-)
create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
create mode 100644 tools/perf/arch/powerpc/tests/Build
create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S
# time dm
1 alpine:3.4: Ok
2 android-ndk:r12b-arm: Ok
3 archlinux:latest: Ok
4 centos:5: Ok
5 centos:6: Ok
6 centos:7: Ok
7 debian:7: Ok
8 debian:8: Ok
9 debian:experimental: Ok
10 fedora:20: Ok
11 fedora:21: Ok
12 fedora:22: Ok
13 fedora:23: Ok
14 fedora:24: Ok
15 fedora:24-x-ARC-uClibc: Ok
16 fedora:rawhide: Ok
17 mageia:5: Ok
18 opensuse:13.2: Ok
19 opensuse:42.1: Ok
20 opensuse:tumbleweed: Ok
21 ubuntu:12.04.5: Ok
22 ubuntu:14.04: Ok
23 ubuntu:14.04.4: Ok
24 ubuntu:15.10: Ok
25 ubuntu:16.04: Ok
26 ubuntu:16.04-x-arm: Ok
27 ubuntu:16.04-x-arm64: Ok
28 ubuntu:16.04-x-powerpc: Ok
29 ubuntu:16.04-x-powerpc64: Ok
30 ubuntu:16.04-x-powerpc64el: Ok
31 ubuntu:16.04-x-s390: Ok
32 ubuntu:16.10: Ok
33 2246.21
real 37m26.862s
user 0m2.148s
sys 0m2.256s
#
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: detect openat syscall event : Ok
3: detect openat syscall event on all cpus : Ok
4: read samples using the mmap interface : Ok
5: parse events tests : Ok
6: Validate PERF_RECORD_* events & perf_sample fields : Ok
7: Test perf pmu format parsing : Ok
8: Test dso data read : Ok
9: Test dso data cache : Ok
10: Test dso data reopen : Ok
11: roundtrip evsel->name check : Ok
12: Check parsing of sched tracepoints fields : Ok
13: Generate and check syscalls:sys_enter_openat event fields: Ok
14: struct perf_event_attr setup : Ok
15: Test matching and linking multiple hists : Ok
16: Try 'import perf' in python, checking link problems : Ok
17: Test breakpoint overflow signal handler : Ok
18: Test breakpoint overflow sampling : Ok
19: Test number of exit event of a simple workload : Ok
20: Test software clock events have valid period values : Ok
21: Test object code reading : Ok
22: Test sample parsing : Ok
23: Test using a dummy software event to keep tracking : Ok
24: Test parsing with no sample_id_all bit set : Ok
25: Test filtering hist entries : Ok
26: Test mmap thread lookup : Ok
27: Test thread mg sharing : Ok
28: Test output sorting of hist entries : Ok
29: Test cumulation of child hist entries : Ok
30: Test tracking with sched_switch : Ok
31: Filter fds with revents mask in a fdarray : Ok
32: Add fd to a fdarray, making it autogrow : Ok
33: Test kmod_path__parse function : Ok
34: Test thread map : Ok
35: Test LLVM searching and compiling :
35.1: Basic BPF llvm compiling test : Ok
35.2: Test kbuild searching : Ok
35.3: Compile source for BPF prologue generation test : Ok
35.4: Compile source for BPF relocation test : Ok
36: Test topology in session : Ok
37: Test BPF filter :
37.1: Test basic BPF filtering : Ok
37.2: Test BPF prologue generation : Ok
37.3: Test BPF relocation checker : Ok
38: Test thread map synthesize : Ok
39: Test cpu map synthesize : Ok
40: Test stat config synthesize : Ok
41: Test stat synthesize : Ok
42: Test stat round synthesize : Ok
43: Test attr update synthesize : Ok
44: Test events times : Ok
45: Test backward reading from ring buffer : Ok
46: Test cpu map print : Ok
47: Test SDT event probing : Ok
48: Test is_printable_array function : Ok
49: Test bitmap print : Ok
50: x86 rdpmc test : Ok
51: Test converting perf time to TSC : Ok
52: Test dwarf unwind : Ok
53: Test x86 instruction decoder - new instructions : Ok
54: Test intel cqm nmi context read : Skip
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
tarpkg: ./tests/perf-targz-src-pkg .
make_debug_O: make DEBUG=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_slang_O: make NO_SLANG=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_libbpf_O: make NO_LIBBPF=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_tags_O: make tags
make_doc_O: make doc
make_no_libunwind_O: make NO_LIBUNWIND=1
make_install_bin_O: make install-bin
make_no_libbionic_O: make NO_LIBBIONIC=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_demangle_O: make NO_DEMANGLE=1
make_perf_o_O: make perf.o
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_pure_O: make
make_util_map_o_O: make util/map.o
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_newt_O: make NO_NEWT=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_help_O: make help
make_install_prefix_O: make install prefix=/tmp/krava
make_static_O: make LDFLAGS=-static
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_clean_all_O: make clean all
make_install_O: make install
make_no_libelf_O: make NO_LIBELF=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_gtk2_O: make NO_GTK2=1
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply
* [PATCH] Adding Support for Coresight Components on Zynq 7000.
From: Sören Brinkmann @ 2016-09-29 14:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <c6836102-9b7e-a9d9-bad9-34b100d4ae49@supelec.fr>
Hi Muhammad,
On Thu, 2016-09-29 at 12:26:13 +0200, Muhammad Abdul WAHAB wrote:
> The Coresight components are present on the Zynq SoC but the corresponding
> device tree entries are missing. This patch adds device tree entries for
> coresight components while explaining how it was done in order to allow
> porting towards other boards easily.
>
> By adding the entries for Coresight components in the device tree: if no
> files are created in sysfile system, you need to contact the board designer
> to sort out the problem. On some boards, Coresight components are not
> powered on boot.
>
> Signed-off-by: Muhammad Abdul Wahab <muhammadabdul.wahab@centralesupelec.fr>
> ---
> The documentation file was very helpful
> (Documentation/devicetree/bindings/arm/coresight.txt). However, few details
> can be added to make it more clear for beginners.
>
> Things to modify in device tree when changing the board are mainly:
>
> - address
> - `clocks` field
> - some references in other entries may be missing (e.g. for `CPU` field in
> ETM/PTM component, references need to be created)
>
> Furthermore, the `reg` field should be adapted according to
> `#address-cells` and `#size-cells`. It may appear obvious, not for
> beginners.
>
> ## Testing
>
> The trace sink components need to be enabled by accessing through sysfile
> system.
>
> echo 1 > /sys/bus/coresight/devices/@addr.etb/enable\_sink
>
> Then enable the CS source component:
>
> echo 1 > /sys/bus/coresight/devices/@addr.ptm/enable\_source
>
> By default, CS Source components are configured to trace the kernel.
>
> Then the trace can be read by dumping ETB.
>
> dd if=/dev/@addr.etb of=trace_kernel.bin
>
> The trace can be visualized by:
>
> hexdump -C trace_kernel.bin
>
> Or stored using:
>
> hexdump -C trace_kernel.bin > trace_kernel.txt
>
> The trace need to be decoded to be readable. All these above steps can now
> be performed with Perf Library which was not available at the time I was
> playing with DT entries.
I'm curious, did you test that with external debug tools. I have the
feeling the kernel using the debug HW could interfere with JTAG
debuggers, external trace tools, etc.
>
> --- linux-4.7/arch/arm/boot/dts/zynq-7000.dtsi.orig 2016-07-24
> 21:23:50.000000000 +0200
> +++ linux-4.7/arch/arm/boot/dts/zynq-7000.dtsi 2016-09-28
> 19:13:52.651881000 +0200
> @@ -363,5 +363,159 @@
> reg = <0xf8005000 0x1000>;
> timeout-sec = <10>;
> };
> +
> + etb at F8801000 {
> + compatible = "arm,coresight-etb10", "arm,primecell";
> + reg = <0xf8801000 0x1000>;
> + coresight-default-sink;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint at 0 {
> + slave-mode;
> + remote-endpoint = <0x8>;
Use labels please.
> + linux,phandle = <0xd>;
> + phandle = <0xd>;
Do these phandle properties need to be here?
> + };
> + };
> + };
> +
> + tpiu at F8803000 {
> + compatible = "arm,coresight-tpiu", "arm,primecell";
> + reg = <0xf8803000 0x1000>;
> + clocks = <&clkc 47>, <&clkc 16>;
I'm not sure this is correct for every setup. Sorry, that I don't recall
all the details, I haven't used tracing in a long time. But I guess this
clock is configurable as you're referring an fclk here. The other thing
that makes me a little suspicious is, that nothing in here uses the
'dbg_trc' clock that the clock controller provides.
> + clock-names = "apb_pclk", "fclk1";
Those names (at least fclk1) is not a good name for tpiu to identify
it's input. fclk1 is a zynq-specific clock, and as mentioned above, it
seems likely that this could easily become a different one. The
clock-names are meant to identify an input from the consumer's
perspective. The correct names should be documented in the DT binding.
> + clock-frequency=<0xee6b280>;
I cannot find this property in the binding.
> +
> + port {
> +
> + endpoint at 0 {
> + slave-mode;
> + remote-endpoint = <0x9>;
> + linux,phandle = <0xe>;
> + phandle = <0xe>;
> + };
> + };
> + };
> +
> + funnel at F8804000 {
> + compatible = "arm,coresight-funnel", "arm,primecell";
> + reg = <0xf8804000 0x1000>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + ports {
> + #address-cells = <0x1>;
> + #size-cells = <0x0>;
> +
> + port at 0 {
> + reg = <0x0>;
> +
> + endpoint {
> + remote-endpoint = <0xa>;
> + linux,phandle = <0xf>;
> + phandle = <0xf>;
> + };
> + };
> +
> + port at 1 {
> + reg = <0x0>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xb>;
> + linux,phandle = <0x11>;
> + phandle = <0x11>;
> + };
> + };
> +
> + port at 2 {
> + reg = <0x1>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xc>;
> + linux,phandle = <0x13>;
> + phandle = <0x13>;
> + };
> + };
> + };
> + };
> +
> + replicator {
> + compatible = "arm,coresight-replicator";
> +
> + ports {
> + #address-cells = <0x1>;
> + #size-cells = <0x0>;
> +
> + port at 0 {
> + reg = <0x0>;
> +
> + endpoint {
> + remote-endpoint = <0xd>;
> + linux,phandle = <0x8>;
> + phandle = <0x8>;
> + };
> + };
> +
> + port at 1 {
> + reg = <0x1>;
> +
> + endpoint {
> + remote-endpoint = <0xe>;
> + linux,phandle = <0x9>;
> + phandle = <0x9>;
> + };
> + };
> +
> + port at 2 {
> + reg = <0x0>;
> +
> + endpoint {
> + slave-mode;
> + remote-endpoint = <0xf>;
> + linux,phandle = <0xa>;
> + phandle = <0xa>;
> + };
> + };
> + };
> + };
> +
> + ptm0 at F889C000 {
> + compatible = "arm,coresight-etm3x", "arm,primecell";
> + reg = <0xf889c000 0x1000>;
> + cpu = <0x10>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint {
> + remote-endpoint = <0x11>;
> + linux,phandle = <0xb>;
> + phandle = <0xb>;
> + };
> + };
> + };
> +
> + ptm1 at F889D000 {
> + compatible = "arm,coresight-etm3x", "arm,primecell";
> + reg = <0xf889d000 0x1000>;
> + cpu = <0x12>;
> + clocks = <&clkc 47>;
> + clock-names = "apb_pclk";
> +
> + port {
> +
> + endpoint {
> + remote-endpoint = <0x13>;
> + linux,phandle = <0xc>;
> + phandle = <0xc>;
> + };
> + };
> + };
> };
> };
I think nodes were ordered alphabetically in our DTs.
S?ren
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox