All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Kagan <rkagan@virtuozzo.com>
To: David Hildenbrand <david@redhat.com>
Cc: kvm@vger.kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>
Subject: Re: [PATCH v5 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd
Date: Wed, 13 Dec 2017 14:44:51 +0300	[thread overview]
Message-ID: <20171213114450.GD18723@rkaganb.sw.ru> (raw)
In-Reply-To: <efeeb454-5fa3-50a7-24d9-a4c289852b21@redhat.com>

On Wed, Dec 13, 2017 at 10:55:02AM +0100, David Hildenbrand wrote:
> 
> > +static u16 kvm_hvcall_signal_event(struct kvm_vcpu *vcpu, bool fast, u64 param)
> > +{
> > +	u16 ret;
> > +	u32 conn_id, flag_no;
> > +	int idx;
> > +	struct eventfd_ctx *eventfd;
> > +
> > +	if (unlikely(!fast)) {
> > +		gpa_t gpa = param;
> > +
> > +		if ((gpa & (__alignof__(param) - 1)) ||
> > +		    offset_in_page(gpa) + sizeof(param) > PAGE_SIZE)
> > +			return HV_STATUS_INVALID_ALIGNMENT;
> > +
> > +		idx = srcu_read_lock(&vcpu->kvm->srcu);
> > +		ret = kvm_vcpu_read_guest(vcpu, gpa, &param, sizeof(param));
> > +		srcu_read_unlock(&vcpu->kvm->srcu, idx);
> > +
> > +		if (ret < 0)
> > +			return HV_STATUS_INSUFFICIENT_MEMORY;
> 
> "... event flags do not require any buffer allocation or queuing within
> the hypervisor, so HvSignalEvent will never fail due to insufficient
> resources."

Ouch.  I wonder what else to map -EFAULT to then...  Looks like
HV_STATUS_INVALID_ALIGNMENT is the most appropriate (as in "The input or
output GPA pointer is not within the bounds of the GPA space.")

Thanks,
Roman.

  reply	other threads:[~2017-12-13 11:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 16:07 [PATCH v5 0/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2017-12-12 16:07 ` [PATCH v5 1/2] kvm: x86: factor out kvm.arch.hyperv (de)init Roman Kagan
2017-12-12 16:07 ` [PATCH v5 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2017-12-12 16:22   ` Paolo Bonzini
2017-12-12 16:29     ` David Hildenbrand
2017-12-12 18:18       ` Roman Kagan
2017-12-12 18:20         ` David Hildenbrand
2017-12-13  8:41           ` Roman Kagan
2017-12-13  9:35             ` David Hildenbrand
2017-12-13 10:00               ` Roman Kagan
2017-12-12 17:03     ` Roman Kagan
2017-12-13  9:51   ` David Hildenbrand
2017-12-13 11:04     ` Roman Kagan
2017-12-13 11:14       ` David Hildenbrand
2017-12-13 12:16         ` Roman Kagan
2017-12-13  9:55   ` David Hildenbrand
2017-12-13 11:44     ` Roman Kagan [this message]
2017-12-13 11:46       ` David Hildenbrand
2017-12-13 11:51         ` David Hildenbrand
2017-12-13 11:57           ` David Hildenbrand
2017-12-13 12:58             ` Roman Kagan

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=20171213114450.GD18723@rkaganb.sw.ru \
    --to=rkagan@virtuozzo.com \
    --cc=david@redhat.com \
    --cc=den@openvz.org \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=vkuznets@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.