public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "chenxiang (M)" <chenxiang66@hisilicon.com>
Cc: <oliver.upton@linux.dev>, <james.morse@arm.com>,
	<kvmarm@lists.linux.dev>, <kvm@vger.kernel.org>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH] KVM: arm64: Fix the name of sys_reg_desc related to PMU
Date: Thu, 13 Jul 2023 10:40:20 +0100	[thread overview]
Message-ID: <86wmz4up2z.wl-maz@kernel.org> (raw)
In-Reply-To: <4cbcc10d-6cd2-d88e-b15d-bd4f1a229251@hisilicon.com>

On Thu, 13 Jul 2023 10:10:01 +0100,
"chenxiang (M)" <chenxiang66@hisilicon.com> wrote:
> 
> Hi Marc,
> 
> 
> 在 2023/7/13 星期四 14:56, Marc Zyngier 写道:
> > On Thu, 13 Jul 2023 03:35:39 +0100,
> > "chenxiang (M)" <chenxiang66@hisilicon.com> wrote:
> >> Hi Marc,
> >> 
> >> 
> >> 在 2023/7/12 星期三 16:36, Marc Zyngier 写道:
> >>> On Wed, 12 Jul 2023 08:55:05 +0100,
> >>> chenxiang <chenxiang66@hisilicon.com> wrote:
> >>>> From: Xiang Chen <chenxiang66@hisilicon.com>
> >>>> 
> >>>> For those PMU system registers defined in sys_reg_descs[], use macro
> >>>> PMU_SYS_REG() / PMU_PMEVCNTR_EL0 / PMU_PMEVTYPER_EL0 to define them, and
> >>>> later two macros call macro PMU_SYS_REG() actually.
> >>>> Currently the input parameter of PMU_SYS_REG() is other macro which is
> >>>> calculation formula of the value of system registers, so for example, if
> >>>> we want to "SYS_PMINTENSET_EL1" as the name of sys register, actually
> >>>> the name will be as following:
> >>>> (((3) << 19) | ((0) << 16) | ((9) << 12) | ((14) << 8) | ((1) << 5))
> >>>> 
> >>>> To fix the issue, use the name as a input parameter of PMU_SYS_REG like
> >>>> MTE_REG or EL2_REG.
> >>> Why is the name relevant? Is this related to tracing?
> >> I think It is not related to tracing. I find the issue when i want to
> >> know which system reigsters are set
> >> when on live migration and printk the name of sys_reg_desc in function
> >> kvm_sys_reg_set_user,
> >> find the name of some registers are abnormal as followings:
> >> 
> >> [  227.145540] kvm_sys_reg_set_user 3427:SYS_FAR_EL1
> >> [  227.158057] kvm_sys_reg_set_user 3427:SYS_PAR_EL1
> >> [  227.170574] kvm_sys_reg_set_user 3427:(((3) << 19) | ((0) << 16) |
> >> ((9) << 12) | ((14) << 8) | ((1) << 5))
> >> [  227.188037] kvm_sys_reg_set_user 3427:(((3) << 19) | ((0) << 16) |
> >> ((9) << 12) | ((14) << 8) | ((2) << 5))
> >> [  227.205511] kvm_sys_reg_set_user 3427:SYS_MAIR_EL1
> >> [  227.218117] kvm_sys_reg_set_user 3427:SYS_PIRE0_EL1
> > So what is this if not some form of tracing?
> 
> Ah, i was misunderstood your question. I thought you aksed whether
> it is related to kernel tracing (which is already existed in kernel)
> such as tracepoint or debugfs.

But that's my point: tracepoints such as kvm_sys_access already output
the name (as well as the encoding), and are likely to be affected by
this problem.

And that's a much more interesting justification for this change.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2023-07-13  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:55 [PATCH] KVM: arm64: Fix the name of sys_reg_desc related to PMU chenxiang
2023-07-12  8:36 ` Marc Zyngier
2023-07-13  2:35   ` chenxiang (M)
2023-07-13  6:56     ` Marc Zyngier
2023-07-13  9:10       ` chenxiang (M)
2023-07-13  9:40         ` Marc Zyngier [this message]
2023-07-14  3:13           ` chenxiang (M)

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=86wmz4up2z.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linuxarm@huawei.com \
    --cc=oliver.upton@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox