From: Sven Schnelle <svens@stackframe.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>,
qemu-devel@nongnu.org, deller@gmx.de
Subject: Re: [PATCH] hw/scsi/lsi53c895a: add hack to prevent scsi timeouts in HP-UX 10.20
Date: Thu, 29 Feb 2024 19:01:53 +0100 [thread overview]
Message-ID: <87msrjxi7i.fsf@t14.stackframe.org> (raw)
In-Reply-To: <CAFEAcA8tbtrtoZSO2MmLHr+7+mcys63z15qFEVYm=nAO4cUMmQ@mail.gmail.com> (Peter Maydell's message of "Thu, 29 Feb 2024 17:26:53 +0000")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Thu, 29 Feb 2024 at 16:54, Sven Schnelle <svens@stackframe.org> wrote:
>>
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>> > On Wed, 28 Feb 2024 at 21:12, Sven Schnelle <svens@stackframe.org> wrote:
>> >>
>> >> HP-UX 10.20 seems to make the lsi53c895a spinning on a memory location
>> >> under certain circumstances. As the SCSI controller and CPU are not
>> >> running at the same time this loop will never finish. After some
>> >> time, the check loop interrupts with a unexpected device disconnect.
>> >> This works, but is slow because the kernel resets the scsi controller.
>> >> Instead of signaling UDC, add an option 'hpux-spin-workaround' which
>> >> emulates a INTERRUPT 2 script instruction. This instruction tells the
>> >> kernel that the request was fulfilled. With this change, SCSI speeds
>> >> improves significantly.
>> >> [..]
>> > I see we already have a hacky workaround for other OSes
>> > that do something similar. The ideal fix for both of these
>> > I think would be for lsi_execute_script() to, instead of stopping,
>> > arrange to defer executing more script instructions until
>> > after the guest has had a chance to run a bit more.
>> > I think setting a timer that calls lsi_resume_script() after
>> > a while would have that effect.
>>
>> Thanks, good idea. So something like this?
>
> Yeah, something like that I think. (You probably want to delete
> the timer on reset, and you need to handle migration -- you can
> either put the timer state in a new vmstate section, or else
> in post-load if the state is 'LSI_WAIT_SCRIPTS' arm the timer.)
> Does it work? :-)
Yes it does. I only did a quick hack without caring about things like
reset, freeing the timer and migration. I successfully booted HP-UX 10.20
without any scsi errors in the dmesg. So i think this is much better
than the commandline option. I'll prepare a proper patch in the next
days and submit it.
Thanks!
Sven
prev parent reply other threads:[~2024-02-29 18:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 21:11 [PATCH] hw/scsi/lsi53c895a: add hack to prevent scsi timeouts in HP-UX 10.20 Sven Schnelle
2024-02-29 9:36 ` Peter Maydell
2024-02-29 16:54 ` Sven Schnelle
2024-02-29 17:26 ` Peter Maydell
2024-02-29 18:01 ` Sven Schnelle [this message]
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=87msrjxi7i.fsf@t14.stackframe.org \
--to=svens@stackframe.org \
--cc=deller@gmx.de \
--cc=fam@euphon.net \
--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).