Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Paolo Bonzini
On 15/12/2014 14:37, Dr. David Alan Gilbert wrote: >> > Right, the question is whether you really want to do this. :) > Well, it would solve this type of problem less painfully, your migration > would always succeed and destinations that knew what to do with it would > always do the right thing.

Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > > > On 15/12/2014 14:30, Dr. David Alan Gilbert wrote: > > Anyone who really cares about backwards migration compatibility would > > probably have to guard the subsection with the machine-type to avoid > > (e) ever happening (the heuristic from (c) m

Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Paolo Bonzini
On 15/12/2014 14:30, Dr. David Alan Gilbert wrote: > Anyone who really cares about backwards migration compatibility would > probably have to guard the subsection with the machine-type to avoid > (e) ever happening (the heuristic from (c) might be useful to add). Right. > although if you do hav

Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > > > On 15/12/2014 11:46, Dr. David Alan Gilbert wrote: > > I can see this causes the thr_ipending to be 0 more of the time, but I don't > > see why it's sufficient. > > > > If the transmitter has just transmitted it's last byte, then thr_ipending >

Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Paolo Bonzini
On 15/12/2014 11:46, Dr. David Alan Gilbert wrote: > I can see this causes the thr_ipending to be 0 more of the time, but I don't > see why it's sufficient. > > If the transmitter has just transmitted it's last byte, then thr_ipending is > set > true by serial_xmit, however if there is a higher

Re: [Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-15 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > This is responsible for failure of migration from 2.2 to 2.1, because > thr_ipending is always one in practice. > > serial.c is setting thr_ipending unconditionally. However, thr_ipending > is not used at all if THRI=0, and it will be overwritten aga

[Qemu-devel] [PATCH v3 1/4] serial: reset thri_pending on IER writes with THRI=0

2014-12-12 Thread Paolo Bonzini
This is responsible for failure of migration from 2.2 to 2.1, because thr_ipending is always one in practice. serial.c is setting thr_ipending unconditionally. However, thr_ipending is not used at all if THRI=0, and it will be overwritten again the next time THRE or THRI changes. For that reason