linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	maz@kernel.org, alexandru.elisei@arm.com, james.morse@arm.com,
	suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH v6 9/9] KVM: selftests: aarch64/vgic-v3 init sequence tests
Date: Wed, 7 Apr 2021 12:58:33 +0200	[thread overview]
Message-ID: <20210407105833.mrs5yk4prkopqp6p@kamzik.brq.redhat.com> (raw)
In-Reply-To: <3baf455d-c771-b2b7-a7ba-1cc4687054c8@redhat.com>

On Wed, Apr 07, 2021 at 12:14:29PM +0200, Auger Eric wrote:
> >> +int _kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test)
> >> +{
> >> +	struct kvm_create_device create_dev;
> >> +	int ret;
> >> +
> >> +	create_dev.type = type;
> >> +	create_dev.fd = -1;
> >> +	create_dev.flags = test ? KVM_CREATE_DEVICE_TEST : 0;
> >> +	ret = ioctl(vm_get_fd(vm), KVM_CREATE_DEVICE, &create_dev);
> >> +	if (ret == -1)
> >> +		return -errno;
> >> +	return test ? 0 : create_dev.fd;
> > 
> > Something like this belongs in the non underscore prefixed wrappers.
> I need at least to return the create_dev.fd or do you want me to add an
> extra int *fd parameter?
> What about:
> 
>         if (ret < 0)
>                 return ret;
>         return test ? 0 : create_dev.fd;

Maybe the underscore version of kvm_create_device isn't necessary. If
the non-underscore version isn't flexible enough, then just use the
ioctl directly from the test code with its own struct kvm_create_device
Being able to call ioctls directly from test code is what vm_get_fd()
is for, otherwise you could just use vm->fd.

Thanks,
drew


  reply	other threads:[~2021-04-07 10:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 16:39 [PATCH v6 0/9] KVM/ARM: Some vgic fixes and init sequence KVM selftests Eric Auger
2021-04-05 16:39 ` [PATCH v6 1/9] KVM: arm64: vgic-v3: Fix some error codes when setting RDIST base Eric Auger
2021-04-05 16:39 ` [PATCH v6 2/9] KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read Eric Auger
2021-04-05 16:39 ` [PATCH v6 3/9] KVM: arm64: vgic-v3: Fix error handling in vgic_v3_set_redist_base() Eric Auger
2021-04-05 16:39 ` [PATCH v6 4/9] KVM: arm/arm64: vgic: Reset base address on kvm_vgic_dist_destroy() Eric Auger
2021-04-05 16:39 ` [PATCH v6 5/9] docs: kvm: devices/arm-vgic-v3: enhance KVM_DEV_ARM_VGIC_CTRL_INIT doc Eric Auger
2021-04-05 16:39 ` [PATCH v6 6/9] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write] Eric Auger
2021-04-05 16:39 ` [PATCH v6 7/9] kvm: arm64: vgic-v3: Introduce vgic_v3_free_redist_region() Eric Auger
2021-04-05 16:39 ` [PATCH v6 8/9] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace Eric Auger
2021-04-05 16:39 ` [PATCH v6 9/9] KVM: selftests: aarch64/vgic-v3 init sequence tests Eric Auger
2021-04-06 15:09   ` Andrew Jones
2021-04-06 15:19     ` Marc Zyngier
2021-04-07 10:14     ` Auger Eric
2021-04-07 10:58       ` Andrew Jones [this message]
2021-04-06 13:55 ` [PATCH v6 0/9] KVM/ARM: Some vgic fixes and init sequence KVM selftests Marc Zyngier

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=20210407105833.mrs5yk4prkopqp6p@kamzik.brq.redhat.com \
    --to=drjones@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.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).