All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Kristina Martsenko <kristina.martsenko@arm.com>,
	Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication
Date: Tue, 28 May 2019 18:18:16 +0530	[thread overview]
Message-ID: <53ecc253-e9e0-a6ca-2540-fa85bd26bfc1@arm.com> (raw)
In-Reply-To: <20190528101128.GB28398@e103592.cambridge.arm.com>

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..acd1d5f 100644
>>>>> --- a/arm/kvm-cpu.c
>>>>> +++ b/arm/kvm-cpu.c
>>>>> @@ -68,6 +68,18 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   		vcpu_init.features[0] |= (1UL << KVM_ARM_VCPU_PSCI_0_2);
>>>>>   	}
>>>>> +	/* Check Pointer Authentication command line arguments. */
>>>>> +	if (kvm->cfg.arch.enable_ptrauth && kvm->cfg.arch.disable_ptrauth)
>>>>> +		die("Both enable-ptrauth and disable-ptrauth option cannot be present");
>>>>
>>>> Preferably, print the leading dashes, the same as the user would see
>>>> on the command line (e.g., --enable-ptrauth, --disable-ptrauth).
>>>>
>>>> For brevity, we could write something like:
>>>>
>>>> 		die("--enable-ptrauth conflicts with --disable-ptrauth");
> 
> [...]
> 
>>>>> @@ -106,8 +118,12 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   			die("Unable to find matching target");
>>>>>   	}
>>>>> -	if (err || target->init(vcpu))
>>>>> -		die("Unable to initialise vcpu");
>>>>> +	if (err || target->init(vcpu)) {
>>>>> +		if (kvm->cfg.arch.enable_ptrauth)
>>>>> +			die("Unable to initialise vcpu with pointer authentication feature");
>>>>
>>>> We don't special-case this error message for any other feature yet:
>>>> there are a variety of reasons why we might have failed, so suggesting
>>>> that the failure is something to do with ptrauth may be misleading to
>>>> the user.
>>>>
>>>> If we want to be more informative, we could do something like the
>>>> following:
>>>>
>>>> 	bool supported;
>>>>
>>>> 	supported = kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_ADDRESS) &&
>>>> 		    kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_GENERIC);
>>>>
>>>> 	if (kvm->cfg.arch.enable_ptrauth && !supported)
>>>> 		die("--enable-ptrauth not supported on this host");
>>>>
>>>> 	if (supported && !kvm->cfg.arch.disable_ptrauth)
>>>> 		vcpu_init.features[0] |= ARM_VCPU_PTRAUTH_FEATURE;
>>>>
>>>> 	/* ... */
>>>>
>>>> 	if (err || target->init(vcpu))
>>>> 		die("Unable to initialise vcpu");
>>>>
>>>> We don't do this for any other feature today, but since it helps the
>>>> user to understand what went wrong it's probably a good idea.
>>> Yes this is more clear. As Mark has picked the core guest ptrauth patches. I
>>> will post this changes as standalone.
>>
>> Sounds good.  (I also need to do that separately for SVE...)
> 
> Were you planning to repost this?
> 
> Alternatively, I can fix up the diagnostic messages discussed here and
> post it together with the SVE support.  I'll do that locally for now,
> but let me know what you plan to do.  I'd like to get the SVE support
> posted soon so that people can test it.
I will clean up the print messages as you suggested and repost it shortly.

Thanks,
Amit Daniel
> 
> Cheers
> ---Dave
> 

WARNING: multiple messages have this Message-ID (diff)
From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Kristina Martsenko <kristina.martsenko@arm.com>,
	Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication
Date: Tue, 28 May 2019 18:18:16 +0530	[thread overview]
Message-ID: <53ecc253-e9e0-a6ca-2540-fa85bd26bfc1@arm.com> (raw)
In-Reply-To: <20190528101128.GB28398@e103592.cambridge.arm.com>

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..acd1d5f 100644
>>>>> --- a/arm/kvm-cpu.c
>>>>> +++ b/arm/kvm-cpu.c
>>>>> @@ -68,6 +68,18 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   		vcpu_init.features[0] |= (1UL << KVM_ARM_VCPU_PSCI_0_2);
>>>>>   	}
>>>>> +	/* Check Pointer Authentication command line arguments. */
>>>>> +	if (kvm->cfg.arch.enable_ptrauth && kvm->cfg.arch.disable_ptrauth)
>>>>> +		die("Both enable-ptrauth and disable-ptrauth option cannot be present");
>>>>
>>>> Preferably, print the leading dashes, the same as the user would see
>>>> on the command line (e.g., --enable-ptrauth, --disable-ptrauth).
>>>>
>>>> For brevity, we could write something like:
>>>>
>>>> 		die("--enable-ptrauth conflicts with --disable-ptrauth");
> 
> [...]
> 
>>>>> @@ -106,8 +118,12 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   			die("Unable to find matching target");
>>>>>   	}
>>>>> -	if (err || target->init(vcpu))
>>>>> -		die("Unable to initialise vcpu");
>>>>> +	if (err || target->init(vcpu)) {
>>>>> +		if (kvm->cfg.arch.enable_ptrauth)
>>>>> +			die("Unable to initialise vcpu with pointer authentication feature");
>>>>
>>>> We don't special-case this error message for any other feature yet:
>>>> there are a variety of reasons why we might have failed, so suggesting
>>>> that the failure is something to do with ptrauth may be misleading to
>>>> the user.
>>>>
>>>> If we want to be more informative, we could do something like the
>>>> following:
>>>>
>>>> 	bool supported;
>>>>
>>>> 	supported = kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_ADDRESS) &&
>>>> 		    kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_GENERIC);
>>>>
>>>> 	if (kvm->cfg.arch.enable_ptrauth && !supported)
>>>> 		die("--enable-ptrauth not supported on this host");
>>>>
>>>> 	if (supported && !kvm->cfg.arch.disable_ptrauth)
>>>> 		vcpu_init.features[0] |= ARM_VCPU_PTRAUTH_FEATURE;
>>>>
>>>> 	/* ... */
>>>>
>>>> 	if (err || target->init(vcpu))
>>>> 		die("Unable to initialise vcpu");
>>>>
>>>> We don't do this for any other feature today, but since it helps the
>>>> user to understand what went wrong it's probably a good idea.
>>> Yes this is more clear. As Mark has picked the core guest ptrauth patches. I
>>> will post this changes as standalone.
>>
>> Sounds good.  (I also need to do that separately for SVE...)
> 
> Were you planning to repost this?
> 
> Alternatively, I can fix up the diagnostic messages discussed here and
> post it together with the SVE support.  I'll do that locally for now,
> but let me know what you plan to do.  I'd like to get the SVE support
> posted soon so that people can test it.
I will clean up the print messages as you suggested and repost it shortly.

Thanks,
Amit Daniel
> 
> Cheers
> ---Dave
> 
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Amit Daniel Kachhap <amit.kachhap@arm.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Kristina Martsenko <kristina.martsenko@arm.com>,
	Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication
Date: Tue, 28 May 2019 18:18:16 +0530	[thread overview]
Message-ID: <53ecc253-e9e0-a6ca-2540-fa85bd26bfc1@arm.com> (raw)
In-Reply-To: <20190528101128.GB28398@e103592.cambridge.arm.com>

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..acd1d5f 100644
>>>>> --- a/arm/kvm-cpu.c
>>>>> +++ b/arm/kvm-cpu.c
>>>>> @@ -68,6 +68,18 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   		vcpu_init.features[0] |= (1UL << KVM_ARM_VCPU_PSCI_0_2);
>>>>>   	}
>>>>> +	/* Check Pointer Authentication command line arguments. */
>>>>> +	if (kvm->cfg.arch.enable_ptrauth && kvm->cfg.arch.disable_ptrauth)
>>>>> +		die("Both enable-ptrauth and disable-ptrauth option cannot be present");
>>>>
>>>> Preferably, print the leading dashes, the same as the user would see
>>>> on the command line (e.g., --enable-ptrauth, --disable-ptrauth).
>>>>
>>>> For brevity, we could write something like:
>>>>
>>>> 		die("--enable-ptrauth conflicts with --disable-ptrauth");
> 
> [...]
> 
>>>>> @@ -106,8 +118,12 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>>>>>   			die("Unable to find matching target");
>>>>>   	}
>>>>> -	if (err || target->init(vcpu))
>>>>> -		die("Unable to initialise vcpu");
>>>>> +	if (err || target->init(vcpu)) {
>>>>> +		if (kvm->cfg.arch.enable_ptrauth)
>>>>> +			die("Unable to initialise vcpu with pointer authentication feature");
>>>>
>>>> We don't special-case this error message for any other feature yet:
>>>> there are a variety of reasons why we might have failed, so suggesting
>>>> that the failure is something to do with ptrauth may be misleading to
>>>> the user.
>>>>
>>>> If we want to be more informative, we could do something like the
>>>> following:
>>>>
>>>> 	bool supported;
>>>>
>>>> 	supported = kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_ADDRESS) &&
>>>> 		    kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_GENERIC);
>>>>
>>>> 	if (kvm->cfg.arch.enable_ptrauth && !supported)
>>>> 		die("--enable-ptrauth not supported on this host");
>>>>
>>>> 	if (supported && !kvm->cfg.arch.disable_ptrauth)
>>>> 		vcpu_init.features[0] |= ARM_VCPU_PTRAUTH_FEATURE;
>>>>
>>>> 	/* ... */
>>>>
>>>> 	if (err || target->init(vcpu))
>>>> 		die("Unable to initialise vcpu");
>>>>
>>>> We don't do this for any other feature today, but since it helps the
>>>> user to understand what went wrong it's probably a good idea.
>>> Yes this is more clear. As Mark has picked the core guest ptrauth patches. I
>>> will post this changes as standalone.
>>
>> Sounds good.  (I also need to do that separately for SVE...)
> 
> Were you planning to repost this?
> 
> Alternatively, I can fix up the diagnostic messages discussed here and
> post it together with the SVE support.  I'll do that locally for now,
> but let me know what you plan to do.  I'd like to get the SVE support
> posted soon so that people can test it.
I will clean up the print messages as you suggested and repost it shortly.

Thanks,
Amit Daniel
> 
> Cheers
> ---Dave
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-28 12:48 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  4:42 [PATCH v10 0/5] Add ARMv8.3 pointer authentication for kvm guest Amit Daniel Kachhap
2019-04-23  4:42 ` Amit Daniel Kachhap
2019-04-23  4:42 ` Amit Daniel Kachhap
2019-04-23  4:42 ` [PATCH v10 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23 15:44   ` Dave Martin
2019-04-23 15:44     ` Dave Martin
2019-04-23 15:44     ` Dave Martin
2019-04-24  5:57     ` Amit Daniel Kachhap
2019-04-24  5:57       ` Amit Daniel Kachhap
2019-04-24  5:57       ` Amit Daniel Kachhap
2019-04-24 13:42       ` Dave Martin
2019-04-24 13:42         ` Dave Martin
2019-04-24 13:42         ` Dave Martin
2019-04-23  4:42 ` [PATCH v10 2/5] KVM: arm/arm64: context-switch ptrauth registers Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  9:39   ` Marc Zyngier
2019-04-23  9:39     ` Marc Zyngier
2019-04-23  9:39     ` Marc Zyngier
2019-04-23  9:39     ` Marc Zyngier
2019-04-23 10:24     ` Amit Daniel Kachhap
2019-04-23 10:24       ` Amit Daniel Kachhap
2019-04-23 10:24       ` Amit Daniel Kachhap
2019-04-23 15:44       ` Dave Martin
2019-04-23 15:44         ` Dave Martin
2019-04-23 15:44         ` Dave Martin
2019-04-24 10:29         ` Marc Zyngier
2019-04-24 10:29           ` Marc Zyngier
2019-04-24 10:29           ` Marc Zyngier
2019-04-24 13:40           ` Dave Martin
2019-04-24 13:40             ` Dave Martin
2019-04-24 13:40             ` Dave Martin
2019-04-24 13:39   ` Dave Martin
2019-04-24 13:39     ` Dave Martin
2019-04-24 13:39     ` Dave Martin
2019-04-24 13:39     ` Dave Martin
2019-04-24 14:29     ` Marc Zyngier
2019-04-24 14:29       ` Marc Zyngier
2019-04-24 14:29       ` Marc Zyngier
2019-04-24 14:30       ` Dave P Martin
2019-04-24 14:30         ` Dave P Martin
2019-04-24 14:30         ` Dave P Martin
2019-04-24 14:30         ` Dave P Martin
2019-04-23  4:42 ` [PATCH v10 3/5] KVM: arm64: Add userspace flag to enable pointer authentication Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23 15:45   ` Dave Martin
2019-04-23 15:45     ` Dave Martin
2019-04-23 15:45     ` Dave Martin
2019-04-24  6:39     ` Amit Daniel Kachhap
2019-04-24  6:39       ` Amit Daniel Kachhap
2019-04-24  6:39       ` Amit Daniel Kachhap
2019-04-23  4:42 ` [PATCH v10 4/5] KVM: arm64: Add capability to advertise ptrauth for guest Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23 15:45   ` Dave Martin
2019-04-23 15:45     ` Dave Martin
2019-04-23 15:45     ` Dave Martin
2019-04-23  4:42 ` [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23  4:42   ` Amit Daniel Kachhap
2019-04-23 15:46   ` Dave Martin
2019-04-23 15:46     ` Dave Martin
2019-04-23 15:46     ` Dave Martin
2019-04-24  7:02     ` Amit Daniel Kachhap
2019-04-24  7:02       ` Amit Daniel Kachhap
2019-04-24  7:02       ` Amit Daniel Kachhap
2019-04-24 13:41       ` Dave Martin
2019-04-24 13:41         ` Dave Martin
2019-04-24 13:41         ` Dave Martin
2019-05-28 10:11         ` Dave Martin
2019-05-28 10:11           ` Dave Martin
2019-05-28 10:11           ` Dave Martin
2019-05-28 12:48           ` Amit Daniel Kachhap [this message]
2019-05-28 12:48             ` Amit Daniel Kachhap
2019-05-28 12:48             ` Amit Daniel Kachhap
2019-05-28 13:38             ` Dave Martin
2019-05-28 13:38               ` Dave Martin
2019-05-28 13:38               ` Dave Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53ecc253-e9e0-a6ca-2540-fa85bd26bfc1@arm.com \
    --to=amit.kachhap@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=kristina.martsenko@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=ramana.radhakrishnan@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.