qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] spapr: Don't use the "dual" interrupt controller


From: Cédric Le Goater
Subject: Re: [Qemu-ppc] [PATCH] spapr: Don't use the "dual" interrupt controller mode with an old hypervisor
Date: Thu, 6 Jun 2019 19:38:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 06/06/2019 19:08, 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.
> 
> 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.

Yes. I think we should favor a KVM device over an emulated one in any case.
 
> 
> "dual" is definitely not a good choice with older KVMs. Internally force
> XICS when we detect this.
> 
> Signed-off-by: Greg Kurz <address@hidden>

Reviewed-by: Cédric Le Goater <address@hidden>

we could move the KVM tests done at the beginning of spapr_irq_init() 
in routine spapr_irq_check() but this is for another patch, and it's 
only a cleanup.

Thanks,

C.

> ---
>  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;
> +    }
>  }
>  
>  /*
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]