All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: peter.maydell@linaro.org, drjones@redhat.com,
	kvm@vger.kernel.org, Prasun.Kapoor@cavium.com,
	vijayak@caviumnetworks.com, andre.przywara@arm.com,
	quintela@redhat.com, dgilbert@redhat.com,
	Vijaya.Kumar@cavium.com, linux-arm-kernel@lists.infradead.org,
	pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu,
	christoffer.dall@linaro.org, eric.auger.pro@gmail.com
Subject: Re: [PATCH v7 01/24] KVM: arm/arm64: Add ITS save/restore API documentation
Date: Mon, 8 May 2017 10:14:21 +0100	[thread overview]
Message-ID: <6ca05e9e-2a40-fc30-36d0-359d9a4ff172@arm.com> (raw)
In-Reply-To: <c2e1492b-bfb3-d8de-ca7a-0f925093f713@redhat.com>

On 07/05/17 18:05, Auger Eric wrote:
> Hi Marc,
> 
> On 07/05/2017 13:54, Marc Zyngier wrote:
>> On Sat, May 06 2017 at  4:24:20 pm BST, Eric Auger <eric.auger@redhat.com> wrote:
>>> Add description for how to access ITS registers and how to save/restore
>>> ITS tables into/from memory.
>>>
>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>>
>>> ---
>>> v6 -> v7:
>>> - rephrase ordering sequence + few cosmetic changes
>>>
>>> v5 -> v6:
>>> - add restoration ordering
>>> - 256B -> 256 Byte aligned
>>> - DTE Size is number of bits for the EVENTID
>>> - s/GITS_READR/GITS_CREADR
>>>
>>> v4 -> v5:
>>> - take into account Christoffer's comments
>>> - pending table save on GICV3 side now
>>>
>>> v3 -> v4:
>>> - take into account Peter's comments:
>>>   - typos
>>>   - KVM_DEV_ARM_VGIC_GRP_ITS_TABLES kvm_device_attr = 0
>>>   - add a validity bit in DTE
>>>   - document all fields in CTE and ITE
>>>   - document ABI revision
>>> - take into account Andre's comments:
>>>   - document restrictions about GITS_CREADR writing and GITS_IIDR
>>>   - document -EBUSY error if one or more VCPUS are runnning
>>>   - document 64b registers only can be accessed with 64b access
>>> - itt_addr field matches bits [51:8] of the itt_addr
>>>
>>> v1 -> v2:
>>> - DTE and ITE now are 8 bytes
>>> - DTE and ITE now indexed by deviceid/eventid
>>> - use ITE name instead of ITTE
>>> - mentions ITT_addr matches bits [51:8] of the actual address
>>> - mentions LE layout
>>> ---
>>>  Documentation/virtual/kvm/devices/arm-vgic-its.txt | 120 +++++++++++++++++++++
>>>  1 file changed, 120 insertions(+)
>>>
>>> diff --git a/Documentation/virtual/kvm/devices/arm-vgic-its.txt b/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>>> index 6081a5b..ba132e9 100644
>>> --- a/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>>> +++ b/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>> [...]
>>
>>> + ITS Table ABI REV0:
>>> + -------------------
>>> +
>>> + Revision 0 of the ABI only supports physical LPIs.
>>
>> Nit: these are no more physical than any other interrupt that KVM deals
>> with. If you're hinting at the lack of GICv4 support, it wouldn't
>> necessarily invalidate this ABI. It is actually even likely that the ABI
>> could stay the same (until we start supporting GICv4 in a nested
>> configuration).
> I understood vLPI are associated to vPE and not to collections. As such
> ITE would need to be updated, wouldn't it?

Even in a GICv4 setup (and ignoring nesting), a guest would only see a
normal GICv3, as all the GICv4 state is the hypervisor's business, and
not something meaningful to the guest. Also, it is very desirable to be
able to migrate a GICv4 setup to a GICv3 setup without breaking everything.

To precisely answer your question, the VPE setup is done by finding out
which collection is mapped to which vcpu, and using that to map VLPIs to
VPEs. None of that is observable by the guest.

>>
>>> +
>>> + The device table and ITT are indexed by the deviceid and eventid,
>>> + respectively. The collection table is not indexed by collectionid:
>>> + CTEs are written in the table in the order of collection creation. All
>>
>> Is this order really relevant? Can we relax it? Would something break if
>> collections were in a random order?
> Christoffer asked me to mention the exact storage order or at least I
> understood his comment that way. Nothing would break if we change the order.

OK. If that's not a requirement, then we should probably drop it.

Christoffer, what do you think?

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 01/24] KVM: arm/arm64: Add ITS save/restore API documentation
Date: Mon, 8 May 2017 10:14:21 +0100	[thread overview]
Message-ID: <6ca05e9e-2a40-fc30-36d0-359d9a4ff172@arm.com> (raw)
In-Reply-To: <c2e1492b-bfb3-d8de-ca7a-0f925093f713@redhat.com>

On 07/05/17 18:05, Auger Eric wrote:
> Hi Marc,
> 
> On 07/05/2017 13:54, Marc Zyngier wrote:
>> On Sat, May 06 2017 at  4:24:20 pm BST, Eric Auger <eric.auger@redhat.com> wrote:
>>> Add description for how to access ITS registers and how to save/restore
>>> ITS tables into/from memory.
>>>
>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>>
>>> ---
>>> v6 -> v7:
>>> - rephrase ordering sequence + few cosmetic changes
>>>
>>> v5 -> v6:
>>> - add restoration ordering
>>> - 256B -> 256 Byte aligned
>>> - DTE Size is number of bits for the EVENTID
>>> - s/GITS_READR/GITS_CREADR
>>>
>>> v4 -> v5:
>>> - take into account Christoffer's comments
>>> - pending table save on GICV3 side now
>>>
>>> v3 -> v4:
>>> - take into account Peter's comments:
>>>   - typos
>>>   - KVM_DEV_ARM_VGIC_GRP_ITS_TABLES kvm_device_attr = 0
>>>   - add a validity bit in DTE
>>>   - document all fields in CTE and ITE
>>>   - document ABI revision
>>> - take into account Andre's comments:
>>>   - document restrictions about GITS_CREADR writing and GITS_IIDR
>>>   - document -EBUSY error if one or more VCPUS are runnning
>>>   - document 64b registers only can be accessed with 64b access
>>> - itt_addr field matches bits [51:8] of the itt_addr
>>>
>>> v1 -> v2:
>>> - DTE and ITE now are 8 bytes
>>> - DTE and ITE now indexed by deviceid/eventid
>>> - use ITE name instead of ITTE
>>> - mentions ITT_addr matches bits [51:8] of the actual address
>>> - mentions LE layout
>>> ---
>>>  Documentation/virtual/kvm/devices/arm-vgic-its.txt | 120 +++++++++++++++++++++
>>>  1 file changed, 120 insertions(+)
>>>
>>> diff --git a/Documentation/virtual/kvm/devices/arm-vgic-its.txt b/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>>> index 6081a5b..ba132e9 100644
>>> --- a/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>>> +++ b/Documentation/virtual/kvm/devices/arm-vgic-its.txt
>> [...]
>>
>>> + ITS Table ABI REV0:
>>> + -------------------
>>> +
>>> + Revision 0 of the ABI only supports physical LPIs.
>>
>> Nit: these are no more physical than any other interrupt that KVM deals
>> with. If you're hinting at the lack of GICv4 support, it wouldn't
>> necessarily invalidate this ABI. It is actually even likely that the ABI
>> could stay the same (until we start supporting GICv4 in a nested
>> configuration).
> I understood vLPI are associated to vPE and not to collections. As such
> ITE would need to be updated, wouldn't it?

Even in a GICv4 setup (and ignoring nesting), a guest would only see a
normal GICv3, as all the GICv4 state is the hypervisor's business, and
not something meaningful to the guest. Also, it is very desirable to be
able to migrate a GICv4 setup to a GICv3 setup without breaking everything.

To precisely answer your question, the VPE setup is done by finding out
which collection is mapped to which vcpu, and using that to map VLPIs to
VPEs. None of that is observable by the guest.

>>
>>> +
>>> + The device table and ITT are indexed by the deviceid and eventid,
>>> + respectively. The collection table is not indexed by collectionid:
>>> + CTEs are written in the table in the order of collection creation. All
>>
>> Is this order really relevant? Can we relax it? Would something break if
>> collections were in a random order?
> Christoffer asked me to mention the exact storage order or at least I
> understood his comment that way. Nothing would break if we change the order.

OK. If that's not a requirement, then we should probably drop it.

Christoffer, what do you think?

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2017-05-08  9:14 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06 15:24 [PATCH v7 00/24] vITS save/restore Eric Auger
2017-05-06 15:24 ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 01/24] KVM: arm/arm64: Add ITS save/restore API documentation Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 11:54   ` Marc Zyngier
2017-05-07 11:54     ` Marc Zyngier
2017-05-07 17:05     ` Auger Eric
2017-05-07 17:05       ` Auger Eric
2017-05-08  9:14       ` Marc Zyngier [this message]
2017-05-08  9:14         ` Marc Zyngier
2017-05-08 11:21         ` Christoffer Dall
2017-05-08 11:21           ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 02/24] KVM: arm/arm64: Add GICV3 pending table save " Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 11:56   ` Marc Zyngier
2017-05-07 11:56     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 03/24] KVM: arm/arm64: vgic-its: rename itte into ite Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 04/24] arm/arm64: vgic: turn vgic_find_mmio_region into public Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 05/24] KVM: arm64: vgic-its: KVM_DEV_ARM_VGIC_GRP_ITS_REGS group Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 06/24] KVM: arm/arm64: vgic: expose (un)lock_all_vcpus Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 07/24] KVM: arm64: vgic-its: Implement vgic_its_has_attr_regs and attr_regs_access Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 11:57   ` Marc Zyngier
2017-05-07 11:57     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 08/24] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_creadr Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 09/24] KVM: arm64: vgic-its: Introduce migration ABI infrastructure Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-08 12:23   ` Christoffer Dall
2017-05-08 12:23     ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 10/24] KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_iidr Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-08 12:24   ` Christoffer Dall
2017-05-08 12:24     ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 11/24] KVM: arm64: vgic-its: Interpret MAPD Size field and check related errors Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 12/24] KVM: arm64: vgic-its: Interpret MAPD ITT_addr field Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-06 15:24 ` [PATCH v7 13/24] KVM: arm64: vgic-its: Check the device id matches TYPER DEVBITS range Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 12:01   ` Marc Zyngier
2017-05-07 12:01     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 14/24] KVM: arm64: vgic-v3: vgic_v3_lpi_sync_pending_status Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 12:13   ` Marc Zyngier
2017-05-07 12:13     ` Marc Zyngier
2017-05-08 12:26   ` Christoffer Dall
2017-05-08 12:26     ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 15/24] KVM: arm64: vgic-its: Read config and pending bit in add_lpi() Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 12:16   ` Marc Zyngier
2017-05-07 12:16     ` Marc Zyngier
2017-05-08 12:28   ` Christoffer Dall
2017-05-08 12:28     ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 16/24] KVM: arm64: vgic-its: KVM_DEV_ARM_ITS_SAVE/RESTORE_TABLES Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:00   ` Marc Zyngier
2017-05-07 13:00     ` Marc Zyngier
2017-05-07 13:51     ` Marc Zyngier
2017-05-07 13:51       ` Marc Zyngier
2017-05-07 15:19       ` Christoffer Dall
2017-05-07 15:19         ` Christoffer Dall
2017-05-07 17:33       ` Auger Eric
2017-05-07 17:33         ` Auger Eric
2017-05-08 12:29   ` Christoffer Dall
2017-05-08 12:29     ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 17/24] KVM: arm64: vgic-its: vgic_its_alloc_ite/device Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:02   ` Marc Zyngier
2017-05-07 13:02     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 18/24] KVM: arm64: vgic-its: Add infrastructure for table lookup Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:05   ` Marc Zyngier
2017-05-07 13:05     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 19/24] KVM: arm64: vgic-its: Collection table save/restore Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:12   ` Marc Zyngier
2017-05-07 13:12     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 20/24] KVM: arm64: vgic-its: vgic_its_check_id returns the entry's GPA Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:14   ` Marc Zyngier
2017-05-07 13:14     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 21/24] KVM: arm64: vgic-its: Device table save/restore Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:30   ` Marc Zyngier
2017-05-07 13:30     ` Marc Zyngier
2017-05-07 17:22     ` Auger Eric
2017-05-07 17:22       ` Auger Eric
2017-05-08 11:30     ` Christoffer Dall
2017-05-08 11:30       ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 22/24] KVM: arm64: vgic-its: ITT save and restore Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:39   ` Marc Zyngier
2017-05-07 13:39     ` Marc Zyngier
2017-05-07 17:24     ` Auger Eric
2017-05-07 17:24       ` Auger Eric
2017-05-08 11:49     ` Christoffer Dall
2017-05-08 11:49       ` Christoffer Dall
2017-05-06 15:24 ` [PATCH v7 23/24] KVM: arm64: vgic-its: Fix pending table sync Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:42   ` Marc Zyngier
2017-05-07 13:42     ` Marc Zyngier
2017-05-06 15:24 ` [PATCH v7 24/24] KVM: arm64: vgic-v3: KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES Eric Auger
2017-05-06 15:24   ` Eric Auger
2017-05-07 13:44   ` Marc Zyngier
2017-05-07 13:44     ` 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=6ca05e9e-2a40-fc30-36d0-359d9a4ff172@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=Prasun.Kapoor@cavium.com \
    --cc=Vijaya.Kumar@cavium.com \
    --cc=andre.przywara@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=quintela@redhat.com \
    --cc=vijayak@caviumnetworks.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.