[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Guest application reading from pl011 without device dri
From: |
Jiahuan Zhang |
Subject: |
Re: [Qemu-devel] Guest application reading from pl011 without device driver |
Date: |
Tue, 21 Mar 2017 18:10:57 +0100 |
On 21 March 2017 at 17:59, Jiahuan Zhang <address@hidden> wrote:
>
>
> On 21 March 2017 at 17:50, Peter Maydell <address@hidden> wrote:
>
>> On 21 March 2017 at 16:47, Jiahuan Zhang <address@hidden>
>> 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
>>
>
>
- [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Peter Maydell, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Peter Maydell, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver,
Jiahuan Zhang <=
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Peter Maydell, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Peter Maydell, 2017/03/21
- Message not available
- Message not available
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Peter Maydell, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/21
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Paolo Bonzini, 2017/03/22
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/22
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Paolo Bonzini, 2017/03/22
- Re: [Qemu-devel] Guest application reading from pl011 without device driver, Jiahuan Zhang, 2017/03/22