qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Cornelia Huck <cohuck@redhat.com>
Cc: "Jason J. Herne" <jjherne@linux.ibm.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Colin Xu" <colin.xu@intel.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	qemu-devel@nongnu.org, "Roman Bolshakov" <r.bolshakov@yadro.com>,
	haxm-team@intel.com, "Wenchao Wang" <wenchao.wang@intel.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Sunil Muthuswamy" <sunilmut@microsoft.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH 3/3] cpu-timers, icount: new modules
Date: Mon, 13 Jul 2020 13:27:05 +0200	[thread overview]
Message-ID: <d00b0cbf-e698-5c09-d355-22a1ba3c624d@suse.de> (raw)
In-Reply-To: <20200713125122.647232d0.cohuck@redhat.com>

On 7/13/20 12:51 PM, Cornelia Huck wrote:
> On Sat, 11 Jul 2020 13:40:50 +0200
> Claudio Fontana <cfontana@suse.de> wrote:
> 
>> I found out something that for me shows that more investigation here is warranted.
>>
>>
>> Here is my latest workaround for the problem:
>>
>>
>>
>> diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
>> index 1e036cc602..47c9a015af 100644
>> --- a/hw/s390x/s390-skeys.c
>> +++ b/hw/s390x/s390-skeys.c
>> @@ -252,6 +252,8 @@ static const TypeInfo qemu_s390_skeys_info = {
>>      .class_size    = sizeof(S390SKeysClass),
>>  };
>>  
>> +extern void qemu_fflush(QEMUFile *f);
>> +
>>  static void s390_storage_keys_save(QEMUFile *f, void *opaque)
>>  {
>>      S390SKeysState *ss = S390_SKEYS(opaque);
>> @@ -302,6 +304,7 @@ static void s390_storage_keys_save(QEMUFile *f, void *opaque)
>>      g_free(buf);
>>  end_stream:
>>      qemu_put_be64(f, eos);
>> +    qemu_fflush(f);
>>  }
>>  
>>  static int s390_storage_keys_load(QEMUFile *f, void *opaque, int version_id)
>> ------------------------------------------------------------------------------------
>>
>>
>> I think that this might imply that my patch changing the migration stream has only triggered an existing problem.
> 
> Looks a bit like it.
> 
>>
>> The sympthom is: the load keys code does not see the EOS (byte value 1).
>> It does see the keys (which are all empty in the test, ie 32678 times the byte value 0). 
> 
> Yes, that (zero keys) is expected.
> 
>>
>> The workaround for the sympthom: flush the qemu file after putting the EOS in there.
>>
>>
>> Any ideas on where to investigate next?
> 
> Do any other users of the SaveVMHandlers interface see errors as well
> (or do they do the fflush dance)?
> 

Hi Cornelia,

just want to point you also to this discussion that I made outside of the context of this particular patch, with a much simpler reproducer:

https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg03969.html

There do not seem to be many users of the "Old style" vmstate_save as it is called in the code.

I could find only:

fgrep -R -- ".save_state"

hw/s390x/tod.c:    .save_state = s390_tod_save,
hw/s390x/s390-skeys.c:    .save_state = s390_storage_keys_save,
net/slirp.c:    .save_state = net_slirp_state_save,

It is difficult to see what does fflush where, and which methods are supposed to do what,
because we have quite a few methods in SaveVMHandlers and VMStateDescription.

Some of the fflushes are just done in the code just after writing the EOS,
and in some cases there is no fflush after writing the EOS, but there are other methods called at completion time as far as I understand, where the fflush is done.

The issue in the stream seems to appear only just after the s390 keys are written.

Maybe better to continue the discussion at: 

https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg03969.html

?
Otherwise it is fine, I can follow two threads if you prefer so.

Thanks,

Claudio








  reply	other threads:[~2020-07-13 11:27 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  9:35 [PATCH 0/3] QEMU cpus.c refactoring part1 Claudio Fontana
2020-06-29  9:35 ` [PATCH 1/3] softmmu: move softmmu only files from root Claudio Fontana
2020-07-03 17:21   ` Paolo Bonzini
2020-06-29  9:35 ` [PATCH 2/3] cpu-throttle: new module, extracted from cpus.c Claudio Fontana
2020-06-29  9:35 ` [PATCH 3/3] cpu-timers, icount: new modules Claudio Fontana
2020-07-08 14:34   ` Paolo Bonzini
2020-07-08 15:00     ` Claudio Fontana
2020-07-08 15:05       ` Paolo Bonzini
2020-07-08 15:07         ` Thomas Huth
2020-07-08 15:12           ` Paolo Bonzini
2020-07-08 15:15             ` Claudio Fontana
2020-07-08 15:15             ` Thomas Huth
2020-07-08 15:17         ` Claudio Fontana
2020-07-08 15:23           ` Paolo Bonzini
2020-07-08 15:30             ` Claudio Fontana
2020-07-09 18:38         ` Claudio Fontana
2020-07-09 18:46           ` Claudio Fontana
2020-07-10  6:33             ` Cornelia Huck
2020-07-10 19:20               ` Claudio Fontana
2020-07-13 10:46                 ` Cornelia Huck
2020-07-11 11:40               ` Claudio Fontana
2020-07-13 10:51                 ` Cornelia Huck
2020-07-13 11:27                   ` Claudio Fontana [this message]
2020-07-10  4:36           ` Thomas Huth
2020-07-10 22:45             ` Paolo Bonzini
2020-07-11  9:14               ` Claudio Fontana
2020-07-11  9:39                 ` Paolo Bonzini
2020-07-11 11:49                   ` Claudio Fontana
2020-07-11 12:19                     ` Paolo Bonzini
2020-07-11 12:48                       ` Claudio Fontana
2020-07-29  8:48                       ` Claudio Fontana
2020-07-29 10:01                         ` Paolo Bonzini
2020-07-30 16:33                           ` Claudio Fontana
2020-07-30 22:09                             ` Paolo Bonzini
2020-07-31 10:59                               ` Claudio Fontana
2020-07-02  6:27 ` [PATCH 0/3] QEMU cpus.c refactoring part1 Claudio Fontana
2020-07-03 17:21   ` Paolo Bonzini

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=d00b0cbf-e698-5c09-d355-22a1ba3c624d@suse.de \
    --to=cfontana@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=colin.xu@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=haxm-team@intel.com \
    --cc=jjherne@linux.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=rth@twiddle.net \
    --cc=sunilmut@microsoft.com \
    --cc=thuth@redhat.com \
    --cc=wenchao.wang@intel.com \
    /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).