[PATCH v2 5/6] kselftest/arm64: Verify KSM page merge for MTE pages

2020-10-02 Thread Amit Daniel Kachhap
: Catalin Marinas Cc: Will Deacon Signed-off-by: Amit Daniel Kachhap --- Changes in v2: * Moved read/write sysfs functions from global to local functions. tools/testing/selftests/arm64/mte/.gitignore | 1 + .../selftests/arm64/mte/check_ksm_options.c | 159 ++ 2 files changed

[PATCH v2 1/6] kselftest/arm64: Add utilities and a test to validate mte memory

2020-10-02 Thread Amit Daniel Kachhap
Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- Changes in v2: * Redefined MTE kernel header definitions to decouple kselftest compilations. * Removed gmi masking instructions in mte_insert_random_tag assembly function. This simplifies the tag inclusion mask test with only

[PATCH v2 6/6] kselftest/arm64: Check mte tagged user address in kernel

2020-10-02 Thread Amit Daniel Kachhap
and other similar interfaces fails if a user memory with invalid tag is accessed in kernel. In async mode no such failure occurs. Cc: Shuah Khan Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Amit Daniel Kachhap --- Changes in v2: * Updated the test to handle the error properly in case of failure

[PATCH v2 4/6] kselftest/arm64: Verify all different mmap MTE options

2020-10-02 Thread Amit Daniel Kachhap
, mprotect, sync/async error mode and private/shared mappings should work. * mprotect should not be able to clear the PROT_MTE page property. Cc: Shuah Khan Cc: Catalin Marinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap

[PATCH v2 3/6] kselftest/arm64: Check forked child mte memory accessibility

2020-10-02 Thread Amit Daniel Kachhap
: Catalin Marinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/mte/.gitignore | 1 + .../selftests/arm64/mte/check_child_memory.c | 195 ++ 2 files changed, 196 insertions

[PATCH v2 0/6] kselftest: arm64/mte: Tests for user-space MTE

2020-10-02 Thread Amit Daniel Kachhap
. Thanks, Amit Daniel [1]: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/mte [2]: https://patchwork.kernel.org/patch/11747791/ Amit Daniel Kachhap (6): kselftest/arm64: Add utilities and a test to validate mte memory kselftest/arm64: Verify mte tag inclusion via prctl

[PATCH v2 2/6] kselftest/arm64: Verify mte tag inclusion via prctl

2020-10-02 Thread Amit Daniel Kachhap
arinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- Changes in v2: * Small fix to check all tags in check_multiple_included_tags function. tools/testing/selftests/arm64/mte/.gitignore | 1 + .../arm64/mte/check_tags_i

[PATCH 5/6] kselftest/arm64: Verify KSM page merge for MTE pages

2020-09-01 Thread Amit Daniel Kachhap
: Catalin Marinas Cc: Will Deacon Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/mte/.gitignore | 1 + .../selftests/arm64/mte/check_ksm_options.c | 131 ++ 2 files changed, 132 insertions(+) create mode 100644 tools/testing/selftests/arm64/mte

[PATCH 6/6] kselftest/arm64: Check mte tagged user address in kernel

2020-09-01 Thread Amit Daniel Kachhap
if a user memory with invalid tag is accessed in kernel. In async mode no such fault occurs. Cc: Shuah Khan Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/mte/.gitignore | 1 + .../selftests/arm64/mte/check_user_mem.c | 118

[PATCH 4/6] kselftest/arm64: Verify all different mmap MTE options

2020-09-01 Thread Amit Daniel Kachhap
, mprotect, sync/async error mode and private/shared mappings should work. * mprotect should not be able to clear the PROT_MTE page property. Cc: Shuah Khan Cc: Catalin Marinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap

[PATCH 1/6] kselftest/arm64: Add utilities and a test to validate mte memory

2020-09-01 Thread Amit Daniel Kachhap
=mte CC='compiler' Cc: Shuah Khan Cc: Catalin Marinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/Makefile| 2 +- tools/testing/selftests/arm64/mte/.gitignore | 1 + tools

[PATCH 3/6] kselftest/arm64: Check forked child mte memory accessibility

2020-09-01 Thread Amit Daniel Kachhap
: Catalin Marinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/mte/.gitignore | 1 + .../selftests/arm64/mte/check_child_memory.c | 195 ++ 2 files changed, 196 insertions

[PATCH 2/6] kselftest/arm64: Verify mte tag inclusion via prctl

2020-09-01 Thread Amit Daniel Kachhap
arinas Cc: Will Deacon Co-developed-by: Gabor Kertesz Signed-off-by: Gabor Kertesz Signed-off-by: Amit Daniel Kachhap --- tools/testing/selftests/arm64/mte/.gitignore | 1 + .../arm64/mte/check_tags_inclusion.c | 183 ++ 2 files changed, 184 insertions(+) create mode 10

[PATCH 0/6] kselftest: arm64/mte: Tests for user-space MTE

2020-09-01 Thread Amit Daniel Kachhap
of the patchset on top of a recent linux tree can be found at [2]. Thanks, Amit Daniel [1]: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/mte [2]: http://linux-arm.org/git?p=linux-ak.git;a=shortlog;h=refs/heads/kselftest-mte-mainline-v1 Amit Daniel Kachhap (6): kselftest

[PATCH v3 2/2] Documentation/vmcoreinfo: Add documentation for 'KERNELPACMASK'

2020-05-11 Thread Amit Daniel Kachhap
-off-by: Amit Daniel Kachhap --- Documentation/admin-guide/kdump/vmcoreinfo.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst index 007a6b8..e4ee8b2 100644 --- a/Documentation/admin-guide

[PATCH v3 1/2] arm64/crash_core: Export KERNELPACMASK in vmcoreinfo

2020-05-11 Thread Amit Daniel Kachhap
entication feature may be missing at runtime even though this config is present. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Amit Daniel Kachhap --- Changes since v2: * Removed CONFIG_ARM64_PTR_AUTH config guard as suggested by Will. * A commit log change. An impl

Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-05-28 Thread Amit Daniel Kachhap
Hi Dave, On 5/28/19 3:41 PM, Dave Martin wrote: On Wed, Apr 24, 2019 at 02:41:21PM +0100, Dave Martin wrote: On Wed, Apr 24, 2019 at 12:32:22PM +0530, Amit Daniel Kachhap wrote: Hi, On 4/23/19 9:16 PM, Dave Martin wrote: [...] diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c index 7780251

Re: [PATCH v7 7/10] KVM: arm/arm64: context-switch ptrauth registers

2019-03-25 Thread Amit Daniel Kachhap
Hi, On 3/26/19 1:34 AM, Kristina Martsenko wrote: On 19/03/2019 08:30, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy context switch

Re: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-03-04 Thread Amit Daniel Kachhap
Hi Dave, On 3/1/19 4:54 PM, Dave P Martin wrote: On Fri, Mar 01, 2019 at 10:37:54AM +, Amit Daniel Kachhap wrote: Hi, On 2/21/19 9:24 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:31PM +0530, Amit Daniel Kachhap wrote: [...] diff --git a/arm/aarch64/include/kvm/kvm-config

Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-03-04 Thread Amit Daniel Kachhap
Hi James, On 2/27/19 12:03 AM, James Morse wrote: Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: This feature will allow the KVM guest to allow the handling of pointer authentication instructions or to treat them as undefined if not set. It uses the existing vcpu API

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-03-04 Thread Amit Daniel Kachhap
Hi James, On 2/27/19 12:01 AM, James Morse wrote: Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy context

Re: [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-03-02 Thread Amit Daniel Kachhap
Hi, On 2/25/19 11:09 PM, James Morse wrote: Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: From: Mark Rutland When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which is a constant value. This works today, as the host HCR_EL2 value is always the same

Re: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-03-01 Thread Amit Daniel Kachhap
Hi, On 2/21/19 9:24 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:31PM +0530, Amit Daniel Kachhap wrote: This is a runtime capabality for KVM tool to enable Armv8.3 Pointer Authentication in guest kernel. A command line option --ptrauth is required for this. Signed-off-by: Amit Daniel

Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-03-01 Thread Amit Daniel Kachhap
Hi, On 2/21/19 9:23 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:29PM +0530, Amit Daniel Kachhap wrote: This feature will allow the KVM guest to allow the handling of pointer authentication instructions or to treat them as undefined if not set. It uses the existing vcpu API

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-03-01 Thread Amit Daniel Kachhap
Hi, On 2/21/19 9:23 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:28PM +0530, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy context

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-28 Thread Amit Daniel Kachhap
On 2/21/19 9:21 PM, Dave Martin wrote: On Thu, Feb 21, 2019 at 12:29:42PM +, Mark Rutland wrote: On Tue, Feb 19, 2019 at 02:54:28PM +0530, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary

Re: [PATCH v6 2/6] arm64/kvm: preserve host MDCR_EL2 value

2019-02-28 Thread Amit Daniel Kachhap
Hi, On 2/21/19 9:21 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:27PM +0530, Amit Daniel Kachhap wrote: Save host MDCR_EL2 value during kvm HYP initialisation and restore after every switch from host to guest. There should not be any change in functionality due to this. The value

Re: [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-02-28 Thread Amit Daniel Kachhap
Hi, On 2/21/19 9:19 PM, Dave Martin wrote: On Tue, Feb 19, 2019 at 02:54:26PM +0530, Amit Daniel Kachhap wrote: From: Mark Rutland When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which is a constant value. This works today, as the host HCR_EL2 value is always the same

Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-28 Thread Amit Daniel Kachhap
Hi, On 2/21/19 6:04 PM, Mark Rutland wrote: On Tue, Feb 19, 2019 at 02:54:29PM +0530, Amit Daniel Kachhap wrote: This feature will allow the KVM guest to allow the handling of pointer authentication instructions or to treat them as undefined if not set. It uses the existing vcpu API

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-28 Thread Amit Daniel Kachhap
Hi Mark, On 2/21/19 5:59 PM, Mark Rutland wrote: On Tue, Feb 19, 2019 at 02:54:28PM +0530, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy

Re: [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-02-27 Thread Amit Daniel Kachhap
Hi, On 2/21/19 5:20 PM, Mark Rutland wrote: Hi, On Tue, Feb 19, 2019 at 02:54:26PM +0530, Amit Daniel Kachhap wrote: From: Mark Rutland When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which is a constant value. This works today, as the host HCR_EL2 value is always the same

[PATCH v6 0/6] Add ARMv8.3 pointer authentication for kvm guest

2019-02-19 Thread Amit Daniel Kachhap
://lore.kernel.org/linux-arm-kernel/1547757219-19439-13-git-send-email-dave.mar...@arm.com/ Linux (5.0-rc6 based): Amit Daniel Kachhap (5): arm64/kvm: preserve host HCR_EL2 value arm64/kvm: preserve host MDCR_EL2 value arm64/kvm: context-switch ptrauth registers arm64/kvm: add a userspace option

[PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-19 Thread Amit Daniel Kachhap
on a physical CPU which supports the relevant feature). Hence, this patch expects both type of authentication to be present in a cpu. Signed-off-by: Mark Rutland [Only VHE, key switch from from assembly, kvm_supports_ptrauth checks, save host key in vcpu_load] Signed-off-by: Amit Daniel Kachhap

[PATCH v6 2/6] arm64/kvm: preserve host MDCR_EL2 value

2019-02-19 Thread Amit Daniel Kachhap
. Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Mark Rutland Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- arch/arm/include/asm/kvm_host.h | 1 - arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/kvm/debug.c| 28 ++-- arch/arm64/kvm

[PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-19 Thread Amit Daniel Kachhap
via SET/GET_ONE_REG interface as just a flag (KVM_ARM_VCPU_PTRAUTH) supplied is enough to enable this feature. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- Documentation/arm64/pointer-authentication.txt | 9

[PATCH v6 5/6] arm64/kvm: control accessibility of ptrauth key registers

2019-02-19 Thread Amit Daniel Kachhap
). Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- This patch needs patch [1] by Dave Martin and adds feature to manage accessibility in a scalable way. [1]: https://lore.kernel.org/linux-arm-kernel/1547757219-19439

[kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-02-19 Thread Amit Daniel Kachhap
This is a runtime capabality for KVM tool to enable Armv8.3 Pointer Authentication in guest kernel. A command line option --ptrauth is required for this. Signed-off-by: Amit Daniel Kachhap --- arm/aarch32/include/kvm/kvm-cpu-arch.h| 1 + arm/aarch64/include/asm/kvm.h | 1 + arm

[PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-02-19 Thread Amit Daniel Kachhap
in __tlb_switch_to_guest_vhe(). The value of hcr_el2 is now stored in struct kvm_cpu_context as both host and guest can now use this field in a common way. Signed-off-by: Mark Rutland [Added __cpu_copy_hyp_conf, hcr_el2 field in struct kvm_cpu_context] Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Christoffer

Re: [PATCH v5 5/5] arm64/kvm: control accessibility of ptrauth key registers

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:24 PM, Dave P Martin wrote: On Wed, Feb 13, 2019 at 05:35:46PM +, Kristina Martsenko wrote: On 28/01/2019 06:58, Amit Daniel Kachhap wrote: According to userspace settings, ptrauth key registers are conditionally present in guest system register list based on user

Re: [PATCH v5 4/5] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:05 PM, Kristina Martsenko wrote: On 28/01/2019 06:58, Amit Daniel Kachhap wrote: This feature will allow the KVM guest to allow the handling of pointer authentication instructions or to treat them as undefined if not set. It uses the existing vcpu API KVM_ARM_VCPU_INIT

Re: [PATCH v5 3/5] arm64/kvm: context-switch ptrauth register

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:05 PM, Kristina Martsenko wrote: On 31/01/2019 16:25, James Morse wrote: Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work

Re: [PATCH v5 3/5] arm64/kvm: context-switch ptrauth registers

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:04 PM, Kristina Martsenko wrote: Hi Amit, (Please always Cc: everyone who commented on previous versions of the series.) On 28/01/2019 06:58, Amit Daniel Kachhap wrote: When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM

Re: [PATCH v5 2/5] arm64/kvm: preserve host HCR_EL2/MDCR_EL2 value

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:04 PM, Kristina Martsenko wrote: On 28/01/2019 06:58, Amit Daniel Kachhap wrote: When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which is a constant value. This works today, as the host HCR_EL2 value is always the same, but this will get in the way

Re: [PATCH v5 1/5] arm64: Add utilities to save restore pointer authentication keys

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 2/13/19 11:02 PM, Kristina Martsenko wrote: On 31/01/2019 16:20, James Morse wrote: Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: The keys can be switched either inside an assembly or such functions which do not have pointer authentication checks, so a GCC attribute

Re: [PATCH v5 4/5] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-14 Thread Amit Daniel Kachhap
Hi, On 1/31/19 9:57 PM, James Morse wrote: Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: This feature will allow the KVM guest to allow the handling of pointer authentication instructions or to treat them as undefined if not set. It uses the existing vcpu API KVM_ARM_VCPU_INIT

Re: [PATCH v5 3/5] arm64/kvm: context-switch ptrauth register

2019-02-14 Thread Amit Daniel Kachhap
Hi James, On 1/31/19 9:55 PM, James Morse wrote: Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy context switch of the pointer

Re: [PATCH v5 2/5] arm64/kvm: preserve host HCR_EL2/MDCR_EL2 value

2019-02-14 Thread Amit Daniel Kachhap
Hi James, Little late in replying as some issue in my mail settings. On 1/31/19 9:52 PM, James Morse wrote: Hi Amit, On 28/01/2019 06:58, Amit Daniel Kachhap wrote: When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which is a constant value. This works today, as the host

Re: [PATCH v4 4/6] arm64/kvm: enable pointer authentication cpufeature conditionally

2019-01-27 Thread Amit Daniel Kachhap
Hi James, On Fri, Jan 4, 2019 at 11:32 PM James Morse wrote: > > Hi Amit, > > On 18/12/2018 07:56, Amit Daniel Kachhap wrote: > > According to userspace settings, pointer authentication cpufeature > > is enabled/disabled from guests. > > This reads like the guest is

[kvmtool PATCH v5 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-01-27 Thread Amit Daniel Kachhap
This is a runtime feature and can be enabled by --ptrauth option. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kristina Martsenko Cc: kvm...@lists.cs.columbia.edu Cc: Ramana Radhakrishnan Cc: Will Deacon --- arm/aarch32/include/kvm/kvm-cpu

[PATCH v5 5/5] arm64/kvm: control accessibility of ptrauth key registers

2019-01-27 Thread Amit Daniel Kachhap
According to userspace settings, ptrauth key registers are conditionally present in guest system register list based on user specified flag KVM_ARM_VCPU_PTRAUTH. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: Kristina Martsenko Cc: kvm

[PATCH v5 3/5] arm64/kvm: context-switch ptrauth registers

2019-01-27 Thread Amit Daniel Kachhap
, these attempts will result in an UNDEF being taken by the guest. Signed-off-by: Mark Rutland Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Christoffer Dall Cc: Kristina Martsenko Cc: kvm...@lists.cs.columbia.edu Cc: Ramana Radhakrishnan Cc: Will Deacon --- arch/arm/include/asm/kvm_host.h

[PATCH v5 4/5] arm64/kvm: add a userspace option to enable pointer authentication

2019-01-27 Thread Amit Daniel Kachhap
via SET/GET_ONE_REG interface as just a flag (KVM_ARM_VCPU_PTRAUTH) supplied is enough to enable this feature. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: Kristina Martsenko Cc: kvm...@lists.cs.columbia.edu Cc: Ramana Radhakrishnan Cc

[PATCH v5 0/6] Add ARMv8.3 pointer authentication for kvm guest

2019-01-27 Thread Amit Daniel Kachhap
/10/17/594 [6]: https://lkml.org/lkml/2018/12/18/80 Linux (5.0-rc3 based): Amit Daniel Kachhap (5): arm64: Add utilities to save restore pointer authentication keys arm64/kvm: preserve host HCR_EL2/MDCR_EL2 value arm64/kvm: context-switch ptrauth registers arm64/kvm: add a userspace

[PATCH v5 2/5] arm64/kvm: preserve host HCR_EL2/MDCR_EL2 value

2019-01-27 Thread Amit Daniel Kachhap
MDCR_EL2 value is fetched in a similar way and restored after every switch from host to guest. There should not be any change in functionality due to this. Signed-off-by: Mark Rutland Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Christoffer Dall Cc: Kristina Martsenko Cc: kvm

[PATCH v5 1/5] arm64: Add utilities to save restore pointer authentication keys

2019-01-27 Thread Amit Daniel Kachhap
. This may be useful for save/restore scenarios when CPU changes privilege levels, suspend/resume etc. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: Kristina Martsenko Cc: kvm...@lists.cs.columbia.edu Cc: Ramana Radhakrishnan Cc: Will Deacon

Re: [PATCH v4 4/6] arm64/kvm: enable pointer authentication cpufeature conditionally

2019-01-09 Thread Amit Daniel Kachhap
Hi, On Fri, Jan 4, 2019 at 11:32 PM James Morse wrote: > > Hi Amit, > > On 18/12/2018 07:56, Amit Daniel Kachhap wrote: > > According to userspace settings, pointer authentication cpufeature > > is enabled/disabled from guests. > > This reads like the guest is

Re: [PATCH v4 3/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-01-09 Thread Amit Daniel Kachhap
Hi, On Sat, Jan 5, 2019 at 12:05 AM James Morse wrote: > > Hi Amit, > > On 18/12/2018 07:56, Amit Daniel Kachhap wrote: > > This feature will allow the KVM guest to allow the handling of > > pointer authentication instructions or to treat them as undefined > > if

Re: [PATCH v4 2/6] arm64/kvm: context-switch ptrauth registers

2019-01-09 Thread Amit Daniel Kachhap
Hi, On Sat, Jan 5, 2019 at 12:05 AM James Morse wrote: > > Hi Amit, > > On 18/12/2018 07:56, Amit Daniel Kachhap wrote: > > When pointer authentication is supported, a guest may wish to use it. > > This patch adds the necessary KVM infrastructure for this to work, with

Re: [PATCH v4 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-01-07 Thread Amit Daniel Kachhap
Hi, On Sat, Jan 5, 2019 at 12:05 AM James Morse wrote: > > Hi Amit, > > On 18/12/2018 07:56, Amit Daniel Kachhap wrote: > > When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which > > is a constant value. This works today, as the host HCR_EL2 valu

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-06 Thread Amit Daniel Kachhap
es since v5: > > * fix mentioned pc in x0 to hold the start address of the call site, > not the return address or the branch address. > This resolves the problem found by Amit. Function graph tracer display works fine with this version. From my side, Tested by: Amit Daniel

[PATCH v4 3/6] arm64/kvm: add a userspace option to enable pointer authentication

2018-12-17 Thread Amit Daniel Kachhap
via SET/GET_ONE_REG interface as just a flag (KVM_ARM_VCPU_PTRAUTH) supplied is enough to select this feature. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- Documentation/arm64/pointer-authentication.txt | 9

[PATCH v4 1/6] arm64/kvm: preserve host HCR_EL2 value

2018-12-17 Thread Amit Daniel Kachhap
Rutland Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm64/include/asm/kvm_asm.h | 2 ++ arch/arm64/include/asm/kvm_host.h | 14 -- arch/arm64/kvm/hyp/switch.c

[PATCH v4 4/6] arm64/kvm: enable pointer authentication cpufeature conditionally

2018-12-17 Thread Amit Daniel Kachhap
According to userspace settings, pointer authentication cpufeature is enabled/disabled from guests. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvm...@lists.cs.columbia.edu --- Documentation/arm64/pointer-authentication.txt | 3 +++ arch

[PATCH v4 5/6] arm64/kvm: control accessibility of ptrauth key registers

2018-12-17 Thread Amit Daniel Kachhap
According to userspace settings, ptrauth key registers are conditionally present in guest system register list based on user specified flag KVM_ARM_VCPU_PTRAUTH. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvm...@lists.cs.columbia.edu

[PATCH v4 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2018-12-17 Thread Amit Daniel Kachhap
This is a runtime feature and can be enabled by --ptrauth option. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvm...@lists.cs.columbia.edu --- arm/aarch32/include/kvm/kvm-cpu-arch.h| 2 ++ arm/aarch64/include/asm/kvm.h | 3

[PATCH v4 2/6] arm64/kvm: context-switch ptrauth registers

2018-12-17 Thread Amit Daniel Kachhap
, these attemts will result in an UNDEF being taken by the guest. Signed-off-by: Mark Rutland Signed-off-by: Amit Daniel Kachhap Cc: Marc Zyngier Cc: Christoffer Dall Cc: kvm...@lists.cs.columbia.edu --- arch/arm/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/cpufeature.h | 6 +++ arch/arm64

[PATCH v4 0/6] Add ARMv8.3 pointer authentication for kvm guest

2018-12-17 Thread Amit Daniel Kachhap
://lkml.org/lkml/2018/10/17/594 Linux (4.20-rc5 based): Amit Daniel Kachhap (5): arm64/kvm: preserve host HCR_EL2 value arm64/kvm: context-switch ptrauth registers arm64/kvm: add a userspace option to enable pointer authentication arm64/kvm: enable pointer authentication cpufeature

Re: [PATCH v5] arm64: implement ftrace with regs

2018-12-16 Thread Amit Daniel Kachhap
Hi, On Sat, Dec 15, 2018 at 6:14 PM Torsten Duwe wrote: > > On Fri, 14 Dec 2018 21:45:03 +0530 > Amit Daniel Kachhap wrote: > > > Sorry I didn't mention my environment. I am using 4.20-rc3 and it has > > all the above 8 extra patches > > mentioned by you. > &g

Re: [PATCH v5] arm64: implement ftrace with regs

2018-12-14 Thread Amit Daniel Kachhap
Hi, On Fri, Dec 14, 2018 at 3:18 PM Torsten Duwe wrote: > > On Thu, Dec 13, 2018 at 11:01:38PM +0530, Amit Daniel Kachhap wrote: > > On Fri, Nov 30, 2018 at 9:53 PM Torsten Duwe wrote: > > > > Hi Torsten, > > > > I was testing your patch and it seems to work f

Re: [PATCH v5] arm64: implement ftrace with regs

2018-12-13 Thread Amit Daniel Kachhap
On Fri, Nov 30, 2018 at 9:53 PM Torsten Duwe wrote: > > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > of each function. Replace the first NOP thus generated with a quick LR > saver (move it to scratch reg x9), so the 2nd replacement insn, the call > to ftrace, does not

[PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-30 Thread Amit Daniel Kachhap
This fix rounds the clock rate properly by using quotient and not remainder in the calculation. This issue was found while testing HDMI in the Juno platform. Fixes: 6d6a1d82eaef7 ("clk: add support for clocks provided by SCMI") Acked-by: Sudeep Holla Signed-off-by: Amit Dani

[PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-30 Thread Amit Daniel Kachhap
This fix rounds the clock rate properly by using quotient and not remainder in the calculation. This issue was found while testing HDMI in the Juno platform. Fixes: 6d6a1d82eaef7 ("clk: add support for clocks provided by SCMI") Acked-by: Sudeep Holla Signed-off-by: Amit Dani

Re: [PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-30 Thread Amit Daniel Kachhap
On Mon, Jul 30, 2018 at 5:10 PM, Sudeep Holla wrote: > On Mon, Jul 30, 2018 at 11:03:51AM +0530, Amit Daniel Kachhap wrote: >> Hi, >> >> On Fri, Jul 27, 2018 at 10:07 PM, Stephen Boyd wrote: >> > Quoting Amit Daniel Kachhap (2018-07-27 07:01:52) >> >&g

Re: [PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-30 Thread Amit Daniel Kachhap
On Mon, Jul 30, 2018 at 5:10 PM, Sudeep Holla wrote: > On Mon, Jul 30, 2018 at 11:03:51AM +0530, Amit Daniel Kachhap wrote: >> Hi, >> >> On Fri, Jul 27, 2018 at 10:07 PM, Stephen Boyd wrote: >> > Quoting Amit Daniel Kachhap (2018-07-27 07:01:52) >> >&g

Re: [PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-29 Thread Amit Daniel Kachhap
Hi, On Fri, Jul 27, 2018 at 10:07 PM, Stephen Boyd wrote: > Quoting Amit Daniel Kachhap (2018-07-27 07:01:52) >> This fix rounds the clock rate properly by using quotient and not >> remainder in the calculation. This issue was found while testing HDMI >> in the Juno platf

Re: [PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-29 Thread Amit Daniel Kachhap
Hi, On Fri, Jul 27, 2018 at 10:07 PM, Stephen Boyd wrote: > Quoting Amit Daniel Kachhap (2018-07-27 07:01:52) >> This fix rounds the clock rate properly by using quotient and not >> remainder in the calculation. This issue was found while testing HDMI >> in the Juno platf

[PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-27 Thread Amit Daniel Kachhap
This fix rounds the clock rate properly by using quotient and not remainder in the calculation. This issue was found while testing HDMI in the Juno platform. Signed-off-by: Amit Daniel Kachhap --- drivers/clk/clk-scmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH] clk: scmi: Fix the rounding of clock rate

2018-07-27 Thread Amit Daniel Kachhap
This fix rounds the clock rate properly by using quotient and not remainder in the calculation. This issue was found while testing HDMI in the Juno platform. Signed-off-by: Amit Daniel Kachhap --- drivers/clk/clk-scmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 10/10] scsi: ufs-exynos: add UFS host support for Exynos SoCs

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:58 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > This patch introduces Exynos UFS host controller driver, > which mainly handles vendor-specific operations including > link startup, power mode change and hibernation/unhibernation. > > Signed-off-by: Seungwon Jeon >

Re: [PATCH 09/10] scsi: ufs: return value of pwr_change_notify

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:58 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > Behavior of the "powwer mode change" contains vendor specific s/powwer/power > operation known as pwr_change_notify. This change adds return > for pwr_change_notify to find success or failure. > > Signed-off-by:

Re: [PATCH 08/10] scsi: ufs: make ufshcd_config_pwr_mode of non-static func

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > It can be used in the vendor's driver for the specific purpose. more description of this log will be useful. > > Signed-off-by: Seungwon Jeon > Signed-off-by: Alim Akhtar > --- > drivers/scsi/ufs/ufshcd.c |5

Re: [PATCH 07/10] scsi: ufs: add add specific callback for hibern8

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > Some host controller needs specific handling before/after > (un)hibernation, This change adds specific callback function > to support vendor's implementation. > > Signed-off-by: Seungwon Jeon > Signed-off-by: Alim

Re: [PATCH 04/10] scsi: ufs: add quirk not to allow reset of interrupt aggregation

2015-08-26 Thread amit daniel kachhap
Few comments below, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > Some host controller supports interrupt aggregation, but doesn't > allow to reset counter and timer by s/w. > > Signed-off-by: Seungwon Jeon > Signed-off-by: Alim Akhtar > --- >

Re: [PATCH 02/10] scsi: ufs: add quirk to contain unconformable utrd field

2015-08-26 Thread amit daniel kachhap
Few minor comments below, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > UTRD(UTP Transfer Request Descriptor)'s field such as offset/length, > especially response's has DWORD expression. This quirk can be specified > for host controller not to conform standard. >

Re: [PATCH 01/10] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC

2015-08-26 Thread amit daniel kachhap
Hi, Few minor comments, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar wrote: > From: Seungwon Jeon > > This patch introduces Exynos UFS PHY driver. This driver > supports to deal with phy calibration and power control > according to UFS host driver's behavior. > > Signed-off-by: Seungwon Jeon

Re: [PATCH 07/10] scsi: ufs: add add specific callback for hibern8

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com Some host controller needs specific handling before/after (un)hibernation, This change adds specific callback function to support vendor's implementation. Signed-off-by:

Re: [PATCH 10/10] scsi: ufs-exynos: add UFS host support for Exynos SoCs

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:58 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com This patch introduces Exynos UFS host controller driver, which mainly handles vendor-specific operations including link startup, power mode change and

Re: [PATCH 01/10] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC

2015-08-26 Thread amit daniel kachhap
Hi, Few minor comments, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com This patch introduces Exynos UFS PHY driver. This driver supports to deal with phy calibration and power control according to UFS host driver's

Re: [PATCH 08/10] scsi: ufs: make ufshcd_config_pwr_mode of non-static func

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com It can be used in the vendor's driver for the specific purpose. more description of this log will be useful. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by:

Re: [PATCH 02/10] scsi: ufs: add quirk to contain unconformable utrd field

2015-08-26 Thread amit daniel kachhap
Few minor comments below, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com UTRD(UTP Transfer Request Descriptor)'s field such as offset/length, especially response's has DWORD expression. This quirk can be specified for host

Re: [PATCH 04/10] scsi: ufs: add quirk not to allow reset of interrupt aggregation

2015-08-26 Thread amit daniel kachhap
Few comments below, On Fri, Aug 21, 2015 at 2:57 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com Some host controller supports interrupt aggregation, but doesn't allow to reset counter and timer by s/w. Signed-off-by: Seungwon Jeon

Re: [PATCH 09/10] scsi: ufs: return value of pwr_change_notify

2015-08-26 Thread amit daniel kachhap
On Fri, Aug 21, 2015 at 2:58 PM, Alim Akhtar alim.akh...@samsung.com wrote: From: Seungwon Jeon tgih@samsung.com Behavior of the powwer mode change contains vendor specific s/powwer/power operation known as pwr_change_notify. This change adds return for pwr_change_notify to find success

Re: [PATCH 04/13] thermal: Fix not emulating critical temperatures

2015-03-26 Thread amit daniel kachhap
Hi Sascha, On Thu, Mar 26, 2015 at 9:23 PM, Sascha Hauer wrote: > commit e6e238c38 (thermal: sysfs: Add a new sysfs node emul_temp for > thermal emulation) promised not to emulate critical temperatures, > but the check for critical temperatures is broken in multiple ways: > > - The code should

Re: [PATCH 04/13] thermal: Fix not emulating critical temperatures

2015-03-26 Thread amit daniel kachhap
Hi Sascha, On Thu, Mar 26, 2015 at 9:23 PM, Sascha Hauer s.ha...@pengutronix.de wrote: commit e6e238c38 (thermal: sysfs: Add a new sysfs node emul_temp for thermal emulation) promised not to emulate critical temperatures, but the check for critical temperatures is broken in multiple ways: -

Re: [PATCH RFC v4 1/3] PM / Runtime: Add an API pm_runtime_set_slave

2015-02-12 Thread amit daniel kachhap
Hi Alan, On Mon, Feb 9, 2015 at 9:28 PM, Alan Stern wrote: > On Mon, 9 Feb 2015, Amit Daniel Kachhap wrote: > >> This API creates a pm runtime slave type device which does not itself >> participates in pm runtime but depends on the master devices to power >> manage them.

Re: [PATCH RFC v4 1/3] PM / Runtime: Add an API pm_runtime_set_slave

2015-02-12 Thread amit daniel kachhap
Hi Alan, On Mon, Feb 9, 2015 at 9:28 PM, Alan Stern st...@rowland.harvard.edu wrote: On Mon, 9 Feb 2015, Amit Daniel Kachhap wrote: This API creates a pm runtime slave type device which does not itself participates in pm runtime but depends on the master devices to power manage them

[PATCH RFC v4 2/3] PM / Domains: Save restore slave pm runtime devices

2015-02-09 Thread Amit Daniel Kachhap
Based on the runtime request of the active device, the callbacks of the passive pm runtime devices will be invoked. Signed-off-by: Amit Daniel Kachhap --- drivers/base/power/domain.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/base/power/domain.c b

[PATCH RFC v4 3/3] clk: samsung: Add PM runtime support for clocks.

2015-02-09 Thread Amit Daniel Kachhap
device with the power domain. Signed-off-by: Amit Daniel Kachhap --- drivers/clk/samsung/clk.c | 93 +++ drivers/clk/samsung/clk.h | 11 ++ 2 files changed, 104 insertions(+) diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index

[PATCH RFC v4 1/3] PM / Runtime: Add an API pm_runtime_set_slave

2015-02-09 Thread Amit Daniel Kachhap
/pm_runtime_put due to subsystems interaction behaviour or any other reason. Signed-off-by: Amit Daniel Kachhap --- drivers/base/power/runtime.c | 18 ++ include/linux/pm.h | 1 + include/linux/pm_runtime.h | 2 ++ 3 files changed, 21 insertions(+) diff --git a/drivers

[PATCH RFC v4 0/3] PM / Runtime: Feature to power manage slave devices

2015-02-09 Thread Amit Daniel Kachhap
://www.spinics.net/lists/linux-samsung-soc/msg38442.html) This work may also assist exynos iommu pm runtime posted earlier by Marek http://lists.linaro.org/pipermail/linaro-mm-sig/2014-August/004099.html Amit Daniel Kachhap (3): PM / Runtime: Add an API pm_runtime_set_slave PM / Domains: Save restore

  1   2   3   4   5   6   7   8   9   10   >