[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 3/5] atapi: GESN: Spin off No Event Available ha
[Qemu-devel] Re: [PATCH 3/5] atapi: GESN: Spin off No Event Available handling into own function
Mon, 11 Apr 2011 10:51:46 +0200
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:188.8.131.52) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
Am 09.04.2011 12:36, schrieb Amit Shah:
> On (Fri) 08 Apr 2011 [15:31:49], Kevin Wolf wrote:
>> Am 08.04.2011 09:15, schrieb Amit Shah:
>>> Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available status in its
>>> own function.
>>> Also ensure the buffer the driver sent us is big enough to fill in all
>>> the data we have -- else just fill in as much as the buffer can hold.
>> This is unnecessary and in fact none of the IDE code does this.
>> s->io_buffer isn't guest memory, but an internal buffer that is
>> allocated like this:
>> s->io_buffer = qemu_memalign(2048, IDE_DMA_BUF_SECTORS*512 + 4);
> OK - so all the code paths will be much easier then.
> But by my reading of (the kernel) code, it looks as if the kernel
> allocates the memory and passes it on. What am I missing?
That the data is copied. All command work on the internal s->io_buffer.
Once the command is completed, the response can be transferred to the
guest, either using DMA (see bmdma_rw_buf) or PIO (ide_data_readl).
>> So that's more than enough for storing four bytes. ide_atapi_cmd_reply()
>> takes care of making only max_size bytes visible to the guest.
> OK - but in some cases we just do a ide_set_irq() instead of
> ide_atapi_cmd_reply() so what happens in that case?
I can't find any ATAPI command that calls ide_set_irq directly. Anyway,
the important thing is that s->io_buffer_size is set correctly.
- [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN, Amit Shah, 2011/04/08
- [Qemu-devel] [PATCH 4/5] atapi: GESN: Add enums for commonly-used field types, Amit Shah, 2011/04/08
- [Qemu-devel] [PATCH 5/5] atapi: Implement 'media' subcommand of GET_EVENT_STATUS_NOTIFICATION command, Amit Shah, 2011/04/08
- [Qemu-devel] Re: [PATCH 0/5] atapi: Implement 'media' subcommand for GESN, Paolo Bonzini, 2011/04/08
- Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN, Markus Armbruster, 2011/04/08