public inbox for kvmarm@lists.cs.columbia.edu
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Andre Przywara <andre.przywara@arm.com>,
	Christoffer Dall <christoffer.dall@linaro.org>
Cc: Rob Herring <robh@kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Eric Auger <eric.auger@linaro.org>
Subject: Re: 4.15-rc1 crash on Midway in teardown_hyp_mode()
Date: Wed, 6 Dec 2017 14:41:55 +0000	[thread overview]
Message-ID: <2b9f0477-49bb-37e9-200c-0f2c477d559c@arm.com> (raw)
In-Reply-To: <10746458-42bd-c50f-3075-49811018099a@arm.com>

On 06/12/17 14:17, Andre Przywara wrote:
> Hi,
> 
> On 06/12/17 14:11, Andre Przywara wrote:
>> Hi,
>>
>> while trying to boot 4.15-rc1 on my Calxeda Midway I observed a crash
>> (see below). I can't look further into this today, but wanted to report
>> this anyway.
>>
>> Digging around a bit this is due to the VGIC not initializing properly
>> due to GICC being advertised as just 4K, not 8K.
>> This can be worked around by adjusting the DT or using
>> irqchip.gicv2_force_probe. However this still raises some questions:
>> 1) Even if the VGIC fails to register, we should certainly not crash.
>> The chain of events seems to be:
>> virt/kvm/arm/arm.c:init_subsystems():
>>   - kvm_vgic_hyp_init() returns -ENODEV, this leads to vgic_present
>>     being set to false, but "err" being reset to 0 (meaning: carry on).
>>     However this seems now to miss some initialization.
>>   - kvm_timer_hyp_init() now fails on calling irq_set_vcpu_affinity(),
>>     because this returns -ENOSYS. This leads to it returning this error,
>>     init_subsystems() failing and subsequently tearing down KVM.
>>   - This seems to have some bug and leads to the kernel crash.
>>
>> Even with the VGIC not being usable, we should be able to cleanly tear
>> down KVM (or HYP?).
> 
> Just checked: If I let kvm_timer_hyp_init() deliberately fail in 4.14, I
> get the same splat (4.14 works fine, otherwise). So this particular
> issue existed already before. You should be able to reproduce it on any
> box by forcing "err = -ENOSYS;" after the call to kvm_timer_hyp_init()
> in virt/kvm/arm/arm.c:init_subsystems().

I wonder if the bigger hammer-type solution is not to expose that the
GIC is not capable of EOImode==1, and not enable the vgic in that
particular case...

I'll cook an RFC patch set for you to test.

Thanks,

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

  reply	other threads:[~2017-12-06 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 14:11 4.15-rc1 crash on Midway in teardown_hyp_mode() Andre Przywara
2017-12-06 14:17 ` Andre Przywara
2017-12-06 14:41   ` Marc Zyngier [this message]
2017-12-06 14:23 ` Marc Zyngier
2017-12-09 15:48 ` 4.15-rc2 crash on RPi2 " Andreas Färber
2017-12-09 16:33   ` 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=2b9f0477-49bb-37e9-200c-0f2c477d559c@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox