From: Jiahuan Zhang <jiahuanzhang90@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Guest application reading from pl011 without device driver
Date: Tue, 21 Mar 2017 18:10:57 +0100 [thread overview]
Message-ID: <CAJy91CauUOcdEL1vAc2BeBCsFRNNpHypuGaqm3QaFq8xE3Q+5g@mail.gmail.com> (raw)
In-Reply-To: <CAJy91CbwRd0u+RJiXZZP11J6pU4Pw-FDGbf=hLSBPejNb78bDA@mail.gmail.com>
On 21 March 2017 at 17:59, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:
>
>
> On 21 March 2017 at 17:50, Peter Maydell <peter.maydell@linaro.org> wrote:
>
>> On 21 March 2017 at 16:47, Jiahuan Zhang <jiahuanzhang90@gmail.com>
>> wrote:
>> > The actual situation is, pl011_can_receive is returning false, the fifo
>> is
>> > full, pl011_read does't start.
>> > At this moment, only pl011_can_recieve is keeping returning 0.
>>
>> OK, so the incoming data has filled up the FIFO, and the UART
>> is now sitting waiting for the guest to read the data...
>>
>
> Yes. And I think the guest reading can start when the fifo is nonempty.
> In the guest program, I first check the flag register, once the fifo is
> nonempty,
> then move on to read from the data register.
>
> This works to read small data, smaller than 16 bytes.
>
>>
>> >> * whether pl011_can_receive is returning true even with
>> >> 16 bytes in the fifo (hard to see how, given the code)
>> >> * whether the fifo actually has fewer bytes in it because
>> >> the guest is reading them
>> >
>> >
>> > No, because the guest application does't get any data.
>>
>> ...so if the guest isn't getting any data that suggests it's
>> the guest code's bug (ie it is not actually reading out of
>> the FIFO).
>>
>
> What I found is pl011 expects to read all the data into fifo,
> though pl011_can_receive returns false.
> Only when all the data is read, pl011_read can start.
>
The only thing I can consider about my guest application is the interrupt.
Since in pl011_put_fifo(),
*if* (s->read_count == s->read_trigger){
s->int_level |= PL011_INT_RX;
pl011_update(s);
}
I try to enable the interrupt in the guest program, but still not work.
>> thanks
>> -- PMM
>>
>
>
next prev parent reply other threads:[~2017-03-21 17:11 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 [this message]
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
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=CAJy91CauUOcdEL1vAc2BeBCsFRNNpHypuGaqm3QaFq8xE3Q+5g@mail.gmail.com \
--to=jiahuanzhang90@gmail.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).