All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] scsi: lsi problems since "unit attention on reset"
@ 2011-09-26  7:27 Jan Kiszka
  2011-09-26  7:50 ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2011-09-26  7:27 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Hi Paolo,

I'm facing problems over latest qemu with our special guest OS that is
using the LSI controller. It hangs during boot now. This can be resolved
by reverting commit c7b488721d (scsi: report unit attention on reset).

I cannot exclude a bug in the guest driver at this point, but maybe you
also have some idea what could go wrong in the SCSI stack or the LSI
emulation. Any suggestions where to look at would be welcome.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26  7:27 [Qemu-devel] scsi: lsi problems since "unit attention on reset" Jan Kiszka
@ 2011-09-26  7:50 ` Paolo Bonzini
  2011-09-26  9:23   ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2011-09-26  7:50 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On 09/26/2011 09:27 AM, Jan Kiszka wrote:
> Hi Paolo,
>
> I'm facing problems over latest qemu with our special guest OS that is
> using the LSI controller. It hangs during boot now. This can be resolved
> by reverting commit c7b488721d (scsi: report unit attention on reset).
>
> I cannot exclude a bug in the guest driver at this point, but maybe you
> also have some idea what could go wrong in the SCSI stack or the LSI
> emulation. Any suggestions where to look at would be welcome.

It works for me under Linux, so I suspect it is a bug in the guest OS or 
the BIOS, which should send TEST UNIT READY before trying to communicate 
to the HBA.  You can use tracing to detect that, it probably sends 
something like READ CAPACITY and fails because it does not expect that 
command to fail.

That said, since there are 3 out of 3 BIOSes that couldn't cope with 
that change---Linux and Windows work of course---it makes sense to 
revert it even though the patch by itself is correct.  If you send it 
out, I'll gladly add my Acked-by.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26  7:50 ` Paolo Bonzini
@ 2011-09-26  9:23   ` Jan Kiszka
  2011-09-26  9:49     ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2011-09-26  9:23 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 2011-09-26 09:50, Paolo Bonzini wrote:
> On 09/26/2011 09:27 AM, Jan Kiszka wrote:
>> Hi Paolo,
>>
>> I'm facing problems over latest qemu with our special guest OS that is
>> using the LSI controller. It hangs during boot now. This can be resolved
>> by reverting commit c7b488721d (scsi: report unit attention on reset).
>>
>> I cannot exclude a bug in the guest driver at this point, but maybe you
>> also have some idea what could go wrong in the SCSI stack or the LSI
>> emulation. Any suggestions where to look at would be welcome.
> 
> It works for me under Linux, so I suspect it is a bug in the guest OS or 
> the BIOS, which should send TEST UNIT READY before trying to communicate 
> to the HBA.  You can use tracing to detect that, it probably sends 
> something like READ CAPACITY and fails because it does not expect that 
> command to fail.

I'm just getting these scsi events, then the guest stops:

scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
scsi_req_alloc target 0 lun 0 tag 0
scsi_test_unit_ready target 0 lun 0 tag 0
scsi_req_build_sense target 0 lun 0 tag 0 key 0x6 asc 0x29 ascq 00
scsi_req_dequeue target 0 lun 0 tag 0

> 
> That said, since there are 3 out of 3 BIOSes that couldn't cope with 
> that change---Linux and Windows work of course---it makes sense to 
> revert it even though the patch by itself is correct.  If you send it 
> out, I'll gladly add my Acked-by.

We are currently checking the driver situation internally. But if you
say you want it reverted in any case, I'll send a patch.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26  9:23   ` Jan Kiszka
@ 2011-09-26  9:49     ` Paolo Bonzini
  2011-09-26 10:26       ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2011-09-26  9:49 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On 09/26/2011 11:23 AM, Jan Kiszka wrote:
> scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
> scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
> scsi_req_alloc target 0 lun 0 tag 0
> scsi_test_unit_ready target 0 lun 0 tag 0
> scsi_req_build_sense target 0 lun 0 tag 0 key 0x6 asc 0x29 ascq 00
> scsi_req_dequeue target 0 lun 0 tag 0

This looks good.

Try http://permalink.gmane.org/gmane.comp.emulators.qemu/118133 perhaps.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26  9:49     ` Paolo Bonzini
@ 2011-09-26 10:26       ` Jan Kiszka
  2011-09-26 11:00         ` Paolo Bonzini
  2011-09-26 15:10         ` Jan Kiszka
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Kiszka @ 2011-09-26 10:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 2011-09-26 11:49, Paolo Bonzini wrote:
> On 09/26/2011 11:23 AM, Jan Kiszka wrote:
>> scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
>> scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
>> scsi_req_alloc target 0 lun 0 tag 0
>> scsi_test_unit_ready target 0 lun 0 tag 0
>> scsi_req_build_sense target 0 lun 0 tag 0 key 0x6 asc 0x29 ascq 00
>> scsi_req_dequeue target 0 lun 0 tag 0
> 
> This looks good.
> 
> Try http://permalink.gmane.org/gmane.comp.emulators.qemu/118133 perhaps.

Nope, no effect.

A colleague is parsing the lsi debug output ATM.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26 10:26       ` Jan Kiszka
@ 2011-09-26 11:00         ` Paolo Bonzini
  2011-09-26 15:10         ` Jan Kiszka
  1 sibling, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2011-09-26 11:00 UTC (permalink / raw)
  To: qemu-devel

On 09/26/2011 12:26 PM, Jan Kiszka wrote:
>> scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
>>>  scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
>>>  scsi_req_alloc target 0 lun 0 tag 0
>>>  scsi_test_unit_ready target 0 lun 0 tag 0
>>>  scsi_req_build_sense target 0 lun 0 tag 0 key 0x6 asc 0x29 ascq 00
>>>  scsi_req_dequeue target 0 lun 0 tag 0
>>
>>  This looks good.
>
> Nope, no effect.

How does the trace go on?

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26 10:26       ` Jan Kiszka
  2011-09-26 11:00         ` Paolo Bonzini
@ 2011-09-26 15:10         ` Jan Kiszka
  2011-09-26 15:22           ` Paolo Bonzini
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2011-09-26 15:10 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 2011-09-26 12:26, Jan Kiszka wrote:
> On 2011-09-26 11:49, Paolo Bonzini wrote:
>> On 09/26/2011 11:23 AM, Jan Kiszka wrote:
>>> scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
>>> scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
>>> scsi_req_alloc target 0 lun 0 tag 0
>>> scsi_test_unit_ready target 0 lun 0 tag 0
>>> scsi_req_build_sense target 0 lun 0 tag 0 key 0x6 asc 0x29 ascq 00
>>> scsi_req_dequeue target 0 lun 0 tag 0
>>
>> This looks good.
>>
>> Try http://permalink.gmane.org/gmane.comp.emulators.qemu/118133 perhaps.
> 
> Nope, no effect.
> 
> A colleague is parsing the lsi debug output ATM.

And you were right: it turned out to be a driver issue. The bug sneaked
in while adapting the original driver to some specific differences
between QEMU and real HW (here: lacking compat bit support).

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26 15:10         ` Jan Kiszka
@ 2011-09-26 15:22           ` Paolo Bonzini
  2011-09-26 16:12             ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2011-09-26 15:22 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On 09/26/2011 05:10 PM, Jan Kiszka wrote:
> And you were right: it turned out to be a driver issue. The bug sneaked
> in while adapting the original driver to some specific differences
> between QEMU and real HW (here: lacking compat bit support).

Cool, then we can leave in the patch I think.  I originally did it in 
hope of detecting possible bugs with (upcoming) migration support, which 
will use unit attention to make the guest requeue all requests on the 
destination.  It looks like my goal has been attained.

Out of curiosity, have you ever looked into (or are you interested into) 
using multiple LUNs per target with the LSI driver?  It crashes 
miserably for me with a page fault in the Linux ISR, and that's when I 
started using another device. :)

You can play with them on the scsi-addr branch of 
git://github.com/bonzini/qemu.git; just create two scsi-disk devices, 
with lun=0 and lun=1, and they will get the same target ID but two 
different LUNs.  It's of course possible the bug is in my code, but then 
I got the same failure with two completely different implementations of 
the feature so...

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] scsi: lsi problems since "unit attention on reset"
  2011-09-26 15:22           ` Paolo Bonzini
@ 2011-09-26 16:12             ` Jan Kiszka
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2011-09-26 16:12 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 2011-09-26 17:22, Paolo Bonzini wrote:
> On 09/26/2011 05:10 PM, Jan Kiszka wrote:
>> And you were right: it turned out to be a driver issue. The bug sneaked
>> in while adapting the original driver to some specific differences
>> between QEMU and real HW (here: lacking compat bit support).
> 
> Cool, then we can leave in the patch I think.  I originally did it in 
> hope of detecting possible bugs with (upcoming) migration support, which 
> will use unit attention to make the guest requeue all requests on the 
> destination.  It looks like my goal has been attained.

At least for this user.

> 
> Out of curiosity, have you ever looked into (or are you interested into) 
> using multiple LUNs per target with the LSI driver?  It crashes 
> miserably for me with a page fault in the Linux ISR, and that's when I 
> started using another device. :)

"Unfortunately", I haven't been confronted with such a requirement so
far. :)

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-09-26 16:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26  7:27 [Qemu-devel] scsi: lsi problems since "unit attention on reset" Jan Kiszka
2011-09-26  7:50 ` Paolo Bonzini
2011-09-26  9:23   ` Jan Kiszka
2011-09-26  9:49     ` Paolo Bonzini
2011-09-26 10:26       ` Jan Kiszka
2011-09-26 11:00         ` Paolo Bonzini
2011-09-26 15:10         ` Jan Kiszka
2011-09-26 15:22           ` Paolo Bonzini
2011-09-26 16:12             ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.