From: Pavel Fedin <p.fedin@samsung.com>
To: 'Peter Maydell' <peter.maydell@linaro.org>
Cc: 'Diana Craciun' <diana.craciun@freescale.com>,
'Shlomo Pongratz' <shlomo.pongratz@huawei.com>,
'Shlomo Pongratz' <shlomopongratz@gmail.com>,
'QEMU Developers' <qemu-devel@nongnu.org>,
'Vijay Kilari' <vijay.kilari@gmail.com>
Subject: Re: [Qemu-devel] [RFC PATCH v3 3/4] hw/intc/arm_gicv3_kvm: Implement get/put functions
Date: Mon, 26 Oct 2015 10:59:48 +0300 [thread overview]
Message-ID: <00f801d10fc4$49a5bbe0$dcf133a0$@samsung.com> (raw)
In-Reply-To: <CAFEAcA9gViAH6JYE2hicqGze-4LO8ZtTCfKJcaW2dE-oa5fwAg@mail.gmail.com>
Hello!
> > + reg = c->pendbaser & (GICR_PENDBASER_OUTER_CACHEABILITY_MASK |
> > + GICR_PENDBASER_ADDR_MASK |
> > + GICR_PENDBASER_SHAREABILITY_MASK |
> > + GICR_PENDBASER_CACHEABILITY_MASK);
> > + if (!c->redist_ctlr & GICR_CTLR_ENABLE_LPIS) {
> > + reg |= GICR_PENDBASER_PTZ;
> > + }
>
> Why does the state of the pendbaser register depend on state in the
> redist_ctlr ?
PTZ bit is write-only, we cannot read it back. And spec says that setting PTZ is adviced while LPIs are not enabled, because it shortens down the time of GIC initialization. So, i had to implement this small heuristics here. Is this approach OK?
> Worth a comment, whatever the answer is.
I will.
> > + kvm_gicr_access(s, GICR_PENDBASER, ncpu, ®, false);
> > + c->pendbaser = reg & (GICR_PENDBASER_OUTER_CACHEABILITY_MASK |
> > + GICR_PENDBASER_ADDR_MASK |
> > + GICR_PENDBASER_SHAREABILITY_MASK |
> > + GICR_PENDBASER_CACHEABILITY_MASK);
>
> Why do we need to mask these values?
I decided to do this at least for the case of KVM->TCG migration (as far as i understand, such things are possible). In this case i think we should not pollute our state with read-only bits, which get added by the emulation code itself.
> Do we not transfer ICC_SRE_EL1 because it's implemented as RO?
> (I think that's right for no-irq/fiq-bypass, sysregs only.)
Yes, also because looks like KVM is not going to implement GICv3 with non-SRE mode, instead, if we want to run a legacy guest, we just configure our host to provide GICv2 for it.
I actually migrate only those CPU interface registers, which are saved by the kernel code as part of guest's context.
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
next prev parent reply other threads:[~2015-10-26 7:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 14:02 [Qemu-devel] [RFC PATCH v3 0/4] GICv3 live migration support Pavel Fedin
2015-10-22 14:02 ` [Qemu-devel] [RFC PATCH v3 1/4] hw/intc/arm_gicv3_common: Add state information Pavel Fedin
2015-10-23 13:57 ` Peter Maydell
2015-10-24 12:30 ` Shlomo Pongratz
2015-10-24 12:35 ` Peter Maydell
2015-10-26 7:43 ` Pavel Fedin
2015-10-26 10:59 ` Peter Maydell
2015-10-22 14:02 ` [Qemu-devel] [RFC PATCH v3 2/4] kernel: Add definitions for GICv3 attributes Pavel Fedin
2015-10-22 14:02 ` [Qemu-devel] [RFC PATCH v3 3/4] hw/intc/arm_gicv3_kvm: Implement get/put functions Pavel Fedin
2015-10-23 13:57 ` Peter Maydell
2015-10-26 7:59 ` Pavel Fedin [this message]
2015-10-26 11:09 ` Peter Maydell
2015-10-22 14:02 ` [Qemu-devel] [RFC PATCH v3 4/4] hw/intc/arm_gicv3_common: Add vmstate descriptors Pavel Fedin
2015-10-23 13:57 ` Peter Maydell
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='00f801d10fc4$49a5bbe0$dcf133a0$@samsung.com' \
--to=p.fedin@samsung.com \
--cc=diana.craciun@freescale.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shlomo.pongratz@huawei.com \
--cc=shlomopongratz@gmail.com \
--cc=vijay.kilari@gmail.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;
as well as URLs for NNTP newsgroup(s).