From: Auger Eric <eric.auger@redhat.com>
To: Christoffer Dall <christoffer.dall@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>
Cc: kvm@vger.kernel.org, Andre Przywara <andre.przywara@arm.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 6/6] KVM: arm/arm64: vgic: Allow configuration of interrupt groups
Date: Tue, 10 Jul 2018 11:57:52 +0200 [thread overview]
Message-ID: <f07199bf-9e31-25ad-72d9-27192c27fccd@redhat.com> (raw)
In-Reply-To: <20180709224836.GA26579@u002843.usa.arm.com>
Hi,
On 07/10/2018 12:48 AM, Christoffer Dall wrote:
> On Mon, Jul 09, 2018 at 09:42:40AM +0100, Marc Zyngier wrote:
>> On 04/07/18 10:38, Christoffer Dall wrote:
>>> Implement the required MMIO accessors for GICv2 and GICv3 for the
>>> IGROUPR distributor and redistributor registers.
>>>
>>> This can allow guests to change behavior compared to running on previous
>>> versions of KVM, but only to align with the architecture and hardware
>>> implementations.
>>>
>>> This also allows userspace to configure the groups for interrupts. Note
>>> that this potentially results in GICv2 guests not receiving interrupts
>>> after migration if migrating from an older kernel that exposes GICv2
>>> interrupts as group 1.
>>>
>>> Cc: Andrew Jones <drjones@redhat.com>
>>> Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
>>> ---
>>> I implemented (but stashed) a version of this which predicated the
>>> behavior based on the value of GICD_IIDR revision field, falling back to
>>> ignoring writes and resetting GICv2 groups to 0 if the guest wrote a
>>> revision less than 2. However, current QEMU implementations simply
>>> don't write the GICD_IIDR, so this doesn't help at all without changing
>>> QEMU anyhow.
>>>
>>> The only actual fix I can see here to work around the problem in the
>>> kernel is to require an opt-in to allow restoring groups from userspace,
>>> but that's a lot of logic to support cross-kernel version migration.
>>>
>>> Question: Do we expect that cross-kernel version migration is a critical
>>> feature that people really expect to work, and do we actually have
>>> examples of catering to this in the kernel elsewhere? (Also, how would
>>> then that relate to the whole 'adding a new sysreg breaks migration'
>>> situation?)
>>
>> I don't really get why QEMU doesn't try to restore GICD_IIDR, while it
>> is definitely trying to restore RO sysregs (and that's how we detect
>> incompatibilities).
>>
>> I think we should at least give userspace a chance to do the right
>> thing. If it doesn't, well, too bad.
>
> This series should give userspace an option to adjust its behavior.
>
> My main concern is that this version of the series results in the worst
> kind of migration failures, where the guest simply doesn't run on the
> destination side with no warnings or error messages returned to the
> user..
Adding Dave in the loop to comment about general user perspective.
>
> We could add logic to return an error code if trying to write a
> different revision than what the kernel has (similar to the invariant
> sysregs), so that a simple fix to QEMU to save restore the GICD_IIDR
> register at least results in an error being returned to userspace.
>
> However, as QEMU doesn't do anything useful here today (not blaming
> anyone, I wrote the apparently broken GIC save/restore code for QEMU
> myself), we could also argue that QEMU might as well just fix things up
> if it detects a different IIDR.
>
>>
>> How bad is that "writable GICD_IIDR" patch? Because at this stage, and
>> in the absence of any comment, I'm close to just pick that series and
>> merge it for 4.19.
>>
>
> My guess is that a patch to "save/restore GICD_IIDR" is simple enough,
> but requires additional logic in the kernel that returns an error if the
> GICD_IIDR don't match on write.
>
> A patch which changes the groups and bumps the IIDR in userspace is
> probably more complex.
>
> Sounds like I should add the GICD_IIDR checking patch. Thoughts?
>
> What I would really like to know is whether this is really an issue or
> not. Do people who run products based on KVM, such as RHEV, have any
> expectations about cross-kernel version migration?
Thanks
Eric
>
>
> Thanks,
> -Christoffer
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2018-07-10 9:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-04 9:38 [PATCH v2 0/6] KVM: arm/arm64: vgic: Virtual interrupt grouping support Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 1/6] KVM: arm/arm64: vgic: Define GICD_IIDR fields for GICv2 and GIv3 Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 2/6] KVM: arm/arm64: vgic: Keep track of implementation revision Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 3/6] KVM: arm/arm64: vgic: GICv2 IGROUPR should read as zero Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 4/6] KVM: arm/arm64: vgic: Add group field to struct irq Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 5/6] KVM: arm/arm64: vgic: Signal IRQs using their configured group Christoffer Dall
2018-07-04 9:38 ` [PATCH v2 6/6] KVM: arm/arm64: vgic: Allow configuration of interrupt groups Christoffer Dall
2018-07-09 8:42 ` Marc Zyngier
2018-07-09 8:52 ` Peter Maydell
2018-07-09 22:48 ` Christoffer Dall
2018-07-10 8:33 ` Marc Zyngier
2018-07-10 9:12 ` Auger Eric
2018-07-10 9:17 ` Peter Maydell
2018-07-10 9:57 ` Auger Eric [this message]
2018-07-10 10:32 ` Dr. David Alan Gilbert
2018-07-10 15:27 ` Christoffer Dall
2018-07-10 15:38 ` Peter Maydell
2018-07-10 15:50 ` 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=f07199bf-9e31-25ad-72d9-27192c27fccd@redhat.com \
--to=eric.auger@redhat.com \
--cc=andre.przywara@arm.com \
--cc=christoffer.dall@arm.com \
--cc=dgilbert@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox