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 v3 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd
Date: Tue, 12 Dec 2017 14:29:40 +0300 [thread overview]
Message-ID: <20171212112939.GA19468@rkaganb.sw.ru> (raw)
In-Reply-To: <20171212101723.GB14000@rkaganb.sw.ru>
On Tue, Dec 12, 2017 at 01:17:23PM +0300, Roman Kagan wrote:
> On Tue, Dec 12, 2017 at 10:37:31AM +0100, David Hildenbrand wrote:
> > On 12.12.2017 10:02, Roman Kagan wrote:
> > > On Mon, Dec 11, 2017 at 10:14:48PM +0100, David Hildenbrand wrote:
> > >>> @@ -1226,6 +1227,54 @@ static int kvm_hv_hypercall_complete_userspace(struct kvm_vcpu *vcpu)
> > >>> return 1;
> > >>> }
> > >>>
> > >>> +static u16 hvcall_sigevent_param(struct kvm_vcpu *vcpu, gpa_t gpa, u64 *param)
> > >>> +{
> > >>> + struct page *page;
> > >>> + void *pg;
> > >>> + u64 *msg;
> > >>> +
> > >>> + if ((gpa & (__alignof__(*msg) - 1)) ||
> > >>> + offset_in_page(gpa) + sizeof(*msg) > PAGE_SIZE)
> > >>> + return HV_STATUS_INVALID_ALIGNMENT;
> > >>> +
> > >>
> > >> Don't we also need srcu_read_lock(&vcpu->kvm->srcu) for
> > >> kvm_vcpu_gfn_to_page?
> > >
> > > Seems so indeed. I also think I'll switch to using
> > > kvm_vcpu_read_guest().
> >
> > Probably better (because I think you also missed releasing the page)
>
> Hmm, I wonder where? (kvm_vcpu_read_guest ended up being more concise
> so I'll stick with it but I'd like to learn from my errors anyway.)
Nevermind, I screwed up my branches. The one I posted was missing
kvm_release_page_clean() indeed.
Thanks,
Roman.
prev parent reply other threads:[~2017-12-12 11:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 17:42 [PATCH v3 0/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2017-12-07 17:42 ` [PATCH v3 1/2] kvm: x86: factor out kvm.arch.hyperv (de)init Roman Kagan
2017-12-07 17:42 ` [PATCH v3 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2017-12-11 21:14 ` David Hildenbrand
2017-12-12 9:02 ` Roman Kagan
2017-12-12 9:37 ` David Hildenbrand
2017-12-12 10:17 ` Roman Kagan
2017-12-12 11:29 ` Roman Kagan [this message]
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=20171212112939.GA19468@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox