From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Maydell Subject: Re: [PATCH v2 05/25] KVM: arm64: vgic-v3: Add ICV_BPR1_EL1 handler Date: Mon, 5 Jun 2017 11:27:12 +0100 Message-ID: References: <20170601102117.17750-1-marc.zyngier@arm.com> <20170601102117.17750-6-marc.zyngier@arm.com> <20170604202528.GH9464@cbox> <5b8acdaf-e5a5-25fd-fffe-5ff42d501ee0@arm.com> <20170605101609.GA12884@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Marc Zyngier , kvm-devel , David Daney , Catalin Marinas , Robert Richter , arm-mail-list , "kvmarm@lists.cs.columbia.edu" To: Christoffer Dall Return-path: Received: from mail-wr0-f178.google.com ([209.85.128.178]:33970 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751290AbdFEK1e (ORCPT ); Mon, 5 Jun 2017 06:27:34 -0400 Received: by mail-wr0-f178.google.com with SMTP id g76so35800462wrd.1 for ; Mon, 05 Jun 2017 03:27:34 -0700 (PDT) In-Reply-To: <20170605101609.GA12884@cbox> Sender: kvm-owner@vger.kernel.org List-ID: On 5 June 2017 at 11:16, Christoffer Dall wrote: > On Mon, Jun 05, 2017 at 10:58:57AM +0100, Marc Zyngier wrote: >> From the ICC_BPR0_EL1 documentation: >> >> "An attempt to program the binary point field to a value less than the >> minimum value sets the field to the minimum value." >> >> That's the only way you can find out about the minimum value (and the >> kernel also uses this functionality to be in a known state, even if it >> doesn't use preemption yet). >> > > Hmm, the ICV_BPR0_EL1 says: > "An attempt to program the binary point field to a value less than the > minimum value sets the field to the minimum value. On a reset, the > binary point field is set to the minimum supported value." > > But then the ICV_BPR1_EL1 says: > "An attempt to program the binary point field to a value less than the > reset value sets the field to the reset value." > > and > > "Writing 0 to this field will set this field to its reset value, which > is IMPLEMENTATION DEFINED and non-zero." It also later says that the ICV_BPR1_EL1 IMPDEF reset value is always the ICV_BPR0_EL1 reset value plus one. > So it seems like the spec is making some distinction between minimum or > reset value and between the two registers, but I'm not sure if the spec > is just having its fun with us, or if there's something important to be > aware of here. I think the plus-one is the only interesting difference and the rest is just accidental difference of wording. There is a difference between ICV_BPR* and ICC_BPR*, which is that the latter reset to an UNKNOWN value, not necessarily the minimum. thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter.maydell@linaro.org (Peter Maydell) Date: Mon, 5 Jun 2017 11:27:12 +0100 Subject: [PATCH v2 05/25] KVM: arm64: vgic-v3: Add ICV_BPR1_EL1 handler In-Reply-To: <20170605101609.GA12884@cbox> References: <20170601102117.17750-1-marc.zyngier@arm.com> <20170601102117.17750-6-marc.zyngier@arm.com> <20170604202528.GH9464@cbox> <5b8acdaf-e5a5-25fd-fffe-5ff42d501ee0@arm.com> <20170605101609.GA12884@cbox> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 5 June 2017 at 11:16, Christoffer Dall wrote: > On Mon, Jun 05, 2017 at 10:58:57AM +0100, Marc Zyngier wrote: >> From the ICC_BPR0_EL1 documentation: >> >> "An attempt to program the binary point field to a value less than the >> minimum value sets the field to the minimum value." >> >> That's the only way you can find out about the minimum value (and the >> kernel also uses this functionality to be in a known state, even if it >> doesn't use preemption yet). >> > > Hmm, the ICV_BPR0_EL1 says: > "An attempt to program the binary point field to a value less than the > minimum value sets the field to the minimum value. On a reset, the > binary point field is set to the minimum supported value." > > But then the ICV_BPR1_EL1 says: > "An attempt to program the binary point field to a value less than the > reset value sets the field to the reset value." > > and > > "Writing 0 to this field will set this field to its reset value, which > is IMPLEMENTATION DEFINED and non-zero." It also later says that the ICV_BPR1_EL1 IMPDEF reset value is always the ICV_BPR0_EL1 reset value plus one. > So it seems like the spec is making some distinction between minimum or > reset value and between the two registers, but I'm not sure if the spec > is just having its fun with us, or if there's something important to be > aware of here. I think the plus-one is the only interesting difference and the rest is just accidental difference of wording. There is a difference between ICV_BPR* and ICC_BPR*, which is that the latter reset to an UNKNOWN value, not necessarily the minimum. thanks -- PMM