[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
ed-by: Gabor Kertesz 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

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

2020-10-02 Thread Amit Daniel Kachhap
e 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 fa

[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
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

[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
SUBTARGETS=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/.gitig

[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
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
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 implementati

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 of the

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, but this will

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 of

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, but

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
8]: https://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

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

2019-02-19 Thread Amit Daniel Kachhap
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
__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 to

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, with a

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 of

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 is

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 to

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
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: Will

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

2019-01-27 Thread Amit Daniel Kachhap
/lkml/2018/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

[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
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 value is

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

2019-01-06 Thread Amit Daniel Kachhap
ince 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 Da

[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
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
https://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 cpufe

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 clo

[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) >> >>

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 platform

[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 a

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

2015-08-25 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 > S

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

2015-08-25 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: Seungwo

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

2015-08-25 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-25 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 Akht

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

2015-08-25 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 > --- > drivers/scsi/ufs/

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

2015-08-25 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-25 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 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 o

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.

[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
(http://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 re

Re: [RFC PATCH 1/1] PM / domains: Add support for virtual power domains

2015-01-30 Thread amit daniel kachhap
Hi Karol, I guess this patch series is not complete and use case implementation will be more helpful for clarity. Also I can think of another way in which this complete implementation can be done with pd name as something "pd-virt". This pd can be handled differently inside the platform specific e

Re: [PATCH RFC v3 1/2] PM / Domains: Extend API pm_genpd_dev_need_restore to use restore types

2014-12-17 Thread amit daniel kachhap
On Wed, Dec 17, 2014 at 6:38 PM, Marek Szyprowski wrote: > Hello, > > > On 2014-12-17 03:43, amit daniel kachhap wrote: >> >> On Tue, Dec 16, 2014 at 4:40 PM, Marek Szyprowski >> wrote: >>> >>> Hello, >>> >>> On 2014-12-13 17

Re: [PATCH RFC v3 1/2] PM / Domains: Extend API pm_genpd_dev_need_restore to use restore types

2014-12-17 Thread amit daniel kachhap
On Wed, Dec 17, 2014 at 3:40 AM, Kevin Hilman wrote: > Marek Szyprowski writes: > >> Hello, >> >> On 2014-12-13 17:51, Amit Daniel Kachhap wrote: >>> Instead of using bool to restore suspended devices initially, use flags >>> like GPD_

Re: [PATCH RFC v3 1/2] PM / Domains: Extend API pm_genpd_dev_need_restore to use restore types

2014-12-16 Thread amit daniel kachhap
On Tue, Dec 16, 2014 at 4:40 PM, Marek Szyprowski wrote: > Hello, > > On 2014-12-13 17:51, Amit Daniel Kachhap wrote: >> >> Instead of using bool to restore suspended devices initially, use flags >> like GPD_DEV_SUSPEND_INIT, GPD_DEV_RESTORE_INIT and GPD_DEV_RESTORE_FO

[PATCH v2] PM/ Domains: Export of_genpd_get_from_provider function.

2014-12-14 Thread Amit Daniel Kachhap
: Amit Daniel Kachhap --- Changes from v1: * Added Ulf Hansson Reviewed by. * Cc'd to linux-pm This patch may solve the same purpose which is done by earlier posts 1) https://lkml.org/lkml/2014/11/24/319 - In this there were comments for not using the PM domain name. 2) Ulf Hansson posted a

[PATCH RFC v3 1/2] PM / Domains: Extend API pm_genpd_dev_need_restore to use restore types

2014-12-13 Thread Amit Daniel Kachhap
-off-by: Amit Daniel Kachhap --- This work is continuation of earlier work, In V2: Completely removed notfiers and add support for huge clock list to be suspended and restored. There was some issue in this as some clocks are not exposed and are just initialised by bootloaders. This

[PATCH RFC v3 2/2] clk: samsung: Add PM runtime support for clocks.

2014-12-13 Thread Amit Daniel Kachhap
device with the power domain. Signed-off-by: Amit Daniel Kachhap --- drivers/clk/samsung/clk.c | 95 +++ drivers/clk/samsung/clk.h | 11 ++ 2 files changed, 106 insertions(+) diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index

Re: [PATCH] PM/ Domains: Export of_genpd_get_from_provider function.

2014-12-05 Thread amit daniel kachhap
On Thu, Dec 4, 2014 at 9:09 PM, Ulf Hansson wrote: > On 1 December 2014 at 12:41, Amit Daniel Kachhap > wrote: >> This function looks up a PM domain form the provider. This will be >> useful to add parent/child domain relationship from the SoC specific >> code. The cal

Re: [PATCH v2 2/7] ARM: Exynos: add support for sub-power domains

2014-12-03 Thread amit daniel kachhap
On Wed, Dec 3, 2014 at 6:03 PM, Marek Szyprowski wrote: > This patch adds support for making one power domain a sub-domain of > other domain. This is useful for modeling power dependences for devices > like TV Mixer or Camera ISP, which needs to have more than one power > domain enabled to be oper

[PATCH] PM/ Domains: Export of_genpd_get_from_provider function.

2014-12-01 Thread Amit Daniel Kachhap
This function looks up a PM domain form the provider. This will be useful to add parent/child domain relationship from the SoC specific code. The caller of the function must make sure that PM domain provider is already registered. Signed-off-by: Amit Daniel Kachhap --- This patch may solve the

Re: [PATCH RFC v2 07/12] PM / Domains: export pm_genpd_lookup_name

2014-11-28 Thread amit daniel kachhap
On Thu, Nov 27, 2014 at 7:50 PM, Ulf Hansson wrote: > On 25 November 2014 at 09:48, amit daniel kachhap > wrote: >> On Tue, Nov 25, 2014 at 1:05 PM, Ulf Hansson wrote: >>> On 24 November 2014 at 14:04, Amit Daniel Kachhap >>> wrote: >>>> This API ma

Re: [PATCH RFC v2 08/12] soc: samsung: pm_domain: Add support for parent power domain

2014-11-25 Thread amit daniel kachhap
On Tue, Nov 25, 2014 at 1:29 PM, Ulf Hansson wrote: > On 24 November 2014 at 14:04, Amit Daniel Kachhap > wrote: >> This patch adds supports for parent power domain. This will ensure >> invoking of parent/child power domain on/off in a correct sequence. >> In exy

Re: [PATCH RFC v2 07/12] PM / Domains: export pm_genpd_lookup_name

2014-11-25 Thread amit daniel kachhap
On Tue, Nov 25, 2014 at 1:05 PM, Ulf Hansson wrote: > On 24 November 2014 at 14:04, Amit Daniel Kachhap > wrote: >> This API may be needed to set the power domain parent/child relationship >> in the power domain platform driver. The parent relationship is >> generally s

  1   2   3   4   5   6   >