The following commit has been merged into the objtool/core branch of tip:
Commit-ID: d871f7b5a6a2a30f4eba577fd56941fa3657e394
Gitweb:
https://git.kernel.org/tip/d871f7b5a6a2a30f4eba577fd56941fa3657e394
Author:Raphael Gault
AuthorDate:Fri, 04 Sep 2020 16:30:24 +01:00
Hi Josh,
On 8/22/19 8:56 PM, Josh Poimboeuf wrote:
On Fri, Aug 16, 2019 at 01:23:45PM +0100, Raphael Gault wrote:
Hi,
Changes since RFC V3:
* Rebased on tip/master: Switch/jump table had been refactored
* Take Catalin Marinas comments into account regarding the asm macro for
marking
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 7 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 254 +
4
y mrs instruction, even if not related to the emulated
registers which made the pmu emulation inefficient.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/cpufeature.c | 4 +--
arch/arm64/kernel/perf_event.c | 55 ++
2 files changed, 57 insertions(+), 2 dele
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6
arch/arm64/include/asm
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
Mark boot_cpu_data as read-only after initialization.
Define accessor to read boot_cpu_data from outside of boot_cpu_data.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/cpu.h | 2 +-
arch/arm64/kernel/cpuinfo.c | 7 ++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git
erent models of CPUs from being
hotplugged on, however if such a scenario happens, it will turn off the
feature. There is no possibility for the feature to be turned on again
by hotplugging off CPUs though.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/cpucaps.h| 3 ++-
arch/arm64/in
by
the PMU implementation: if no callback is provided, the default
behaviour applies, returning 0 as index value.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 21 +
include/linux/perf/arm_pmu.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/arch
API.
The seventh patch adds a short documentation about PMU counters direct
access from userspace.
[1]: https://lkml.org/lkml/2019/8/20/875
Raphael Gault (7):
perf: arm64: Add test to check userspace access to hardware counters.
arm64: cpu: Add accessor for boot_cpu_data
arm64: cpufe
Acked-by: Mark Rutland
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 96e90e270042..24575c0a0065 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch
Hi Mark,
Thank you for your comments.
On 8/20/19 4:49 PM, Mark Rutland wrote:
On Tue, Aug 20, 2019 at 04:23:17PM +0100, Mark Rutland wrote:
Hi Raphael,
On Fri, Aug 16, 2019 at 01:59:31PM +0100, Raphael Gault wrote:
This feature is required in order to enable PMU counters direct
access from
]
This patchset was based on linux-next/master and note linus
Thanks,
--
Raphael Gault
This feature is required in order to enable PMU counters direct
access from userspace only when the system is homogeneous.
This feature checks the model of each CPU brought online and compares it
to the boot CPU. If it differs then it is heterogeneous.
Signed-off-by: Raphael Gault
---
arch
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 7 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 254 +
4
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6 +
arch/arm64/include/asm
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
by
the PMU implementation: if no callback is provided, the default
behaviour applies, returning 0 as index value.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 22 ++
include/linux/perf/arm_pmu.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a
nable access to the hardware
counters from userspace when a compatible event is opened using the perf
API.
The fifth patch adds a short documentation about PMU counters direct
access from userspace.
Raphael Gault (5):
perf: arm64: Add test to check userspace access to hardware counters.
code.
Signed-off-by: Raphael Gault
---
tools/objtool/Build | 2 -
tools/objtool/arch.h| 3 +
tools/objtool/arch/x86/Build| 2 +
tools/objtool/{ => arch/x86}/orc_dump.c | 4 +-
tools/objtool/{ => arch/x86}/orc_gen.c
moved to another section
or if objtool is tweaked to handle this particular case.
Signed-off-by: Raphael Gault
---
arch/arm64/crypto/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile
index 0435f2a0610e..e2a25919ebaa 100644
--- a
register. The initial stack frame is thus empty when entering a function
and 2 push operations are needed to set it up correctly. All the different
combinations need to be taken into account.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h | 2 +
tools/objtool/arch/arm64
: Raphael Gault
---
tools/objtool/arch/arm64/arch_special.c | 132 +-
.../objtool/arch/arm64/include/arch_special.h | 10 ++
.../objtool/arch/arm64/include/insn_decode.h | 3 +-
tools/objtool/check.c | 6 +-
tools/objtool/check.h
dard stack frames.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/sleep.S | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index f5b04dd8a710..55c7c099d32c 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@
This plugins comes into play before the final 2 RTL passes of GCC and
detects switch-tables that are to be outputed in the ELF and writes
information in an "objtool_data" section which will be used by objtool.
Signed-off-by: Raphael Gault
---
scripts/Makefile.gcc-plugins
Until now, the section .altinstr_replacement wasn't marked as containing
executable instructions on arm64. This patch changes that so that it is
coherent with what is done on x86.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/alternative.h | 2 +-
1 file changed, 1 insertion(
Signed-off-by: Raphael Gault
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 3adcec05b1f6..dc3de85b2502 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -163,6 +163,7 @@ config ARM64
select
The way to identify switch-tables and retrieves all the data necessary
to handle the different execution branches is not the same on all
architecture. In order to be able to add other architecture support,
this patch defines arch-dependent functions to process jump-tables.
Signed-off-by: Raphael
Both __guest_entry and __guest_exit functions do not setup
a correct stack frame. Because they can be considered as callable
functions, even if they are particular cases, we chose to silence
the warnings given by objtool by annotating them as non-standard.
Signed-off-by: Raphael Gault
---
arch
Some functions don't have standard stack-frames but are intended
this way. In order for objtool to ignore those particular cases
we add a macro that enables us to annotate the cases we chose
to mark as particular.
Signed-off-by: Raphael Gault
---
include/linux/frame.h
Annotate assembler functions which are callable but do not
setup a correct stack frame.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/hyp-stub.S | 3 +++
arch/arm64/kvm/hyp-init.S| 3 +++
2 files changed, 6 insertions(+)
diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel
kuser32 being used for compatibility, it contains a32 instructions
which are not recognised by objtool when trying to analyse arm64
object files. Thus, we add an exception to skip validation on this
particular file.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/Makefile | 3 +++
1 file
The jump destination and relocation offset used previously are only
reliable on x86_64 architecture. We abstract these computations by calling
arch-dependent implementations.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h| 6 ++
tools/objtool/arch/x86/decode.c | 11
Address).
Signed-off-by: Raphael Gault
---
tools/objtool/arch/x86/include/arch_special.h | 36 +++
tools/objtool/{ => arch/x86/include}/cfi.h| 0
tools/objtool/check.h | 1 +
tools/objtool/special.c | 19 +-
4 fi
This patch abstracts the few architecture dependent tests that are
perform when handling special section and switch tables. It enables any
architecture to ignore a particular CPU feature or not to handle switch
tables.
Signed-off-by: Raphael Gault
---
tools/objtool/arch/arm64/Build
raised if such instructions are uncountered while validating an
execution branch.
This change doesn't impact the x86 decoding logic since 0 is still used
as a way to specify an unknown type, raising the "unknown instruction"
warning during the decoding phase still.
Signed-off
hvc/smc/svc context switching
instructions as nop since we consider that the context is restored
correctly.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h |7 +
tools/objtool/arch/arm64/Build|7 +
tools/objtool/arch/arm64/bit_operations.c
arm64.
Once we have the base of objtool working the next steps will be to
port Peter Z's uaccess validation for arm64.
Raphael Gault (18):
objtool: Add abstraction for computation of symbols offsets
objtool: orc: Refactor ORC API for other architectures to implement.
objtool: Move regi
Hi,
Any further comments on this patchset ?
Cheers,
On 7/5/19 9:55 AM, Raphael Gault wrote:
The perf user-space tool relies on the PMU to monitor events. It offers an
abstraction layer over the hardware counters since the underlying
implementation is cpu-dependent. We want to allow userspace
Hi all,
Just a gentle ping to see if anyone has comments to make about this
version :)
On 6/24/19 10:55 AM, Raphael Gault wrote:
As of now, objtool only supports the x86_64 architecture but the
groundwork has already been done in order to add support for other
architectures without too much
Hi Arnaldo,
On 7/5/19 3:54 PM, Arnaldo Carvalho de Melo wrote:
Em Fri, Jul 05, 2019 at 09:55:37AM +0100, Raphael Gault escreveu:
This test relies on the fact that the PMU registers are accessible
from userspace. It then uses the perf_event_mmap_page to retrieve
the counter index and access the
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 6 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 255 +
4
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6 +
arch/arm64/include/asm
by
the PMU implementation: if no callback is provided, the default
behaviour applies, returning 0 as index value.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 22 ++
include/linux/perf/arm_pmu.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
same reason as above.
* Add a cpu feature/capability to detect heterogeneous systems.
Raphael Gault (5):
perf: arm64: Add test to check userspace access to hardware counters.
arm64: cpufeature: Add feature to detect heterogeneous systems
arm64: pmu: Add function implementation to update event
: Raphael Gault
---
arch/arm64/include/asm/cpucaps.h | 3 ++-
arch/arm64/kernel/cpufeature.c | 20
arch/arm64/kernel/perf_event.c | 1 +
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index
Hi,
On 7/1/19 3:40 PM, Catalin Marinas wrote:
On Mon, Jun 24, 2019 at 10:55:42AM +0100, Raphael Gault wrote:
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -752,4 +752,17 @@ USER(\label, icivau, \tmp2)//
invalidate I line PoU
want to upstream this and have to maintain it afterward.
Thanks,
--
Raphael Gault
Hi Mathieu, Hi Szabolcs,
On 6/11/19 8:33 PM, Mathieu Desnoyers wrote:
- On Jun 11, 2019, at 6:57 PM, Mark Rutland mark.rutl...@arm.com wrote:
Hi Arnaldo,
On Tue, Jun 11, 2019 at 11:33:46AM -0300, Arnaldo Carvalho de Melo wrote:
Em Tue, Jun 11, 2019 at 01:53:11PM +0100, Raphael Gault
register. The initial stack frame is thus empty when entering a function
and 2 push operations are needed to set it up correctly. All the different
combinations need to be taken into account.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h | 2 +
tools/objtool/arch/arm64
: Raphael Gault
---
tools/objtool/arch/arm64/arch_special.c | 142 +-
tools/objtool/arch/arm64/decode.c | 2 +-
.../objtool/arch/arm64/include/arch_special.h | 10 ++
.../objtool/arch/arm64/include/insn_decode.h | 3 +-
tools/objtool/check.c
hvc/smc/svc context switching
instructions as nop since we consider that the context is restored
correctly.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h |7 +
tools/objtool/arch/arm64/Build|7 +
tools/objtool/arch/arm64/bit_operations.c
code.
Signed-off-by: Raphael Gault
---
tools/objtool/Build | 2 -
tools/objtool/arch.h| 3 +
tools/objtool/arch/x86/Build| 2 +
tools/objtool/{ => arch/x86}/orc_dump.c | 4 +-
tools/objtool/{ => arch/x86}/orc_gen.c
raised if such instructions are uncountered while validating an
execution branch.
This change doesn't impact the x86 decoding logic since 0 is still used
as a way to specify an unknown type, raising the "unknown instruction"
warning during the decoding phase still.
Signed-off
This patch abstracts the few architecture dependent tests that are
perform when handling special section and switch tables. It enables any
architecture to ignore a particular CPU feature or not to handle switch
tables.
Signed-off-by: Raphael Gault
---
tools/objtool/arch/arm64/Build
The way to identify switch-tables and retrieves all the data necessary
to handle the different execution branches is not the same on all
architecture. In order to be able to add other architecture support,
this patch defines arch-dependent functions to process jump-tables.
Signed-off-by: Raphael
Address).
Signed-off-by: Raphael Gault
---
tools/objtool/arch/x86/include/arch_special.h | 36 +++
tools/objtool/{ => arch/x86/include}/cfi.h| 0
tools/objtool/check.h | 1 +
tools/objtool/special.c | 19 +-
4 fi
dard stack frames.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/sleep.S | 4
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index 3e53ffa07994..eb434525fe82 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@ -
This plugins comes into play before the final 2 RTL passes of GCC and
detects switch-tables that are to be outputed in the ELF and writes
information in an "objtool_data" section which will be used by objtool.
Signed-off-by: Raphael Gault
---
scripts/Makefile.gcc-plugins
kuser32 being used for compatibility, it contains a32 instructions
which are not recognised by objtool when trying to analyse arm64
object files. Thus, we add an exception to skip validation on this
particular file.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/Makefile | 3 +++
1 file
moved to another section
or if objtool is tweaked to handle this particular case.
Signed-off-by: Raphael Gault
---
arch/arm64/crypto/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile
index 0435f2a0610e..e2a25919ebaa 100644
--- a
Signed-off-by: Raphael Gault
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index f5eb592b8579..c5fdfb635d3d 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -159,6 +159,7 @@ config ARM64
select
Annotate assembler functions which are callable but do not
setup a correct stack frame.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/hyp-stub.S | 2 ++
arch/arm64/kvm/hyp-init.S| 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp
Both __guest_entry and __guest_exit functions do not setup
a correct stack frame. Because they can be considered as callable
functions, even if they are particular cases, we chose to silence
the warnings given by objtool by annotating them as non-standard.
Signed-off-by: Raphael Gault
---
arch
Some functions don't have standard stack-frames but are intended
this way. In order for objtool to ignore those particular cases
we add a macro that enables us to annotate the cases we chose
to mark as particular.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/assembler.h
Until now, the section .altinstr_replacement wasn't marked as containing
executable instructions on arm64. This patch changes that so that it is
coherent with what is done on x86.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/alternative.h | 2 +-
1 file changed, 1 insertion(
LABEL/emit_label_before/after. If anyone has some
experience with RTL plugins I am all ears for advices.
Raphael Gault (18):
objtool: Add abstraction for computation of symbols offsets
objtool: orc: Refactor ORC API for other architectures to implement.
objtool: Move registers and control flow to
The jump destination and relocation offset used previously are only
reliable on x86_64 architecture. We abstract these computations by calling
arch-dependent implementations.
Signed-off-by: Raphael Gault
---
tools/objtool/arch.h| 6 ++
tools/objtool/arch/x86/decode.c | 11
Commit-ID: 010e3e8fc12b1c13ce19821a11d8930226ebb4b6
Gitweb: https://git.kernel.org/tip/010e3e8fc12b1c13ce19821a11d8930226ebb4b6
Author: Raphael Gault
AuthorDate: Tue, 11 Jun 2019 13:53:09 +0100
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 17 Jun 2019 15:57:16 -0300
perf tests
Hi Mathieu,
On 6/11/19 8:33 PM, Mathieu Desnoyers wrote:
- On Jun 11, 2019, at 6:57 PM, Mark Rutland mark.rutl...@arm.com wrote:
Hi Arnaldo,
On Tue, Jun 11, 2019 at 11:33:46AM -0300, Arnaldo Carvalho de Melo wrote:
Em Tue, Jun 11, 2019 at 01:53:11PM +0100, Raphael Gault escreveu:
Add
Hi Josh,
On 5/28/19 11:24 PM, Josh Poimboeuf wrote:
On Tue, May 21, 2019 at 12:50:57PM +, Raphael Gault wrote:
Hi Josh,
Thanks for offering your help and sorry for the late answer.
My understanding is that a table of offsets is built by GCC, those
offsets being scaled by 4 before adding
Hi Mathieu, Mark,
On 6/11/19 8:33 PM, Mathieu Desnoyers wrote:
- On Jun 11, 2019, at 6:57 PM, Mark Rutland mark.rutl...@arm.com wrote:
Hi Arnaldo,
On Tue, Jun 11, 2019 at 11:33:46AM -0300, Arnaldo Carvalho de Melo wrote:
Em Tue, Jun 11, 2019 at 01:53:11PM +0100, Raphael Gault escreveu
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 6 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 255 +
4
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6 +
arch/arm64/include/asm
f not related to the emulated
registers which made the pmu emulation inefficient.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/cpufeature.c | 4 +--
arch/arm64/kernel/perf_event.c | 55 ++
2 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/arch/
and I did it several times).
I ran it once with 1 iterations:
`runs: 1, abort: 62.53%, zero: 34.93%, success: 2.54%`
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h| 5 +-
tools/perf/arch/arm64/include/rseq-arm64.h| 220 ++
tools/perf
by
the PMU implementation: if no callback is provided, the default
behaviour applies, returning 0 as index value.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 21 +
include/linux/perf/arm_pmu.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/arch
In order to subsequently add more tests for the arm64 architecture
we compile the tests target for arm64 systematically.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/Build | 2 +-
tools/perf/arch/arm64/tests/Build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff
sters. This is necessary in order to have a coherent behaviour
on big.LITTLE environment.
The sixth patch put in place callbacks to enable access to the hardware
counters from userspace when a compatible event is opened using the perf
API.
Raphael Gault (7):
perf: arm64: Compile tests unconditio
Hi Peter,
On 5/29/19 1:32 PM, Peter Zijlstra wrote:
On Wed, May 29, 2019 at 01:25:46PM +0100, Raphael Gault wrote:
Hi Robin, Hi Peter,
On 5/29/19 11:50 AM, Robin Murphy wrote:
On 29/05/2019 11:46, Raphael Gault wrote:
Hi Peter,
On 5/29/19 10:46 AM, Peter Zijlstra wrote:
On Tue, May 28
Hi Robin, Hi Peter,
On 5/29/19 11:50 AM, Robin Murphy wrote:
On 29/05/2019 11:46, Raphael Gault wrote:
Hi Peter,
On 5/29/19 10:46 AM, Peter Zijlstra wrote:
On Tue, May 28, 2019 at 04:03:17PM +0100, Raphael Gault wrote:
+static int armv8pmu_access_event_idx(struct perf_event *event
Hi Peter,
On 5/29/19 10:46 AM, Peter Zijlstra wrote:
On Tue, May 28, 2019 at 04:03:17PM +0100, Raphael Gault wrote:
+static int armv8pmu_access_event_idx(struct perf_event *event)
+{
+ if (!(event->hw.flags & ARMPMU_EL0_RD_CNTR))
+ return 0;
+
+ /*
+* W
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6 +
arch/arm64/include/asm
and I did it several times).
I ran it once with 1 iterations:
`runs: 1, abort: 62.53%, zero: 34.93%, success: 2.54%`
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h| 5 +-
tools/perf/arch/arm64/include/rseq-arm64.h| 220 ++
tools/perf
f not related to the emulated
registers which made the pmu emulation inefficient.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/cpufeature.c | 4 ++--
arch/arm64/kernel/perf_event.c | 41 ++
2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/arch/
by
the PMU implementation: if no callback is provided, the default
behaviour applies, returning 0 as index value.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 21 +
include/linux/perf/arm_pmu.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/arch
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 6 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 255 +
4
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
to see if that's indeed not necessary to save it.
Changes since V1: Add a test using rseq
Raphael Gault (7):
perf: arm64: Compile tests unconditionally
perf: arm64: Add test to check userspace access to hardware counters.
perf: arm64: Use rseq to test userspace access to pmu counters
In order to subsequently add more tests for the arm64 architecture
we compile the tests target for arm64 systematically.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/Build | 2 +-
tools/perf/arch/arm64/tests/Build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff
needed to find a comparison, which can be
optimized out apprently. In that case the end of the array can be found
by locating labels pointing to data behind it (which is not 100% safe).
On 5/16/19 3:29 PM, Josh Poimboeuf wrote:
> On Thu, May 16, 2019 at 11:36:39AM +0100, Raphael Gault wr
Hi,
On 5/17/19 8:10 AM, Peter Zijlstra wrote:
> On Thu, May 16, 2019 at 02:21:46PM +0100, Raphael Gault wrote:
>> In order to prevent the userspace processes which are trying to access
>> the registers from the pmu registers on a big.LITTLE environment we
>> introduce a hoo
cpus in a big.LITTLE environment.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/include/arch-tests.h | 6 +
tools/perf/arch/arm64/tests/Build | 1 +
tools/perf/arch/arm64/tests/arch-tests.c | 4 +
tools/perf/arch/arm64/tests/user-events.c | 255 +
4
In order to subsequently add more tests for the arm64 architecture
we compile the tests target for arm64 systematically.
Signed-off-by: Raphael Gault
---
tools/perf/arch/arm64/Build | 2 +-
tools/perf/arch/arm64/tests/Build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff
In order to be able to access the counter directly for userspace,
we need to provide the index of the counter using the userpage.
We thus need to override the event_idx function to retrieve and
convert the perf_event index to armv8 hardware index.
Signed-off-by: Raphael Gault
---
arch/arm64
SIGILL signal if
the permissions are set accordingly.
Signed-off-by: Raphael Gault
---
arch/arm64/kernel/perf_event.c | 68 ++
1 file changed, 68 insertions(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index e6316f99f66b
different event opened and
de-activate the permissions when all are unmapped.
We also need to update the permissions in the context switch code so
that tasks keep the right permissions.
Signed-off-by: Raphael Gault
---
arch/arm64/include/asm/mmu.h | 6 +
arch/arm64/include/asm
Add a documentation file to describe the access to the pmu hardware
counters from userspace
Signed-off-by: Raphael Gault
---
.../arm64/pmu_counter_user_access.txt | 42 +++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/arm64
1 - 100 of 134 matches
Mail list logo