qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix serial interface vmstate


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] Fix serial interface vmstate
Date: Wed, 22 Jun 2011 18:14:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-06-22 12:13, Pavel Dovgaluk wrote:
>> On 2011-06-22 11:15, Pavel Dovgaluk wrote:
>>>>>>>   What is the purpose of subsections?
>>>>>>
>>>>>> To skip the new fields whenever possible. That would allow to continue
>>>>>> saving a vmstate on a new version of qemu and then restoring it on an
>>>>>> older one.
>>>>>
>>>>>   Do you have an idea how to implement "needed" function for my case?
>>>>> Because I think, these fields should always be saved and loaded, because
>>>>> they are related to the main state of the interface, not the kind of
>>>>> optional substate.
>>>>
>>>> E.g., if the fifo is empty, you do not need to save its content. That
>>>> would be one part of the condition. Go through all fields and check if
>>>> they have states that could be ignored or if they could be ignored if
>>>> other already saved fields have specific values. If you find any new
>>>> field that must always be restored, let us discuss it. It may turn out
>>>> that a substate is unrealistic, then we need to go with a new version.
>>>
>>>   You mean, if FIFO is empty an will not be saved, we will have to clear
>>> it before loading every time?
>>
>> We (soon, patches posted) do a reset before every loadvm. We already do
>> this when starting a new machine. That sets all states that aren't
>> restored to defaults. In case of the fifo, they are all emptied.
>>
>>>   So there should be multiple subsections for every possible field?
>>>   E.g. timers are saved only if they are pending, thr_ipending is saved
>>> only when it is nonzero, and so on. Do you mean that?
>>
>> Nope, only a single subsection. Either we are able to avoid any new
>> field under certain circumstances or we have to break the legacy format
>> anyway.
> 
>   Fields added by my patch are not belong to single subsection.
>   Consider THR and TSR registers:
>   THR:
>       Bit 5 in the LSR, line status register can be used to check if new 
>       information must be written to THR. The value 1 indicates that the 
>       register is empty.
>   TSR:
>       Contains data, that should be shifted out. This register is
>       Interconnected with transmit_timer - when timer event occurs,
>       the data is shifted out.
>   There are also other fields, that describe the state of the serial
> interface, but cannot be directly derived from THR and TSR state.

Neither thr nor tsr are set to a specific value on reset. That indicates
that both depend on other states to be valid. Looks like tsr_retry > 0
would be the condition for a tsr worth saving e.g.

> 
>   So, there are the following ways, as I see it:
>   1. Make several subsections - one for every substate.

Again, that comes with no benefits.

>   2. Make one subsection with very complex "needed" condition,
>      which will be true, when any part of the subsection should be
>      written. I think, that such complex condition will be too hard
>      for testing.
>   3. Change version of the format.

I still don't think we have found the case that requires a version change.

Jan

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]