All of lore.kernel.org
 help / color / mirror / Atom feed
From: Auger Eric <eric.auger@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, maz@kernel.org,
	james.morse@arm.com, julien.thierry.kdev@gmail.com,
	suzuki.poulose@arm.com
Subject: Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()
Date: Tue, 15 Dec 2020 10:15:12 +0100	[thread overview]
Message-ID: <594ae6f5-ad00-6279-e963-8b047c0209d6@redhat.com> (raw)
In-Reply-To: <eba17923-3e33-3e3d-0cf0-8f66d389146b@arm.com>

Hi Alexandru,

On 12/14/20 3:02 PM, Alexandru Elisei wrote:
> Hi Eric,
> 
> Thanks for having a look!
> 
> On 12/14/20 1:48 PM, Auger Eric wrote:
>> Alexandru,
>>
>> On 12/1/20 4:01 PM, Alexandru Elisei wrote:
>>> KVM_ARM_VCPU_INIT ioctl calls kvm_reset_vcpu(), which in turn resets the
>>> PMU with a call to kvm_pmu_vcpu_reset(). The function zeroes the PMU
>>> chained counters bitmap and stops all the counters with a perf event
>>> attached. Because it is called before the VCPU has had the chance to run,
>>> no perf events are in use and none are released.
>>>
>>> kvm_arm_pmu_v3_enable(), called by kvm_vcpu_first_run_init() only if the
>>> VCPU has not been initialized, also resets the PMU. kvm_pmu_vcpu_reset() in
>> This sounds strange to me. kvm_vcpu_first_run_init() only is called if
>> kvm_vcpu_initialized(vcpu) is true.
> 
> Typo on my part, the "not" should not be there. kvm_vcpu_first_run_init() is
> called only if kvm_vcpu_initialized() returns true in kvm_arch_vcpu_ioctl_run().
> 
>>> this case does the exact same thing as the previous call, so remove it.
>>>
>>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>>> ---
>>>  arch/arm64/kvm/pmu-emul.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c
>>> index 398f6df1bbe4..4ad66a532e38 100644
>>> --- a/arch/arm64/kvm/pmu-emul.c
>>> +++ b/arch/arm64/kvm/pmu-emul.c
>>> @@ -850,8 +850,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu)
>>>  		   return -EINVAL;
>>>  	}
>>>  
>>> -	kvm_pmu_vcpu_reset(vcpu);
>>> -
>> this patch does not apply for me (vcpu->arch.pmu.ready = true; ?)
> 
> I should have mentioned it in the cover letter, this is on top of Marc's pmu-undef
> branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/pmu-undef
> 
> it should work on top of commit 7521c3a9e630 ("KVM: arm64: Get ready of the PMU
> ready state"), the branch was rebased since I sent the patches.
OK noted.

Thanks

Eric
> 
> Thanks,
> Alex
>>
>> Thanks
>>
>> Eric
>>>  	return 0;
>>>  }
>>>  
>>>
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

_______________________________________________
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: Auger Eric <eric.auger@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, maz@kernel.org,
	james.morse@arm.com, julien.thierry.kdev@gmail.com,
	suzuki.poulose@arm.com
Subject: Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()
Date: Tue, 15 Dec 2020 10:15:12 +0100	[thread overview]
Message-ID: <594ae6f5-ad00-6279-e963-8b047c0209d6@redhat.com> (raw)
In-Reply-To: <eba17923-3e33-3e3d-0cf0-8f66d389146b@arm.com>

Hi Alexandru,

On 12/14/20 3:02 PM, Alexandru Elisei wrote:
> Hi Eric,
> 
> Thanks for having a look!
> 
> On 12/14/20 1:48 PM, Auger Eric wrote:
>> Alexandru,
>>
>> On 12/1/20 4:01 PM, Alexandru Elisei wrote:
>>> KVM_ARM_VCPU_INIT ioctl calls kvm_reset_vcpu(), which in turn resets the
>>> PMU with a call to kvm_pmu_vcpu_reset(). The function zeroes the PMU
>>> chained counters bitmap and stops all the counters with a perf event
>>> attached. Because it is called before the VCPU has had the chance to run,
>>> no perf events are in use and none are released.
>>>
>>> kvm_arm_pmu_v3_enable(), called by kvm_vcpu_first_run_init() only if the
>>> VCPU has not been initialized, also resets the PMU. kvm_pmu_vcpu_reset() in
>> This sounds strange to me. kvm_vcpu_first_run_init() only is called if
>> kvm_vcpu_initialized(vcpu) is true.
> 
> Typo on my part, the "not" should not be there. kvm_vcpu_first_run_init() is
> called only if kvm_vcpu_initialized() returns true in kvm_arch_vcpu_ioctl_run().
> 
>>> this case does the exact same thing as the previous call, so remove it.
>>>
>>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>>> ---
>>>  arch/arm64/kvm/pmu-emul.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c
>>> index 398f6df1bbe4..4ad66a532e38 100644
>>> --- a/arch/arm64/kvm/pmu-emul.c
>>> +++ b/arch/arm64/kvm/pmu-emul.c
>>> @@ -850,8 +850,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu)
>>>  		   return -EINVAL;
>>>  	}
>>>  
>>> -	kvm_pmu_vcpu_reset(vcpu);
>>> -
>> this patch does not apply for me (vcpu->arch.pmu.ready = true; ?)
> 
> I should have mentioned it in the cover letter, this is on top of Marc's pmu-undef
> branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/pmu-undef
> 
> it should work on top of commit 7521c3a9e630 ("KVM: arm64: Get ready of the PMU
> ready state"), the branch was rebased since I sent the patches.
OK noted.

Thanks

Eric
> 
> Thanks,
> Alex
>>
>> Thanks
>>
>> Eric
>>>  	return 0;
>>>  }
>>>  
>>>
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


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

  reply	other threads:[~2020-12-15  9:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 15:01 [PATCH 0/5] KVM: arm64: Miscellaneous improvements Alexandru Elisei
2020-12-01 15:01 ` Alexandru Elisei
2020-12-01 15:01 ` [PATCH 1/5] KVM: Documentation: Add arm64 KVM_RUN error codes Alexandru Elisei
2020-12-01 15:01   ` Alexandru Elisei
2020-12-01 15:01 ` [PATCH 2/5] KVM: arm64: arch_timer: Remove VGIC initialization check Alexandru Elisei
2020-12-01 15:01   ` Alexandru Elisei
2020-12-14 12:45   ` Auger Eric
2020-12-14 12:45     ` Auger Eric
2020-12-01 15:01 ` [PATCH 3/5] KVM: arm64: Move double-checked lock to kvm_vgic_map_resources() Alexandru Elisei
2020-12-01 15:01   ` Alexandru Elisei
2020-12-14 12:55   ` Auger Eric
2020-12-14 12:55     ` Auger Eric
2020-12-27 14:36     ` Marc Zyngier
2020-12-27 14:36       ` Marc Zyngier
2020-12-01 15:01 ` [PATCH 4/5] KVM: arm64: Update comment in kvm_vgic_map_resources() Alexandru Elisei
2020-12-01 15:01   ` Alexandru Elisei
2020-12-14 12:59   ` Auger Eric
2020-12-14 12:59     ` Auger Eric
2020-12-01 15:01 ` [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset() Alexandru Elisei
2020-12-01 15:01   ` Alexandru Elisei
2020-12-14 13:48   ` Auger Eric
2020-12-14 13:48     ` Auger Eric
2020-12-14 14:02     ` Alexandru Elisei
2020-12-14 14:02       ` Alexandru Elisei
2020-12-15  9:15       ` Auger Eric [this message]
2020-12-15  9:15         ` Auger Eric
2020-12-27 14:41 ` [PATCH 0/5] KVM: arm64: Miscellaneous improvements Marc Zyngier
2020-12-27 14:41   ` Marc Zyngier

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=594ae6f5-ad00-6279-e963-8b047c0209d6@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@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.