[PATCH 4.9 05/16] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit

2019-02-14 Thread David Long
From: Julien Thierry Commit 621afc677465db231662ed126ae1f355bf8eac47 upstream. A mispredicted conditional call to set_fs could result in the wrong addr_limit being forwarded under speculation to a subsequent access_ok check, potentially forming part of a spectre-v1 attack using uaccess routines.

[PATCH 4.9 07/16] ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization

2019-02-14 Thread David Long
From: Julien Thierry Commit afaf6838f4bc896a711180b702b388b8cfa638fc upstream. Introduce C and asm helpers to sanitize user address, taking the address range they target into account. Use asm helper for existing sanitization in __copy_from_user(). Signed-off-by: Julien Thierry Signed-off-by:

[PATCH 4.9 06/16] ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()

2019-02-14 Thread David Long
From: Julien Thierry Commit e3aa6243434fd9a82e84bb79ab1abd14f2d9a5a7 upstream. When Spectre mitigation is required, __put_user() needs to include check_uaccess. This is already the case for put_user(), so just make __put_user() an alias of put_user(). Signed-off-by: Julien Thierry Signed-off-b

[PATCH 4.9 08/16] ARM: 8797/1: spectre-v1.1: harden __copy_to_user

2019-02-14 Thread David Long
From: Julien Thierry Commit a1d09e074250fad24f1b993f327b18cc6812eb7a upstream. Sanitize user pointer given to __copy_to_user, both for standard version and memcopy version of the user accessor. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long --- arch/a

[PATCH 4.9 02/16] ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state

2019-02-14 Thread David Long
From: Julien Thierry Commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 upstream. Use __copy_to_user() rather than __put_user_error() for individual members when saving VFP state. This has the benefit of disabling/enabling PAN once per copied struct intead of once per write. Signed-off-by: Julien

[PATCH 4.9 03/16] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()

2019-02-14 Thread David Long
From: Julien Thierry Commit 319508902600c2688e057750148487996396e9ca upstream. Copy events to user using __copy_to_user() rather than copy members of individually with __put_user_error(). This has the benefit of disabling/enabling PAN once per event intead of once per event member. Signed-off-b

[PATCH 4.9 10/16] ARM: make lookup_processor_type() non-__init

2019-02-14 Thread David Long
From: Russell King Commit 899a42f836678a595f7d2bc36a5a0c2b03d08cbc upstream. Move lookup_processor_type() out of the __init section so it is callable from (eg) the secondary startup code during hotplug. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long ---

[PATCH 4.9 09/16] ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc

2019-02-14 Thread David Long
From: Julien Thierry Commit 5df7a99bdd0de4a0480320264c44c04543c29d5a upstream. In vfp_preserve_user_clear_hwstate, ufp_exc->fpinst2 gets assigned to itself. It should actually be hwstate->fpinst2 that gets assigned to the ufp_exc field. Fixes commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 ("AR

[PATCH 4.9 11/16] ARM: split out processor lookup

2019-02-14 Thread David Long
From: Russell King Commit 65987a8553061515b5851b472081aedb9837a391 upstream. Split out the lookup of the processor type and associated error handling from the rest of setup_processor() - we will need to use this in the secondary CPU bringup path for big.Little Spectre variant 2 mitigation. Revi

[PATCH 4.9 13/16] ARM: add PROC_VTABLE and PROC_TABLE macros

2019-02-14 Thread David Long
From: Russell King Commit e209950fdd065d2cc46e6338e47e52841b830cba upstream. Allow the way we access members of the processor vtable to be changed at compile time. We will need to move to per-CPU vtables to fix the Spectre variant 2 issues on big.Little systems. However, we have a couple of ca

[PATCH 4.9 12/16] ARM: clean up per-processor check_bugs method call

2019-02-14 Thread David Long
From: Russell King Commit 945aceb1db8885d3a35790cf2e810f681db52756 upstream. Call the per-processor type check_bugs() method in the same way as we do other per-processor functions - move the "processor." detail into proc-fns.h. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-of

[PATCH 4.9 14/16] ARM: spectre-v2: per-CPU vtables to work around big.Little systems

2019-02-14 Thread David Long
From: Russell King Commit 383fb3ee8024d596f488d2dbaf45e572897acbdb upstream. In big.Little systems, some CPUs require the Spectre workarounds in paths such as the context switch, but other CPUs do not. In order to handle these differences, we need per-CPU vtables. We are unable to use the kern

[PATCH 4.9 16/16] ARM: fix the cockup in the previous patch

2019-02-14 Thread David Long
From: Russell King Commit d6951f582cc50ba0ad22ef46b599740966599b14 upstream. The intention in the previous patch was to only place the processor tables in the .rodata section if big.Little was being built and we wanted the branch target hardening, but instead (due to the way it was tested) it en

[PATCH 4.9 00/16] V4.9 backport of more 32-bit arm spectre patches

2019-02-14 Thread David Long
From: "David A. Long" V4.9 backport of spectre patches from Russell M. King's spectre branch. Patches have been kvm-unit-test'ed on an arndale, run through kernelci, and handed off to ARM for functional testing. Julien Thierry (9): ARM: 8789/1: signal: copy registers using __copy_to_user() A

[PATCH 4.9 15/16] ARM: ensure that processor vtables is not lost after boot

2019-02-14 Thread David Long
From: Russell King Commit 3a4d0c2172bcf15b7a3d9d498b2b355f9864286b upstream. Marek Szyprowski reported problems with CPU hotplug in current kernels. This was tracked down to the processor vtables being located in an init section, and therefore discarded after kernel boot, despite being required

[PATCH 4.9 01/16] ARM: 8789/1: signal: copy registers using __copy_to_user()

2019-02-14 Thread David Long
From: Julien Thierry Commit 5ca451cf6ed04443774bbb7ee45332dafa42e99f upstream. When saving the ARM integer registers, use __copy_to_user() to copy them into user signal frame, rather than __put_user_error(). This has the benefit of disabling/enabling PAN once for the whole copy intead of once pe

[PATCH 4.9 04/16] ARM: 8793/1: signal: replace __put_user_error with __put_user

2019-02-14 Thread David Long
From: Julien Thierry Commit 18ea66bd6e7a95bdc598223d72757190916af28b upstream. With Spectre-v1.1 mitigations, __put_user_error is pointless. In an attempt to remove it, replace its references in frame setups with __put_user. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off

[PATCH 4.14 V2 01/17] ARM: 8789/1: signal: copy registers using __copy_to_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit 5ca451cf6ed04443774bbb7ee45332dafa42e99f upstream. When saving the ARM integer registers, use __copy_to_user() to copy them into user signal frame, rather than __put_user_error(). This has the benefit of disabling/enabling PAN once for the whole copy intead of once pe

[PATCH 4.14 V2 05/17] ARM: 8793/1: signal: replace __put_user_error with __put_user

2019-02-13 Thread David Long
From: Julien Thierry Commit 18ea66bd6e7a95bdc598223d72757190916af28b upstream. With Spectre-v1.1 mitigations, __put_user_error is pointless. In an attempt to remove it, replace its references in frame setups with __put_user. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off

[PATCH 4.14 V2 06/17] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit

2019-02-13 Thread David Long
From: Julien Thierry Commit 621afc677465db231662ed126ae1f355bf8eac47 upstream. A mispredicted conditional call to set_fs could result in the wrong addr_limit being forwarded under speculation to a subsequent access_ok check, potentially forming part of a spectre-v1 attack using uaccess routines.

[PATCH 4.14 V2 07/17] ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit e3aa6243434fd9a82e84bb79ab1abd14f2d9a5a7 upstream. When Spectre mitigation is required, __put_user() needs to include check_uaccess. This is already the case for put_user(), so just make __put_user() an alias of put_user(). Signed-off-by: Julien Thierry Signed-off-b

[PATCH 4.14 V2 12/17] ARM: split out processor lookup

2019-02-13 Thread David Long
From: Russell King Commit 65987a8553061515b5851b472081aedb9837a391 upstream. Split out the lookup of the processor type and associated error handling from the rest of setup_processor() - we will need to use this in the secondary CPU bringup path for big.Little Spectre variant 2 mitigation. Revi

[PATCH 4.14 V2 04/17] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit 319508902600c2688e057750148487996396e9ca upstream. Copy events to user using __copy_to_user() rather than copy members of individually with __put_user_error(). This has the benefit of disabling/enabling PAN once per event intead of once per event member. Signed-off-b

[PATCH 4.14 V2 10/17] ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc

2019-02-13 Thread David Long
From: Julien Thierry Commit 5df7a99bdd0de4a0480320264c44c04543c29d5a upstream. In vfp_preserve_user_clear_hwstate, ufp_exc->fpinst2 gets assigned to itself. It should actually be hwstate->fpinst2 that gets assigned to the ufp_exc field. Fixes commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 ("AR

[PATCH 4.14 V2 03/17] ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state

2019-02-13 Thread David Long
From: Julien Thierry Commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 upstream. Use __copy_to_user() rather than __put_user_error() for individual members when saving VFP state. This has the benefit of disabling/enabling PAN once per copied struct intead of once per write. Signed-off-by: Julien

[PATCH 4.14 V2 16/17] ARM: ensure that processor vtables is not lost after boot

2019-02-13 Thread David Long
From: Russell King Commit 3a4d0c2172bcf15b7a3d9d498b2b355f9864286b upstream. Marek Szyprowski reported problems with CPU hotplug in current kernels. This was tracked down to the processor vtables being located in an init section, and therefore discarded after kernel boot, despite being required

[PATCH 4.14 V2 08/17] ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization

2019-02-13 Thread David Long
From: Julien Thierry Commit afaf6838f4bc896a711180b702b388b8cfa638fc upstream. Introduce C and asm helpers to sanitize user address, taking the address range they target into account. Use asm helper for existing sanitization in __copy_from_user(). Signed-off-by: Julien Thierry Signed-off-by:

[PATCH 4.14 V2 14/17] ARM: add PROC_VTABLE and PROC_TABLE macros

2019-02-13 Thread David Long
From: Russell King Commit e209950fdd065d2cc46e6338e47e52841b830cba upstream. Allow the way we access members of the processor vtable to be changed at compile time. We will need to move to per-CPU vtables to fix the Spectre variant 2 issues on big.Little systems. However, we have a couple of ca

[PATCH 4.14 V2 13/17] ARM: clean up per-processor check_bugs method call

2019-02-13 Thread David Long
From: Russell King Commit 945aceb1db8885d3a35790cf2e810f681db52756 upstream. Call the per-processor type check_bugs() method in the same way as we do other per-processor functions - move the "processor." detail into proc-fns.h. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-of

[PATCH 4.14 V2 11/17] ARM: make lookup_processor_type() non-__init

2019-02-13 Thread David Long
From: Russell King Commit 899a42f836678a595f7d2bc36a5a0c2b03d08cbc upstream. Move lookup_processor_type() out of the __init section so it is callable from (eg) the secondary startup code during hotplug. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long ---

[PATCH 4.14 V2 15/17] ARM: spectre-v2: per-CPU vtables to work around big.Little systems

2019-02-13 Thread David Long
From: Russell King Commit 383fb3ee8024d596f488d2dbaf45e572897acbdb upstream. In big.Little systems, some CPUs require the Spectre workarounds in paths such as the context switch, but other CPUs do not. In order to handle these differences, we need per-CPU vtables. We are unable to use the kern

[PATCH 4.14 V2 00/17] V4.14 backport of more 32-bit arm spectre patches

2019-02-13 Thread David Long
From: "David A. Long" V4.14 backport of spectre patches from Russell M. King's spectre branch. Patches have been kvm-unit-test'ed on an arndale, run through kernelci, and handed off to ARM for functional testing. Julien Thierry (10): ARM: 8789/1: signal: copy registers using __copy_to_user()

[PATCH 4.14 V2 02/17] ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context

2019-02-13 Thread David Long
From: Julien Thierry Commit 73839798af7ebc6c8d0c9271ebbbc148700e521f upstream. When setting a dummy iwmmxt context, create a local instance and use __copy_to_user both cases whether iwmmxt is being used or not. This has the benefit of disabling/enabling PAN once for the whole copy intead of once

[PATCH 4.14 V2 09/17] ARM: 8797/1: spectre-v1.1: harden __copy_to_user

2019-02-13 Thread David Long
From: Julien Thierry Commit a1d09e074250fad24f1b993f327b18cc6812eb7a upstream. Sanitize user pointer given to __copy_to_user, both for standard version and memcopy version of the user accessor. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long --- arch/a

[PATCH 4.14 V2 17/17] ARM: fix the cockup in the previous patch

2019-02-13 Thread David Long
From: Russell King Commit d6951f582cc50ba0ad22ef46b599740966599b14 upstream. The intention in the previous patch was to only place the processor tables in the .rodata section if big.Little was being built and we wanted the branch target hardening, but instead (due to the way it was tested) it en

[PATCH 4.19 01/17] ARM: 8789/1: signal: copy registers using __copy_to_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit 5ca451cf6ed04443774bbb7ee45332dafa42e99f upstream. When saving the ARM integer registers, use __copy_to_user() to copy them into user signal frame, rather than __put_user_error(). This has the benefit of disabling/enabling PAN once for the whole copy intead of once pe

[PATCH 4.19 07/17] ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit e3aa6243434fd9a82e84bb79ab1abd14f2d9a5a7 upstream. When Spectre mitigation is required, __put_user() needs to include check_uaccess. This is already the case for put_user(), so just make __put_user() an alias of put_user(). Signed-off-by: Julien Thierry Signed-off-b

[PATCH 4.19 03/17] ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state

2019-02-13 Thread David Long
From: Julien Thierry Commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 upstream. Use __copy_to_user() rather than __put_user_error() for individual members when saving VFP state. This has the benefit of disabling/enabling PAN once per copied struct intead of once per write. Signed-off-by: Julien

[PATCH 4.19 04/17] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()

2019-02-13 Thread David Long
From: Julien Thierry Commit 319508902600c2688e057750148487996396e9ca upstream. Copy events to user using __copy_to_user() rather than copy members of individually with __put_user_error(). This has the benefit of disabling/enabling PAN once per event intead of once per event member. Signed-off-b

[PATCH 4.19 10/17] ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc

2019-02-13 Thread David Long
From: Julien Thierry Commit 5df7a99bdd0de4a0480320264c44c04543c29d5a upstream. In vfp_preserve_user_clear_hwstate, ufp_exc->fpinst2 gets assigned to itself. It should actually be hwstate->fpinst2 that gets assigned to the ufp_exc field. Fixes commit 3aa2df6ec2ca6bc143a65351cca4266d03a8bc41 ("AR

[PATCH 4.19 05/17] ARM: 8793/1: signal: replace __put_user_error with __put_user

2019-02-13 Thread David Long
From: Julien Thierry Commit 18ea66bd6e7a95bdc598223d72757190916af28b upstream. With Spectre-v1.1 mitigations, __put_user_error is pointless. In an attempt to remove it, replace its references in frame setups with __put_user. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off

[PATCH 4.19 09/17] ARM: 8797/1: spectre-v1.1: harden __copy_to_user

2019-02-13 Thread David Long
From: Julien Thierry Commit a1d09e074250fad24f1b993f327b18cc6812eb7a upstream. Sanitize user pointer given to __copy_to_user, both for standard version and memcopy version of the user accessor. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long --- arch/a

[PATCH 4.19 08/17] ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization

2019-02-13 Thread David Long
From: Julien Thierry Commit afaf6838f4bc896a711180b702b388b8cfa638fc upstream. Introduce C and asm helpers to sanitize user address, taking the address range they target into account. Use asm helper for existing sanitization in __copy_from_user(). Signed-off-by: Julien Thierry Signed-off-by:

[PATCH 4.19 14/17] ARM: add PROC_VTABLE and PROC_TABLE macros

2019-02-13 Thread David Long
From: Russell King Commit e209950fdd065d2cc46e6338e47e52841b830cba upstream. Allow the way we access members of the processor vtable to be changed at compile time. We will need to move to per-CPU vtables to fix the Spectre variant 2 issues on big.Little systems. However, we have a couple of ca

[PATCH 4.19 15/17] ARM: spectre-v2: per-CPU vtables to work around big.Little systems

2019-02-13 Thread David Long
From: Russell King Commit 383fb3ee8024d596f488d2dbaf45e572897acbdb upstream. In big.Little systems, some CPUs require the Spectre workarounds in paths such as the context switch, but other CPUs do not. In order to handle these differences, we need per-CPU vtables. We are unable to use the kern

[PATCH 4.19 12/17] ARM: split out processor lookup

2019-02-13 Thread David Long
From: Russell King Commit 65987a8553061515b5851b472081aedb9837a391 upstream. Split out the lookup of the processor type and associated error handling from the rest of setup_processor() - we will need to use this in the secondary CPU bringup path for big.Little Spectre variant 2 mitigation. Revi

[PATCH 4.19 11/17] ARM: make lookup_processor_type() non-__init

2019-02-13 Thread David Long
From: Russell King Commit 899a42f836678a595f7d2bc36a5a0c2b03d08cbc upstream. Move lookup_processor_type() out of the __init section so it is callable from (eg) the secondary startup code during hotplug. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long ---

[PATCH 4.19 16/17] ARM: ensure that processor vtables is not lost after boot

2019-02-13 Thread David Long
From: Russell King Commit 3a4d0c2172bcf15b7a3d9d498b2b355f9864286b upstream. Marek Szyprowski reported problems with CPU hotplug in current kernels. This was tracked down to the processor vtables being located in an init section, and therefore discarded after kernel boot, despite being required

[PATCH 4.19 17/17] ARM: fix the cockup in the previous patch

2019-02-13 Thread David Long
From: Russell King Commit d6951f582cc50ba0ad22ef46b599740966599b14 upstream. The intention in the previous patch was to only place the processor tables in the .rodata section if big.Little was being built and we wanted the branch target hardening, but instead (due to the way it was tested) it en

[PATCH 4.19 13/17] ARM: clean up per-processor check_bugs method call

2019-02-13 Thread David Long
From: Russell King Commit 945aceb1db8885d3a35790cf2e810f681db52756 upstream. Call the per-processor type check_bugs() method in the same way as we do other per-processor functions - move the "processor." detail into proc-fns.h. Reviewed-by: Julien Thierry Signed-off-by: Russell King Signed-of

[PATCH 4.19 06/17] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit

2019-02-13 Thread David Long
From: Julien Thierry Commit 621afc677465db231662ed126ae1f355bf8eac47 upstream. A mispredicted conditional call to set_fs could result in the wrong addr_limit being forwarded under speculation to a subsequent access_ok check, potentially forming part of a spectre-v1 attack using uaccess routines.

[PATCH 4.19 02/17] ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context

2019-02-13 Thread David Long
From: Julien Thierry Commit 73839798af7ebc6c8d0c9271ebbbc148700e521f upstream. When setting a dummy iwmmxt context, create a local instance and use __copy_to_user both cases whether iwmmxt is being used or not. This has the benefit of disabling/enabling PAN once for the whole copy intead of once

[PATCH 4.19 00/17] V4.19 backport of more 32-bit arm spectre patches

2019-02-13 Thread David Long
From: "David A. Long" V4.19 backport of spectre patches from Russell M. King's spectre branch. Patches have been kvm-unit-test'ed on an arndale, run through kernelci, and handed off to ARM for functional testing. Julien Thierry (10): ARM: 8789/1: signal: copy registers using __copy_to_user()

Re: [RESEND x3][PATCH 2/2 v4] drm/bridge: adv7511: Enable the audio data and clock pads on adv7533

2016-12-09 Thread David Long
On 11/28/2016 08:22 PM, John Stultz wrote: From: Srinivas Kandagatla This patch enables the Audio Data and Clock pads to the adv7533 bridge. Without this patch audio can not be played. Cc: David Airlie Cc: Archit Taneja Cc: Laurent Pinchart Cc: Wolfram Sang Cc: Srinivas Kandagatla Cc: "Vi

Re: [RESEND x3][PATCH 1/2 v4] drm/bridge: adv7511: Add Audio support.

2016-12-09 Thread David Long
On 11/28/2016 08:22 PM, John Stultz wrote: This patch adds support to Audio for both adv7511 and adv7533 bridge chips. This patch was originally from [1] by Lars-Peter Clausen and was adapted by Archit Taneja and Srinivas Kandagatla . Then I heavily reworked it to use the hdmi-codec driver. A

Re: [PATCH v4] arm64: Improve kprobes test for atomic sequence

2016-09-12 Thread David Long
On 09/12/2016 08:46 PM, Masami Hiramatsu wrote: On Mon, 12 Sep 2016 14:21:27 -0400 David Long wrote: From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when i

[PATCH v4] arm64: Improve kprobes test for atomic sequence

2016-09-12 Thread David Long
From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when it hits the maximum number of instructions or a load or store exclusive. However this means it can run up past the beginning

Re: [PATCH v3] arm64: Improve kprobes test for atomic sequence

2016-09-12 Thread David Long
On 09/12/2016 12:29 PM, Masami Hiramatsu wrote: On Sun, 11 Sep 2016 21:53:43 -0400 David Long wrote: On 09/10/2016 01:48 AM, Masami Hiramatsu wrote: On Fri, 9 Sep 2016 15:26:09 -0400 David Long wrote: From: "David A. Long" Kprobes searches backwards a finite number of instr

Re: [PATCH v3] arm64: Improve kprobes test for atomic sequence

2016-09-11 Thread David Long
On 09/10/2016 01:48 AM, Masami Hiramatsu wrote: On Fri, 9 Sep 2016 15:26:09 -0400 David Long wrote: From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when i

[PATCH v3] arm64: Improve kprobes test for atomic sequence

2016-09-09 Thread David Long
From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when it hits the maximum number of instructions or a load or store exclusive. However this means it can run up past the beginning

Re: [PATCH v2] arm64: Improve kprobes test for atomic sequence

2016-09-07 Thread David Long
On 09/07/2016 01:52 AM, Masami Hiramatsu wrote: On Tue, 6 Sep 2016 13:54:59 -0400 David Long wrote: From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when i

Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well

2016-09-06 Thread David Long
On 09/06/2016 12:11 PM, Catalin Marinas wrote: On Tue, Aug 02, 2016 at 11:00:07AM +0530, Pratyush Anand wrote: --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -246,6 +246,8 @@ static void send_user_sigtrap(int si_code) static int single_step_handler(unsigne

[PATCH v2] arm64: Improve kprobes test for atomic sequence

2016-09-06 Thread David Long
From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when it hits the maximum number of instructions or a load or store exclusive. However this means it can run up past the beginning

Re: [PATCH] arm64: Improve kprobes test for atomic sequence

2016-09-01 Thread David Long
On 08/31/2016 10:38 PM, Masami Hiramatsu wrote: Hi Dave, On Wed, 31 Aug 2016 16:52:22 -0400 David Long wrote: From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops wh

[PATCH] arm64: Improve kprobes test for atomic sequence

2016-08-31 Thread David Long
From: "David A. Long" Kprobes searches backwards a finite number of instructions to determine if there is an attempt to probe a load/store exclusive sequence. It stops when it hits the maximum number of instructions or a load or store exclusive. However this means it can run up past the beginning

Re: [PATCH] Documentation: kprobes: Document jprobes stack copying limitations

2016-08-15 Thread David Long
On 08/15/2016 11:32 AM, Jonathan Corbet wrote: On Mon, 15 Aug 2016 10:49:36 -0400 David Long wrote: On 08/15/2016 10:25 AM, Jonathan Corbet wrote: On Fri, 12 Aug 2016 16:24:44 -0400 David Long wrote: Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack duplication

Re: [PATCH] Documentation: kprobes: Document jprobes stack copying limitations

2016-08-15 Thread David Long
On 08/15/2016 10:25 AM, Jonathan Corbet wrote: On Fri, 12 Aug 2016 16:24:44 -0400 David Long wrote: Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack duplication for jprobes problematic. Document this. Applied to the docs tree, thanks. jon Was kind of hoping to

[PATCH] Documentation: kprobes: Document jprobes stack copying limitations

2016-08-12 Thread David Long
From: "David A. Long" Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack duplication for jprobes problematic. Document this. Signed-off-by: David A. Long --- Documentation/kprobes.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/kprobes.

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-08-10 Thread David Long
On 08/09/2016 01:23 PM, Catalin Marinas wrote: On Mon, Aug 08, 2016 at 10:29:05AM -0400, David Long wrote: On 08/08/2016 07:13 AM, Daniel Thompson wrote: On 04/08/16 05:47, David Long wrote: >From b451caa1adaf1d03e08a44b5dad3fca31cebd97a Mon Sep 17 00:00:00 2001 From: "David A. Lon

[PATCH 1/1] arm64: Remove stack duplicating code from jprobes

2016-08-10 Thread David Long
From: "David A. Long" Because the arm64 calling standard allows stacked function arguments to be anywhere in the stack frame, do not attempt to duplicate the stack frame for jprobes handler functions. Documenation changes to describe this issue have been broken out into a separate patch in order

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-08-08 Thread David Long
On 08/08/2016 07:13 AM, Daniel Thompson wrote: On 04/08/16 05:47, David Long wrote: From b451caa1adaf1d03e08a44b5dad3fca31cebd97a Mon Sep 17 00:00:00 2001 From: "David A. Long" Date: Thu, 4 Aug 2016 00:35:33 -0400 Subject: [PATCH] arm64: Remove stack duplicating code from jprobes B

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-08-03 Thread David Long
On 07/29/2016 05:01 AM, Daniel Thompson wrote: > On 28/07/16 15:40, Catalin Marinas wrote: >> On Wed, Jul 27, 2016 at 06:13:37PM -0400, David Long wrote: >>> On 07/27/2016 07:50 AM, Daniel Thompson wrote: >>>> On 25/07/16 23:27, David Long wrote: >>>>>

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-27 Thread David Long
On 07/27/2016 07:50 AM, Daniel Thompson wrote: On 25/07/16 23:27, David Long wrote: On 07/25/2016 01:13 PM, Catalin Marinas wrote: On Fri, Jul 22, 2016 at 11:51:32AM -0400, David Long wrote: On 07/22/2016 06:16 AM, Catalin Marinas wrote: On Thu, Jul 21, 2016 at 02:33:52PM -0400, David Long

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-25 Thread David Long
On 07/25/2016 01:13 PM, Catalin Marinas wrote: On Fri, Jul 22, 2016 at 11:51:32AM -0400, David Long wrote: On 07/22/2016 06:16 AM, Catalin Marinas wrote: On Thu, Jul 21, 2016 at 02:33:52PM -0400, David Long wrote: On 07/21/2016 01:23 PM, Marc Zyngier wrote: On 21/07/16 17:33, David Long

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-22 Thread David Long
On 07/22/2016 06:16 AM, Catalin Marinas wrote: On Thu, Jul 21, 2016 at 02:33:52PM -0400, David Long wrote: On 07/21/2016 01:23 PM, Marc Zyngier wrote: On 21/07/16 17:33, David Long wrote: On 07/20/2016 12:09 PM, Marc Zyngier wrote: On 08/07/16 17:35, David Long wrote: +#define MAX_INSN_SIZE

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-21 Thread David Long
On 07/21/2016 01:23 PM, Marc Zyngier wrote: On 21/07/16 17:33, David Long wrote: On 07/20/2016 12:09 PM, Marc Zyngier wrote: On 08/07/16 17:35, David Long wrote: From: Sandeepa Prabhu Add support for basic kernel probes(kprobes) and jump probes (jprobes) for ARM64. Kprobes utilizes

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-21 Thread David Long
On 07/20/2016 12:09 PM, Marc Zyngier wrote: On 08/07/16 17:35, David Long wrote: From: Sandeepa Prabhu Add support for basic kernel probes(kprobes) and jump probes (jprobes) for ARM64. Kprobes utilizes software breakpoint and single step debug exceptions supported on ARM v8. A software

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-21 Thread David Long
On 07/20/2016 11:49 AM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:48PM -0400, David Long wrote: +#define MIN_STACK_SIZE(addr) (on_irq_stack(addr, raw_smp_processor_id()) ? \ + min((unsigned long)IRQ_STACK_SIZE, \ + IRQ_STACK_PTR(raw_smp_processor_id()) - (addr

Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-20 Thread David Long
On 07/20/2016 05:36 AM, Marc Zyngier wrote: On 08/07/16 17:35, David Long wrote: From: Sandeepa Prabhu Add support for basic kernel probes(kprobes) and jump probes (jprobes) for ARM64. Kprobes utilizes software breakpoint and single step debug exceptions supported on ARM v8. A software

Re: [PATCH v15 08/10] arm64: Add trampoline code for kretprobes

2016-07-20 Thread David Long
On 07/19/2016 09:46 AM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:52PM -0400, David Long wrote: --- /dev/null +++ b/arch/arm64/kernel/probes/kprobes_trampoline.S @@ -0,0 +1,85 @@ +/* + * trampoline entry and return code for kretprobes. + */ + +#include +#include +#include

Re: [PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-19 Thread David Long
On 07/19/2016 02:27 PM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:44PM -0400, David Long wrote: From: "David A. Long" This patchset is heavily based on Sandeepa Prabhu's ARM v8 kprobes patches, first seen in October 2013. This version attempts to address con

Re: [PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-19 Thread David Long
On 07/19/2016 09:57 AM, Catalin Marinas wrote: On Thu, Jul 14, 2016 at 05:22:08PM +0100, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:44PM -0400, David Long wrote: David A. Long (3): arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature arm64: Add more test functions to insn.c

Re: [PATCH v15 06/10] arm64: Treat all entry code as non-kprobe-able

2016-07-18 Thread David Long
On 07/15/2016 12:47 PM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:50PM -0400, David Long wrote: --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -243,6 +243,7 @@ tsk .reqx28 // current thread_info * Exception vectors. */ + .pushsection

Re: [PATCH v15 01/10] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature

2016-07-15 Thread David Long
On 07/15/2016 11:13 AM, Catalin Marinas wrote: On Fri, Jul 15, 2016 at 10:51:23AM -0400, David Long wrote: On 07/15/2016 06:57 AM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:45PM -0400, David Long wrote: --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h

Re: [PATCH v15 01/10] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature

2016-07-15 Thread David Long
On 07/15/2016 06:57 AM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:45PM -0400, David Long wrote: --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h @@ -74,6 +74,7 @@ #define COMPAT_PT_DATA_ADDR 0x10004 #define COMPAT_PT_TEXT_END_ADDR

Re: [PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-14 Thread David Long
On 07/14/2016 12:22 PM, Catalin Marinas wrote: On Fri, Jul 08, 2016 at 12:35:44PM -0400, David Long wrote: David A. Long (3): arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature arm64: Add more test functions to insn.c arm64: add conditional instruction simulation support Pratyush Anand

[PATCH v15 04/10] arm64: Kprobes with single stepping support

2016-07-08 Thread David Long
From: Sandeepa Prabhu Add support for basic kernel probes(kprobes) and jump probes (jprobes) for ARM64. Kprobes utilizes software breakpoint and single step debug exceptions supported on ARM v8. A software breakpoint is placed at the probe address to trap the kernel execution into the kprobe ha

[PATCH v15 03/10] arm64: add conditional instruction simulation support

2016-07-08 Thread David Long
From: "David A. Long" Cease using the arm32 arm_check_condition() function and replace it with a local version for use in deprecated instruction support on arm64. Also make the function table used by this available for future use by kprobes and/or uprobes. This function is derived from code writ

[PATCH v15 07/10] arm64: kprobes instruction simulation support

2016-07-08 Thread David Long
From: Sandeepa Prabhu Kprobes needs simulation of instructions that cannot be stepped from a different memory location, e.g.: those instructions that uses PC-relative addressing. In simulation, the behaviour of the instruction is implemented using a copy of pt_regs. The following instruction cat

[PATCH v15 02/10] arm64: Add more test functions to insn.c

2016-07-08 Thread David Long
From: "David A. Long" Certain instructions are hard to execute correctly out-of-line (as in kprobes). Test functions are added to insn.[hc] to identify these. The instructions include any that use PC-relative addressing, change the PC, or change interrupt masking. For efficiency and simplicity

[PATCH v15 05/10] arm64: Blacklist non-kprobe-able symbol

2016-07-08 Thread David Long
From: Pratyush Anand Add all function symbols which are called from do_debug_exception under NOKPROBE_SYMBOL, as they can not kprobed. Signed-off-by: Pratyush Anand Acked-by: Masami Hiramatsu --- arch/arm64/kernel/arm64ksyms.c | 2 ++ arch/arm64/kernel/debug-monitors.c | 17 +

[PATCH v15 10/10] kprobes: Add arm64 case in kprobe example module

2016-07-08 Thread David Long
From: Sandeepa Prabhu Add info prints in sample kprobe handlers for ARM64 Signed-off-by: Sandeepa Prabhu Signed-off-by: David A. Long Acked-by: Masami Hiramatsu --- samples/kprobes/kprobe_example.c | 9 + 1 file changed, 9 insertions(+) diff --git a/samples/kprobes/kprobe_example.c

[PATCH v15 09/10] arm64: Add kernel return probes support (kretprobes)

2016-07-08 Thread David Long
From: Sandeepa Prabhu The pre-handler of this special 'trampoline' kprobe executes the return probe handler functions and restores original return address in ELR_EL1. This way the saved pt_regs still hold the original register context to be carried back to the probed kernel function. Signed-off-

[PATCH v15 00/10] arm64: Add kernel probes (kprobes) support

2016-07-08 Thread David Long
From: "David A. Long" This patchset is heavily based on Sandeepa Prabhu's ARM v8 kprobes patches, first seen in October 2013. This version attempts to address concerns raised by reviewers and also fixes problems discovered during testing. This patchset adds support for kernel probes(kprobes), ju

[PATCH v15 06/10] arm64: Treat all entry code as non-kprobe-able

2016-07-08 Thread David Long
From: Pratyush Anand Entry symbols are not kprobe safe. So blacklist them for kprobing. Signed-off-by: Pratyush Anand Signed-off-by: David A. Long Acked-by: Masami Hiramatsu --- arch/arm64/kernel/entry.S | 3 +++ arch/arm64/kernel/probes/kprobes.c | 26 ++ a

[PATCH v15 08/10] arm64: Add trampoline code for kretprobes

2016-07-08 Thread David Long
From: William Cohen The trampoline code is used by kretprobes to capture a return from a probed function. This is done by saving the registers, calling the handler, and restoring the registers. The code then returns to the original saved caller return address. It is necessary to do this directly

[PATCH v15 01/10] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature

2016-07-08 Thread David Long
From: "David A. Long" Add HAVE_REGS_AND_STACK_ACCESS_API feature for arm64, including supporting functions and defines. Signed-off-by: David A. Long Acked-by: Masami Hiramatsu --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/ptrace.h | 52 ++ arch/arm64/ker

Re: [PATCH v14 04/10] arm64: Kprobes with single stepping support

2016-06-27 Thread David Long
On 06/27/2016 02:57 AM, Pratyush Anand wrote: Hi David, On 26/06/2016:11:06:47 PM, David Long wrote: From: Sandeepa Prabhu Add support for basic kernel probes(kprobes) and jump probes (jprobes) for ARM64. Kprobes utilizes software breakpoint and single step debug exceptions supported on ARM

[PATCH v14 01/10] arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature

2016-06-26 Thread David Long
From: "David A. Long" Add HAVE_REGS_AND_STACK_ACCESS_API feature for arm64, including supporting functions and defines. Signed-off-by: David A. Long --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/ptrace.h | 52 ++ arch/arm64/kernel/ptrace.c | 118

[PATCH v14 06/10] arm64: Treat all entry code as non-kprobe-able

2016-06-26 Thread David Long
From: Pratyush Anand Entry symbols are not kprobe safe. So blacklist them for kprobing. Signed-off-by: Pratyush Anand Signed-off-by: David A. Long Acked-by: Masami Hiramatsu --- arch/arm64/kernel/entry.S | 3 +++ arch/arm64/kernel/kprobes/kprobes.c | 26 ++

  1   2   3   4   5   >