All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Itaru Kitayama <itaru.kitayama@linux.dev>
Cc: Oliver Upton <oliver.upton@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	K Poulose Suzuki <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Itaru Kitayama <itaru.kitayama@fujitsu.com>
Subject: Re: [PATCH] PMCR_EL0.N is RAZ/WI. At least a build failes in Ubuntu 22.04 LTS. Remove the set function.
Date: Wed, 17 Sep 2025 19:44:25 +0100	[thread overview]
Message-ID: <86ms6s2a2e.wl-maz@kernel.org> (raw)
In-Reply-To: <0524084A-9E82-408A-9F22-369ED25E42E9@linux.dev>

On Mon, 15 Sep 2025 22:31:31 +0100,
Itaru Kitayama <itaru.kitayama@linux.dev> wrote:
> 
> 
> 
> > On Sep 12, 2025, at 21:11, Marc Zyngier <maz@kernel.org> wrote:
> > 
> > On Fri, 12 Sep 2025 12:33:39 +0100,
> > Itaru Kitayama <itaru.kitayama@gmail.com> wrote:
> >> 
> >> 
> >> 
> >>> On Sep 12, 2025, at 20:01, Marc Zyngier <maz@kernel.org> wrote:
> >>> 
> >>> On Fri, 12 Sep 2025 09:27:40 +0100,
> >>> Itaru Kitayama <itaru.kitayama@linux.dev> wrote:
> >>>> 
> >>>> Signed-off-by: Itaru Kitayama <itaru.kitayama@fujitsu.com>
> >>> 
> >>> This isn't an acceptable commit message.
> >>> 
> >>>> ---
> >>>> Seen a build failure with old Ubuntu 22.04 LTS, while the latest release
> >>>> has no build issue, a write to the bit fields is RAZ/WI, remove the
> >>>> function.
> >>>> ---
> >>>> tools/testing/selftests/kvm/arm64/vpmu_counter_access.c | 6 ------
> >>>> 1 file changed, 6 deletions(-)
> >>>> 
> >>>> diff --git a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
> >>>> index f16b3b27e32ed7ca57481f27d689d47783aa0345..56214a4430be90b3e1d840f2719b22dd44f0b49b 100644
> >>>> --- a/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
> >>>> +++ b/tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
> >>>> @@ -45,11 +45,6 @@ static uint64_t get_pmcr_n(uint64_t pmcr)
> >>>>   return FIELD_GET(ARMV8_PMU_PMCR_N, pmcr);
> >>>> }
> >>>> 
> >>>> -static void set_pmcr_n(uint64_t *pmcr, uint64_t pmcr_n)
> >>>> -{
> >>>> -    u64p_replace_bits((__u64 *) pmcr, pmcr_n, ARMV8_PMU_PMCR_N);
> >>>> -}
> >>>> -
> >>>> static uint64_t get_counters_mask(uint64_t n)
> >>>> {
> >>>>   uint64_t mask = BIT(ARMV8_PMU_CYCLE_IDX);
> >>>> @@ -490,7 +485,6 @@ static void test_create_vpmu_vm_with_pmcr_n(uint64_t pmcr_n, bool expect_fail)
> >>>>    * Setting a larger value of PMCR.N should not modify the field, and
> >>>>    * return a success.
> >>>>    */
> >>>> -    set_pmcr_n(&pmcr, pmcr_n);
> >>>>   vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_PMCR_EL0), pmcr);
> >>>>   pmcr = vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_PMCR_EL0));
> >>>> 
> >>>> 
> >>> 
> >>> So what are you fixing here? A build failure? A semantic defect?
> >>> Something else? What makes this a valid change?
> >>> 
> >>> Frankly, I have no idea.
> >>> 
> >>> But KVM definitely allows PMCR_EL0.N to be written from userspace, and
> >>> that's not going to change.
> >>> 
> >> 
> >> Then I’ll drop this patch.
> > 
> > I'm not asking you to drop it, I'm asking you to explain. If you found
> > a problem, let's discuss it and fix it. But as it stands, you're not
> > giving me much to go on.
> > 
> 
> You are right, while the bit fields are write ignored, to be
> consistent with the handling of other bit fields of the register,
> I’m fully convinced that checking the write operation in the
> vpmu_counter_access.c file should be kept.

The bit field is *not* ignored when written from userspace. That's how
we configure the PMU if the guest runs at EL1.

> The build error I’ve seen with Ubuntu 22.04 LTS is below:

[snip]

Can you please detail what compiler version this is? I'm unlikely to
install an ancient version of Ubuntu, but I can pick the corresponding
compiler version.

	M.

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

  reply	other threads:[~2025-09-17 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12  8:27 [PATCH] PMCR_EL0.N is RAZ/WI. At least a build failes in Ubuntu 22.04 LTS. Remove the set function Itaru Kitayama
2025-09-12 11:00 ` Marc Zyngier
2025-09-12 11:33   ` Itaru Kitayama
2025-09-12 12:11     ` Marc Zyngier
2025-09-15 21:31       ` Itaru Kitayama
2025-09-17 18:44         ` Marc Zyngier [this message]
2025-09-18  4:59           ` Itaru Kitayama

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=86ms6s2a2e.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=itaru.kitayama@fujitsu.com \
    --cc=itaru.kitayama@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.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.