[PATCH v3 15/17] KVM: PPC: Book3S HV: XIVE: activate XIVE exploitation mode

David Gibson david at gibson.dropbear.id.au
Mon Mar 18 17:42:16 AEDT 2019


On Fri, Mar 15, 2019 at 01:06:07PM +0100, Cédric Le Goater wrote:
> Full support for the XIVE native exploitation mode is now available,
> advertise the capability KVM_CAP_PPC_IRQ_XIVE for guests running on
> PowerNV KVM Hypervisors only. Support for nested guests (pseries KVM
> Hypervisor) is not yet available. XIVE should also have been activated
> which is default setting on POWER9 systems running a recent Linux
> kernel.
> 
> Signed-off-by: Cédric Le Goater <clg at kaod.org>

Reviewed-by: David Gibson <david at gibson.dropbear.id.au>

> ---
>  arch/powerpc/kvm/powerpc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index bb51faf29162..d70b19f8725b 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -573,10 +573,11 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>  #ifdef CONFIG_KVM_XIVE
>  	case KVM_CAP_PPC_IRQ_XIVE:
>  		/*
> -		 * Return false until all the XIVE infrastructure is
> -		 * in place including support for migration.
> +		 * We need XIVE to be enabled on the platform (implies
> +		 * a POWER9 processor) and the PowerNV platform, as
> +		 * nested is not yet supported.
>  		 */
> -		r = 0;
> +		r = xive_enabled() && !!cpu_has_feature(CPU_FTR_HVMODE);

Nit: && is already a logical operation, so there should be no need for
the '!!' here.

>  		break;
>  #endif
>  

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20190318/aa69d95c/attachment.sig>


More information about the Linuxppc-dev mailing list