From: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: kvm@vger.kernel.org, kernel-team@android.com,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace
Date: Fri, 06 Nov 2020 09:57:04 +0000 [thread overview]
Message-ID: <32241e9ee49133df4e9bcc6c8ebd7551@kernel.org> (raw)
In-Reply-To: <20201105224442.GD8842@willie-the-truck>
On 2020-11-05 22:44, Will Deacon wrote:
>> + if (csv2 > vcpu->kvm->arch.pfr0_csv2)
>> + return -EINVAL;
>> + vcpu->kvm->arch.pfr0_csv2 = csv2;
>> +
>> + /* This is what we mean by invariant: you can't change it. */
>> + if (val != read_id_reg(vcpu, rd, false))
>> + return -EINVAL;
>
> I think it's quite confusing to return -EINVAL in the case that we have
> actually updated arch.pfr0_csv2, as it's indistinguishable from the
> case
> when csv2 was invalid and the field wasn't updated.
-EINVAL is the right error code here (you're setting an invalid value
for
the whole register). The bug is that we have now changed CSV2 for
everyone.
I'll have a look at fixing this, though it might involve some locking.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
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: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: kvm@vger.kernel.org, Suzuki K Poulose <suzuki.poulose@arm.com>,
Peng Liang <liangpeng10@huawei.com>,
James Morse <james.morse@arm.com>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
kernel-team@android.com, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace
Date: Fri, 06 Nov 2020 09:57:04 +0000 [thread overview]
Message-ID: <32241e9ee49133df4e9bcc6c8ebd7551@kernel.org> (raw)
In-Reply-To: <20201105224442.GD8842@willie-the-truck>
On 2020-11-05 22:44, Will Deacon wrote:
>> + if (csv2 > vcpu->kvm->arch.pfr0_csv2)
>> + return -EINVAL;
>> + vcpu->kvm->arch.pfr0_csv2 = csv2;
>> +
>> + /* This is what we mean by invariant: you can't change it. */
>> + if (val != read_id_reg(vcpu, rd, false))
>> + return -EINVAL;
>
> I think it's quite confusing to return -EINVAL in the case that we have
> actually updated arch.pfr0_csv2, as it's indistinguishable from the
> case
> when csv2 was invalid and the field wasn't updated.
-EINVAL is the right error code here (you're setting an invalid value
for
the whole register). The bug is that we have now changed CSV2 for
everyone.
I'll have a look at fixing this, though it might involve some locking.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org,
Peng Liang <liangpeng10@huawei.com>,
James Morse <james.morse@arm.com>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
kernel-team@android.com
Subject: Re: [PATCH 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace
Date: Fri, 06 Nov 2020 09:57:04 +0000 [thread overview]
Message-ID: <32241e9ee49133df4e9bcc6c8ebd7551@kernel.org> (raw)
In-Reply-To: <20201105224442.GD8842@willie-the-truck>
On 2020-11-05 22:44, Will Deacon wrote:
>> + if (csv2 > vcpu->kvm->arch.pfr0_csv2)
>> + return -EINVAL;
>> + vcpu->kvm->arch.pfr0_csv2 = csv2;
>> +
>> + /* This is what we mean by invariant: you can't change it. */
>> + if (val != read_id_reg(vcpu, rd, false))
>> + return -EINVAL;
>
> I think it's quite confusing to return -EINVAL in the case that we have
> actually updated arch.pfr0_csv2, as it's indistinguishable from the
> case
> when csv2 was invalid and the field wasn't updated.
-EINVAL is the right error code here (you're setting an invalid value
for
the whole register). The bug is that we have now changed CSV2 for
everyone.
I'll have a look at fixing this, though it might involve some locking.
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2020-11-06 9:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 17:14 [PATCH 0/3] KVM: arm64: Another set of CSV2-related fixes Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-03 17:14 ` [PATCH 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-05 22:44 ` Will Deacon
2020-11-05 22:44 ` Will Deacon
2020-11-05 22:44 ` Will Deacon
2020-11-06 9:57 ` Marc Zyngier [this message]
2020-11-06 9:57 ` Marc Zyngier
2020-11-06 9:57 ` Marc Zyngier
2020-11-03 17:14 ` [PATCH 2/3] KVM: arm64: Rename access_amu() to undef_access() Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-05 22:50 ` Will Deacon
2020-11-05 22:50 ` Will Deacon
2020-11-05 22:50 ` Will Deacon
2020-11-06 10:54 ` Marc Zyngier
2020-11-06 10:54 ` Marc Zyngier
2020-11-06 10:54 ` Marc Zyngier
2020-11-03 17:14 ` [PATCH 3/3] KVM: arm64: Handle SCXTNUM_ELx traps Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-03 17:14 ` Marc Zyngier
2020-11-05 22:50 ` Will Deacon
2020-11-05 22:50 ` Will Deacon
2020-11-05 22:50 ` Will Deacon
-- strict thread matches above, loose matches on Subject: below --
2020-11-12 22:21 [PATCH 0/3] KVM/arm64 fixes for 5.10, take #3 Marc Zyngier
2020-11-12 22:21 ` [PATCH 1/3] KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace Marc Zyngier
2020-11-12 22:21 ` Marc Zyngier
2020-11-12 22:21 ` 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=32241e9ee49133df4e9bcc6c8ebd7551@kernel.org \
--to=maz@kernel.org \
--cc=kernel-team@android.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=will@kernel.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.