qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] Unable to loadvm on qemu-system-ppc -M g3beige (keyboard freeze)
Date: Fri, 19 Dec 2014 18:45:14 +0100	[thread overview]
Message-ID: <5494642A.3070109@suse.de> (raw)
In-Reply-To: <5494608F.4010307@redhat.com>



On 19.12.14 18:29, Paolo Bonzini wrote:
> 
> 
> On 19/12/2014 18:16, Alexander Graf wrote:
>>
>>
>> On 19.12.14 17:51, Mark Cave-Ayland wrote:
>>> On 19/12/14 16:35, Peter Maydell wrote:
>>>
>>>> On 19 December 2014 at 16:15, Mark Cave-Ayland
>>>> <mark.cave-ayland@ilande.co.uk> wrote:
>>>>> It looks like after restoring the CPU state with loadvm env->htab_base
>>>>> is still at 0x0 rather than its pre-migration value of 0x7e000000.
>>>>
>>>> Odd -- there is code that is at least trying to do that:
>>>> machine.c calls ppc_store_sdr1() which should set htab_base/mask
>>>> according to the migrated value of the register...
>>>
>>> Stepping through ppc_store_sdr1() I see the problem is the if() statement:
>>>
>>> if (env->spr[SPR_SDR1] != value) {
>>>    ....
>>> }
>>>
>>> It looks like env->spr[SPR_SDR1] has already been set to 0x7e000000
>>> before the call to ppc_store_sdr1() and so as the values are already
>>> equal then the code to setup env->htab_mask and env->htab_base is bypassed.
>>>
>>> The quick fix is to comment out the above if() statement which allows me
>>> to restore my OpenBIOS image successfully with -loadvm but sadly not my
>>> OS image (I guess there are probably a few more state bugs still lying
>>> around). Does this seem the right thing to do or is there a better way?
>>
>> How about something like this instead? Then we at least don't lose the
>> acceleration we get from not invalidating the TLB on identical SDR1 writes.
>>
>>
>> Alex
>>
>>
>> diff --git a/target-ppc/machine.c b/target-ppc/machine.c
>> index c801b82..6f347bf 100644
>> --- a/target-ppc/machine.c
>> +++ b/target-ppc/machine.c
>> @@ -71,6 +71,7 @@ static int cpu_load_old(QEMUFile *f, void *opaque, int
>> version_id)
>>      for (i = 0; i < 1024; i++)
>>          qemu_get_betls(f, &env->spr[i]);
>>      if (!env->external_htab) {
>> +        env->spr[SPR_SDR1] = 0;
>>          ppc_store_sdr1(env, sdr1);
>>      }
>>      qemu_get_be32s(f, &env->vscr);
> 
> Or even move the tlb_flush and if to the caller, g.  It
> is only needed there, and would get in the way if one day PPC were to
> support --disable-tcg (which removes cputlb.c from the executable).

Even better, yes.


Alex

      reply	other threads:[~2014-12-19 18:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 10:17 [Qemu-devel] Unable to loadvm on qemu-system-ppc -M g3beige (keyboard freeze) Mark Cave-Ayland
2014-12-17 10:23 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-12-17 10:47   ` Mark Cave-Ayland
2014-12-17 11:11     ` Alexander Graf
2014-12-17 11:23       ` Peter Maydell
2014-12-18 13:54         ` Mark Cave-Ayland
2014-12-18 14:46           ` Alexander Graf
2014-12-18 15:13             ` Peter Maydell
2014-12-18 21:36               ` Mark Cave-Ayland
2014-12-18 23:01                 ` Alexander Graf
2014-12-19 10:53                   ` Mark Cave-Ayland
2014-12-19 12:29                     ` Peter Maydell
2014-12-19 14:12                       ` Mark Cave-Ayland
2014-12-19 14:29                         ` Peter Maydell
2014-12-19 16:15                           ` Mark Cave-Ayland
2014-12-19 16:35                             ` Peter Maydell
2014-12-19 16:51                               ` Mark Cave-Ayland
2014-12-19 17:16                                 ` Alexander Graf
2014-12-19 17:29                                   ` Paolo Bonzini
2014-12-19 17:45                                     ` Alexander Graf [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=5494642A.3070109@suse.de \
    --to=agraf@suse.de \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).