public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>,
	Eric Auger <eric.auger@linaro.org>
Cc: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/5] arm/arm64: KVM: vgic: move reset initialization into vgic_init_maps()
Date: Thu, 11 Dec 2014 18:25:50 +0000	[thread overview]
Message-ID: <5489E1AE.4010209@arm.com> (raw)
In-Reply-To: <20141211114810.GC28388@cbox>

On 11/12/14 11:48, Christoffer Dall wrote:
> On Wed, Dec 10, 2014 at 11:11:41AM +0100, Eric Auger wrote:
>> Hi Christoffer,
>> Reviewed-by: Eric Auger <eric.auger@linaro.org>
>> see few comments below.
>> On 12/09/2014 04:44 PM, Christoffer Dall wrote:
>>> From: Peter Maydell <peter.maydell@linaro.org>
>>>
>>> VGIC initialization currently happens in three phases:
>>>  (1) kvm_vgic_create() (triggered by userspace GIC creation)
>>>  (2) vgic_init_maps() (triggered by userspace GIC register read/write
>>>      requests, or from kvm_vgic_init() if not already run)
>>>  (3) kvm_vgic_init() (triggered by first VM run)
>>>
>>> We were doing initialization of some state to correspond with the
>>> state of a freshly-reset GIC in kvm_vgic_init(); this is too late,
>>> since it will overwrite changes made by userspace using the
>>> register access APIs before the VM is run. Move this initialization
>>> earlier, into the vgic_init_maps() phase.
>>>
>>> This fixes a bug where QEMU could successfully restore a saved
>>> VM state snapshot into a VM that had already been run, but could
>>> not restore it "from cold" using the -loadvm command line option
>>> (the symptoms being that the restored VM would run but interrupts
>>> were ignored).
>>>
>>> Finally rename vgic_init_maps to vgic_init and renamed kvm_vgic_init to
>>> kvm_vgic_map_resources.
>>>
>>>   [ This patch is originally written by Peter Maydell, but I have
>>>     modified it somewhat heavily, renaming various bits and moving code
>>>     around.  If something is broken, I am to be blamed. - Christoffer ]
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
>>> ---
>>> This patch was originally named "vgic: move reset initialization into
>>> vgic_init_maps()" but I renamed it slightly to match the other vgic
>>> patches in the kernel.  I also did the additional changes since the
>>> original patch:
>>>  - Renamed kvm_vgic_init to kvm_vgic_map_resources
>>>  - Renamed vgic_init_maps to vgic_init
>>>  - Moved vgic_enable call into existing vcpu loop in vgic_init
>>>  - Moved ITARGETSRn initializtion above vcpu loop in vgic_init (the idea
>> typo
>>>    is to init global state first, then vcpu state).
>>
>> kvm_vgic_vcpu_init also has disappeared and PPI settings of
>> dist->irq_enabled and dist->irq_cfg now are in former vgic_init_maps.
>>
>> Maybe it would be simpler to review if there were 2 patches: one for
>> init redistribution from kvm_vgic_init to vgic_init_maps and one for the
>> renaming.
> 
> Maybe, but if you apply this patch and review it that way, it becomes
> much easier.  I'd really like to get this in soon, so given you already
> gave me your reviewed-by, I'm going to wait and see what Marc says and
> only respin if he finds it necessary.

No, I think this is fine as it is. This is a good cleanup, and it seems
to simplify the whole thing (and yes, we could do with simplicity in
this file...).

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

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

  reply	other threads:[~2014-12-11 18:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 15:43 [PATCH 0/5] Fix vgic initialization problems Christoffer Dall
2014-12-09 15:44 ` [PATCH 1/5] arm/arm64: KVM: vgic: move reset initialization into vgic_init_maps() Christoffer Dall
2014-12-10 10:11   ` Eric Auger
2014-12-11 11:48     ` Christoffer Dall
2014-12-11 18:25       ` Marc Zyngier [this message]
2014-12-09 15:44 ` [PATCH 2/5] arm/arm64: KVM: Rename vgic_initialized to vgic_ready Christoffer Dall
2014-12-11 18:26   ` Marc Zyngier
2014-12-09 15:44 ` [PATCH 3/5] arm/arm64: KVM: Add (new) vgic_initialized macro Christoffer Dall
2014-12-10 10:27   ` Eric Auger
2014-12-11 11:48     ` Christoffer Dall
2014-12-11 18:28   ` Marc Zyngier
2014-12-09 15:44 ` [PATCH 4/5] arm/arm64: KVM: Don't allow creating VCPUs after vgic_initialized Christoffer Dall
2014-12-10 12:35   ` Eric Auger
2014-12-11 11:55     ` Christoffer Dall
2014-12-11 18:30   ` Marc Zyngier
2014-12-09 15:44 ` [PATCH 5/5] arm/arm64: KVM: Initialize the vgic on-demand when injecting IRQs Christoffer Dall
2014-12-10 12:45   ` Eric Auger
2014-12-11 12:01     ` Christoffer Dall
2014-12-11 12:38       ` Eric Auger
2014-12-12 11:06         ` Christoffer Dall
2014-12-15 10:43           ` Eric Auger
2014-12-11 18:35   ` Marc Zyngier
2014-12-12 11:14     ` Christoffer Dall
2014-12-12 11:23       ` Marc Zyngier
2014-12-12 11:37         ` Christoffer Dall
2014-12-12 20:24           ` Christoffer Dall

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=5489E1AE.4010209@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.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