All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, pbonzini@redhat.com
Cc: Like Xu <like.xu@linux.intel.com>, Will Deacon <will@kernel.org>,
	Marc Zyngier <maz@kernel.org>, Guo Ren <guoren@kernel.org>,
	Nick Hu <nickhu@andestech.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org,
	linux-riscv@lists.infradead.org, xen-devel@lists.xenproject.org,
	Peter Zijlstra <peterz@infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	bp@alien8.de, kan.liang@linux.intel.com
Subject: Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks
Date: Wed, 23 Jun 2021 17:06:36 +0800	[thread overview]
Message-ID: <43f6bb94-616c-f0c9-edc6-a72ea1244f59@intel.com> (raw)
In-Reply-To: <92fdf981-68ef-92a2-b1ae-0c5f347ae460@oracle.com>

Thanks Boris, I will fix this in V8

On 6/23/2021 1:31 AM, Boris Ostrovsky wrote:
>
> On 6/22/21 5:38 AM, Zhu Lingshan wrote:
>
>> -static int xen_is_user_mode(void)
>> -{
>> -	const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
>> +	state |= PERF_GUEST_ACTIVE;
>>   
>> -	if (!xenpmu_data) {
>> -		pr_warn_once("%s: pmudata not initialized\n", __func__);
>> -		return 0;
>> +	if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_PV) {
>> +		if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_USER)
>> +			state |= PERF_GUEST_USER;
>> +	} else {
>> +		if (!!(xenpmu_data->pmu.r.regs.cpl & 3))
>> +			state |= PERF_GUEST_USER;
>
>
> Please drop "!!", it's not needed here. And use "else if".
>
>
> With that, for Xen bits:
>
> Reviewed-by: Boris Ostrovsky <boris.ostrvsky@oracle.com>
>
> -boris
>


WARNING: multiple messages have this Message-ID (diff)
From: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, pbonzini@redhat.com
Cc: Like Xu <like.xu@linux.intel.com>, Will Deacon <will@kernel.org>,
	Marc Zyngier <maz@kernel.org>, Guo Ren <guoren@kernel.org>,
	Nick Hu <nickhu@andestech.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org,
	linux-riscv@lists.infradead.org, xen-devel@lists.xenproject.org,
	Peter Zijlstra <peterz@infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	bp@alien8.de, kan.liang@linux.intel.com
Subject: Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks
Date: Wed, 23 Jun 2021 17:06:36 +0800	[thread overview]
Message-ID: <43f6bb94-616c-f0c9-edc6-a72ea1244f59@intel.com> (raw)
In-Reply-To: <92fdf981-68ef-92a2-b1ae-0c5f347ae460@oracle.com>

Thanks Boris, I will fix this in V8

On 6/23/2021 1:31 AM, Boris Ostrovsky wrote:
>
> On 6/22/21 5:38 AM, Zhu Lingshan wrote:
>
>> -static int xen_is_user_mode(void)
>> -{
>> -	const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
>> +	state |= PERF_GUEST_ACTIVE;
>>   
>> -	if (!xenpmu_data) {
>> -		pr_warn_once("%s: pmudata not initialized\n", __func__);
>> -		return 0;
>> +	if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_PV) {
>> +		if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_USER)
>> +			state |= PERF_GUEST_USER;
>> +	} else {
>> +		if (!!(xenpmu_data->pmu.r.regs.cpl & 3))
>> +			state |= PERF_GUEST_USER;
>
>
> Please drop "!!", it's not needed here. And use "else if".
>
>
> With that, for Xen bits:
>
> Reviewed-by: Boris Ostrovsky <boris.ostrvsky@oracle.com>
>
> -boris
>


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

WARNING: multiple messages have this Message-ID (diff)
From: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, pbonzini@redhat.com
Cc: Like Xu <like.xu@linux.intel.com>, Nick Hu <nickhu@andestech.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Marc Zyngier <maz@kernel.org>,
	linux-csky@vger.kernel.org, Guo Ren <guoren@kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	bp@alien8.de, xen-devel@lists.xenproject.org,
	linux-riscv@lists.infradead.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org, kan.liang@linux.intel.com
Subject: Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks
Date: Wed, 23 Jun 2021 17:06:36 +0800	[thread overview]
Message-ID: <43f6bb94-616c-f0c9-edc6-a72ea1244f59@intel.com> (raw)
In-Reply-To: <92fdf981-68ef-92a2-b1ae-0c5f347ae460@oracle.com>

Thanks Boris, I will fix this in V8

On 6/23/2021 1:31 AM, Boris Ostrovsky wrote:
>
> On 6/22/21 5:38 AM, Zhu Lingshan wrote:
>
>> -static int xen_is_user_mode(void)
>> -{
>> -	const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
>> +	state |= PERF_GUEST_ACTIVE;
>>   
>> -	if (!xenpmu_data) {
>> -		pr_warn_once("%s: pmudata not initialized\n", __func__);
>> -		return 0;
>> +	if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_PV) {
>> +		if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_USER)
>> +			state |= PERF_GUEST_USER;
>> +	} else {
>> +		if (!!(xenpmu_data->pmu.r.regs.cpl & 3))
>> +			state |= PERF_GUEST_USER;
>
>
> Please drop "!!", it's not needed here. And use "else if".
>
>
> With that, for Xen bits:
>
> Reviewed-by: Boris Ostrovsky <boris.ostrvsky@oracle.com>
>
> -boris
>

_______________________________________________
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: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, pbonzini@redhat.com
Cc: Like Xu <like.xu@linux.intel.com>, Will Deacon <will@kernel.org>,
	Marc Zyngier <maz@kernel.org>, Guo Ren <guoren@kernel.org>,
	Nick Hu <nickhu@andestech.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org,
	linux-riscv@lists.infradead.org, xen-devel@lists.xenproject.org,
	Peter Zijlstra <peterz@infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	bp@alien8.de, kan.liang@linux.intel.com
Subject: Re: [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks
Date: Wed, 23 Jun 2021 17:06:36 +0800	[thread overview]
Message-ID: <43f6bb94-616c-f0c9-edc6-a72ea1244f59@intel.com> (raw)
In-Reply-To: <92fdf981-68ef-92a2-b1ae-0c5f347ae460@oracle.com>

Thanks Boris, I will fix this in V8

On 6/23/2021 1:31 AM, Boris Ostrovsky wrote:
>
> On 6/22/21 5:38 AM, Zhu Lingshan wrote:
>
>> -static int xen_is_user_mode(void)
>> -{
>> -	const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
>> +	state |= PERF_GUEST_ACTIVE;
>>   
>> -	if (!xenpmu_data) {
>> -		pr_warn_once("%s: pmudata not initialized\n", __func__);
>> -		return 0;
>> +	if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_PV) {
>> +		if (xenpmu_data->pmu.pmu_flags & PMU_SAMPLE_USER)
>> +			state |= PERF_GUEST_USER;
>> +	} else {
>> +		if (!!(xenpmu_data->pmu.r.regs.cpl & 3))
>> +			state |= PERF_GUEST_USER;
>
>
> Please drop "!!", it's not needed here. And use "else if".
>
>
> With that, for Xen bits:
>
> Reviewed-by: Boris Ostrovsky <boris.ostrvsky@oracle.com>
>
> -boris
>


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

  reply	other threads:[~2021-06-23  9:06 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210622093823.8215-1-lingshan.zhu@intel.com>
2021-06-22  9:38 ` [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks Zhu Lingshan
2021-06-22  9:38   ` Zhu Lingshan
2021-06-22  9:38   ` Zhu Lingshan
2021-06-22  9:38   ` Zhu Lingshan
2021-06-22 17:31   ` Boris Ostrovsky
2021-06-22 17:31     ` Boris Ostrovsky
2021-06-22 17:31     ` Boris Ostrovsky
2021-06-22 17:31     ` Boris Ostrovsky
2021-06-23  9:06     ` Zhu, Lingshan [this message]
2021-06-23  9:06       ` Zhu, Lingshan
2021-06-23  9:06       ` Zhu, Lingshan
2021-06-23  9:06       ` Zhu, Lingshan
2021-06-22  9:42 [PATCH V7 00/18] KVM: x86/pmu: Add *basic* support to enable guest PEBS via DS Zhu Lingshan
2021-06-22  9:42 ` [PATCH V7 01/18] perf/core: Use static_call to optimize perf_guest_info_callbacks Zhu Lingshan
2021-06-22  9:42   ` Zhu Lingshan
2021-06-22  9:42   ` Zhu Lingshan
2021-06-22  9:42   ` Zhu Lingshan
2021-07-02 11:22   ` Peter Zijlstra
2021-07-02 11:22     ` Peter Zijlstra
2021-07-02 11:22     ` Peter Zijlstra
2021-07-02 11:22     ` Peter Zijlstra
2021-07-02 16:00     ` Joe Perches
2021-07-02 16:00       ` Joe Perches
2021-07-02 16:00       ` Joe Perches
2021-07-02 16:00       ` Joe Perches
2021-07-02 16:00       ` Joe Perches
2021-07-02 16:19       ` Peter Zijlstra
2021-07-02 16:19         ` Peter Zijlstra
2021-07-02 16:19         ` Peter Zijlstra
2021-07-02 16:19         ` Peter Zijlstra
2021-07-02 16:42         ` Joe Perches
2021-07-02 16:42           ` Joe Perches
2021-07-02 16:42           ` Joe Perches
2021-07-02 16:42           ` Joe Perches
2021-07-02 16:42           ` Joe Perches
2021-07-02 16:38       ` Mark Rutland
2021-07-02 16:38         ` Mark Rutland
2021-07-02 16:38         ` Mark Rutland
2021-07-02 16:38         ` Mark Rutland
2021-07-02 16:56         ` Joe Perches
2021-07-02 16:56           ` Joe Perches
2021-07-02 16:56           ` Joe Perches
2021-07-02 16:56           ` Joe Perches
2021-07-02 16:56           ` Joe Perches
2021-07-08  8:53     ` Zhu Lingshan
2021-07-08  8:53       ` Zhu Lingshan
2021-07-08  8:53       ` Zhu Lingshan
2021-07-08  8:53       ` Zhu Lingshan

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=43f6bb94-616c-f0c9-edc6-a72ea1244f59@intel.com \
    --to=lingshan.zhu@intel.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=guoren@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=like.xu@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=nickhu@andestech.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.