All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: KVM: Register CPU notifiers when the kernel runs at HYP
Date: Wed, 30 Mar 2016 17:46:41 +0100	[thread overview]
Message-ID: <56FC02F1.5060804@arm.com> (raw)
In-Reply-To: <56FBFF12.60109@arm.com>

On 30/03/16 17:30, Marc Zyngier wrote:
>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>> index 6accd66d26f0..cf0184edf4f5 100644
>> --- a/arch/arm/kvm/arm.c
>> +++ b/arch/arm/kvm/arm.c
>> @@ -1084,9 +1092,13 @@ static int hyp_init_cpu_pm_notifier(struct notifier_block *self,
>>  				    unsigned long cmd,
>>  				    void *v)
>>  {
>> -	if (cmd == CPU_PM_EXIT &&
>> -	    __hyp_get_vectors() == hyp_default_vectors) {
>> -		cpu_init_hyp_mode(NULL);
>> +	if (cmd == CPU_PM_EXIT) {
>> +		if (is_kernel_in_hyp_mode()) {
>> +			cpu_init_stage2(NULL);
>> +		} else {
>> +			if (__hyp_get_vectors() == hyp_default_vectors)
>> +				cpu_init_hyp_mode(NULL);
>> +		}
> 
> Any reason why we can't isolate that snippet in a separate function and
> use it in both locations?

I thought I did that ... bother, wrong branch.

We can argue about the name, I called it 'cpu_hyp_reinit()', which pairs up with
'cpu_hyp_reset()' in a rebased version of the kexec/hibernate hyp-shutdown code.
(cpu_ seems to be the prefix for per-cpu functions in this file)

v2 shortly,


Thanks/Sorry,

James

WARNING: multiple messages have this Message-ID (diff)
From: james.morse@arm.com (James Morse)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: KVM: Register CPU notifiers when the kernel runs at HYP
Date: Wed, 30 Mar 2016 17:46:41 +0100	[thread overview]
Message-ID: <56FC02F1.5060804@arm.com> (raw)
In-Reply-To: <56FBFF12.60109@arm.com>

On 30/03/16 17:30, Marc Zyngier wrote:
>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>> index 6accd66d26f0..cf0184edf4f5 100644
>> --- a/arch/arm/kvm/arm.c
>> +++ b/arch/arm/kvm/arm.c
>> @@ -1084,9 +1092,13 @@ static int hyp_init_cpu_pm_notifier(struct notifier_block *self,
>>  				    unsigned long cmd,
>>  				    void *v)
>>  {
>> -	if (cmd == CPU_PM_EXIT &&
>> -	    __hyp_get_vectors() == hyp_default_vectors) {
>> -		cpu_init_hyp_mode(NULL);
>> +	if (cmd == CPU_PM_EXIT) {
>> +		if (is_kernel_in_hyp_mode()) {
>> +			cpu_init_stage2(NULL);
>> +		} else {
>> +			if (__hyp_get_vectors() == hyp_default_vectors)
>> +				cpu_init_hyp_mode(NULL);
>> +		}
> 
> Any reason why we can't isolate that snippet in a separate function and
> use it in both locations?

I thought I did that ... bother, wrong branch.

We can argue about the name, I called it 'cpu_hyp_reinit()', which pairs up with
'cpu_hyp_reset()' in a rebased version of the kexec/hibernate hyp-shutdown code.
(cpu_ seems to be the prefix for per-cpu functions in this file)

v2 shortly,


Thanks/Sorry,

James

  reply	other threads:[~2016-03-30 16:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 15:56 [PATCH] arm64: KVM: Register CPU notifiers when the kernel runs at HYP James Morse
2016-03-30 15:56 ` James Morse
2016-03-30 16:30 ` Marc Zyngier
2016-03-30 16:30   ` Marc Zyngier
2016-03-30 16:46   ` James Morse [this message]
2016-03-30 16:46     ` James Morse

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=56FC02F1.5060804@arm.com \
    --to=james.morse@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@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.