From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] spapr: Don't use the "dual" interrupt controller mode with an old hypervisor
Date: Fri, 7 Jun 2019 10:19:01 +1000 [thread overview]
Message-ID: <20190607001901.GC3760@umbus.fritz.box> (raw)
In-Reply-To: <155984093894.2803172.8618224129384655510.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 2213 bytes --]
On Thu, Jun 06, 2019 at 07:08:59PM +0200, Greg Kurz wrote:
> If KVM is too old to support XIVE native exploitation mode, we might end
> up using the emulated XIVE after CAS. This is sub-optimal if KVM in-kernel
> XICS is available, which is the case most of the time.
This is intentional. A predictable guest environment trumps performance.
> Also, an old KVM may not allow to destroy and re-create the KVM XICS, which
> is precisely what "dual" does during machine reset. This causes QEMU to try
> to switch to emulated XICS and to crash because RTAS call de-registration
> isn't handled correctly. We could possibly fix that, but again we would
> still end up with an emulated XICS or XIVE.
Ugh, that's a problem.
> "dual" is definitely not a good choice with older KVMs. Internally force
> XICS when we detect this.
But this is not an acceptable solution. Silently changing the guest
visible environment based on host capabilities is never ok. We must
either give the guest environment that the user has requested, or fail
outright.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/ppc/spapr_irq.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
> index 3156daf09381..d788bd662a7a 100644
> --- a/hw/ppc/spapr_irq.c
> +++ b/hw/ppc/spapr_irq.c
> @@ -18,6 +18,7 @@
> #include "hw/ppc/xics_spapr.h"
> #include "cpu-models.h"
> #include "sysemu/kvm.h"
> +#include "kvm_ppc.h"
>
> #include "trace.h"
>
> @@ -668,6 +669,15 @@ static void spapr_irq_check(SpaprMachineState *spapr, Error **errp)
> return;
> }
> }
> +
> + /*
> + * KVM may be too old to support XIVE, in which case we'd rather try
> + * to use the in-kernel XICS instead of the emulated XIVE.
> + */
> + if (kvm_enabled() && !kvmppc_has_cap_xive() &&
> + spapr->irq == &spapr_irq_dual) {
> + spapr->irq = &spapr_irq_xics;
> + }
> }
>
> /*
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-06-07 0:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 17:08 [Qemu-devel] [PATCH] spapr: Don't use the "dual" interrupt controller mode with an old hypervisor Greg Kurz
2019-06-06 17:38 ` Cédric Le Goater
2019-06-07 0:19 ` David Gibson [this message]
2019-06-07 8:17 ` Cédric Le Goater
2019-06-07 8:27 ` Cédric Le Goater
2019-06-07 9:49 ` Greg Kurz
2019-06-12 1:29 ` David Gibson
2019-06-11 5:26 ` David Gibson
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=20190607001901.GC3760@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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;
as well as URLs for NNTP newsgroup(s).