From: Jiahuan Zhang <jiahuanzhang90@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] Guest application reading from pl011 without device driver
Date: Thu, 23 Mar 2017 18:28:21 +0100 [thread overview]
Message-ID: <CAJy91CYfOUZ+_TrN6-tLtWuPX-3_gRc7bfNa4anW0iM42i1FTg@mail.gmail.com> (raw)
In-Reply-To: <ed9e6d65-ba93-d572-861a-46926a37d42a@redhat.com>
Hi, the method doesn't work for pipe. It still causes the same issue.
The only difference is that the first byte in the UART fifo can be read by
the guest app.
So now my guest app can immediately read 17bytes when the host is sending
data continuously,
then guest app is unable to read.
Now there is a solution-to-be. Set the qemu pipe chardev to wait for 1
millisecond before do a next ReadFile(),
then the pl011 can deliver the complete large data by the 16-byte fifo
continuously to the guest app.
Is it rational? Or is this host -CPU-dependent?
Regards,
Huan
On 23 March 2017 at 11:35, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 23/03/2017 11:12, Jiahuan Zhang wrote:
> >
> > It's Windows that doesn't support it (the Windows function name is
> > WaitForSingleObject).
> >
> >
> > Hi, I have checked the Windows chardev implimentation in QEMU.
> > I learned from char-win-stdio.c to using thread and WaitForSingleObject
> > for interlocking.
> > char-win-stdio.c uses qemu_add_wait_object().
> > Char-pipe.c uses qemu_add_polling_cb().
> > I found all over qemu, only char-pipe uses qemu_add_polling_cb().
> > Does this mean that somebody has already looked into this issue,
> > and failed in using qemu_add_wait_object(),
> > and then he/she created qemu_add_polling_cb()?
>
> I don't know, but using threads sounds like a way to solve the bug, indeed.
>
> Thanks,
>
> Paolo
>
next prev parent reply other threads:[~2017-03-23 17:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 16:32 [Qemu-devel] Guest application reading from pl011 without device driver Jiahuan Zhang
2017-03-21 16:39 ` Peter Maydell
2017-03-21 16:47 ` Jiahuan Zhang
2017-03-21 16:50 ` Peter Maydell
2017-03-21 16:59 ` Jiahuan Zhang
2017-03-21 17:10 ` Jiahuan Zhang
2017-03-21 17:16 ` Peter Maydell
2017-03-21 17:48 ` Jiahuan Zhang
2017-03-21 17:55 ` Peter Maydell
[not found] ` <CAJy91CZ4Ed-HGHLkzEc1dqQbo32d-eTE1S1ovO_ZwkDdTpkQXQ@mail.gmail.com>
[not found] ` <CAJy91CaCV40FgSP55qWZeZgkQ=2+E8Cr7xdbu9pn5HLEo+6JJQ@mail.gmail.com>
2017-03-21 18:11 ` Jiahuan Zhang
2017-03-21 18:28 ` Peter Maydell
2017-03-21 18:33 ` Jiahuan Zhang
2017-03-22 8:40 ` Paolo Bonzini
2017-03-22 8:48 ` Jiahuan Zhang
2017-03-22 9:37 ` Paolo Bonzini
2017-03-22 10:28 ` Jiahuan Zhang
2017-03-22 11:27 ` Paolo Bonzini
2017-03-23 10:12 ` Jiahuan Zhang
2017-03-23 10:35 ` Paolo Bonzini
2017-03-23 17:28 ` Jiahuan Zhang [this message]
2017-03-23 17:31 ` Paolo Bonzini
2017-03-24 7:24 ` Jiahuan Zhang
2017-03-24 10:00 ` Jiahuan Zhang
2017-05-01 12:06 ` Jiahuan Zhang
2017-03-22 11:07 ` Peter Maydell
2017-03-22 11:33 ` Paolo Bonzini
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=CAJy91CYfOUZ+_TrN6-tLtWuPX-3_gRc7bfNa4anW0iM42i1FTg@mail.gmail.com \
--to=jiahuanzhang90@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).