Subject: Re: [PATCH] kselftest: kvm/arm64: Skip tests if we can't create a vgic-v3

From: Marc Zyngier <[email-masked]>
Date: Wed, 26 Jan 2022 13:05:01 +0000

On Wed, 26 Jan 2022 12:52:22 +0000,
Mark Brown <[email-masked]> wrote:
> 
> On Wed, Jan 26, 2022 at 09:07:48AM +0000, Marc Zyngier wrote:
> > Mark Brown <[email-masked]> wrote:
> 
> > >  	/* Distributor setup */
> > > -	gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, false);
> > > +	gic_fd = kvm_create_device(vm, KVM_DEV_TYPE_ARM_VGIC_V3, true);
> 
> > So you now only test whether it is possible to create a virtual GICv3,
> > but don't actually create it. How does this work?
> 
> Oh, that's rather obscure in the API - so the file descriptor returned
> if the test flag is specified can't actually be used?

No file descriptor is returned at all from the kernel, so you should
always get -1 as populated by kvm_create_device().

See virt/kvm/kvm_main.c::kvm_ioctl_create_device().

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel