From: Gerd Hoffmann <kraxel@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Huangpeng (Peter)" <peter.huangpeng@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v2] usb: drop active assert when pid is invalid
Date: Tue, 16 Feb 2016 15:38:58 +0100 [thread overview]
Message-ID: <1455633538.7504.111.camel@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020B02E0EF7@SZXEMA503-MBS.china.huawei.com>
Hi,
> > When clearing RS in cmd we should also set HALTED in status I think.
> Actually, uhci_frame_timer() had done this work.
>
> if (!(s->cmd & UHCI_CMD_RS)) {
> /* Full stop */
> trace_usb_uhci_schedule_stop();
> qemu_del_timer(s->frame_timer);
> uhci_async_cancel_all(s);
> /* set hchalted bit in status - UHCI11D 2.1.2 */
> s->status |= UHCI_STS_HCHALTED;
> return;
> }
Ok, all fine then.
>
> > How do we reach the assert above? Maybe it is enough to move this pid
>
> > check to the start of the uhci_handle_td function to avoid triggering
>
> > the assert?
>
> >
>
> If Qemu read a wrong td, and then get a wrong pid, assertion will be reached.
> I thought that method, but I gave up as more complicated.
I think if we avoid calling usb_packet_setup with an invalid pid things
should work fine. So checking whenever the pid is valid as very first
thing in uhci_handle_td() should work, no?
cheers,
Gerd
prev parent reply other threads:[~2016-02-16 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 13:04 [Qemu-devel] [PATCH v2] usb: drop active assert when pid is invalid Gonglei
2016-02-16 13:54 ` Gerd Hoffmann
2016-02-16 14:30 ` Gonglei (Arei)
2016-02-16 14:38 ` Gerd Hoffmann [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=1455633538.7504.111.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=peter.huangpeng@huawei.com \
--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).