All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Khansa Butt <khansa@kics.edu.pk>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 5/6] target-mips: Adding support for Cavium specific instructions
Date: Wed, 30 Nov 2011 12:54:24 +0100	[thread overview]
Message-ID: <4ED61970.9040303@web.de> (raw)
In-Reply-To: <CAAoJSP7e2cZyOOZpJ88=oqvQESPOeMbmNgmUzAVE5+qWn0c5cw@mail.gmail.com>

Am 22.11.2011 09:31, schrieb Khansa Butt:
> On Tue, Nov 1, 2011 at 1:24 AM, Andreas Färber <andreas.faerber@web.de> wrote:
>>
>> Am 28.10.2011 06:42, schrieb Khansa Butt:
>>>
>>>
>>> On Sat, Oct 22, 2011 at 4:36 PM, Andreas Färber <andreas.faerber@web.de
>>> <mailto:andreas.faerber@web.de>> wrote:
>>>
>>>     Am 22.10.2011 12:11, schrieb khansa@kics.edu.pk
>>>     <mailto:khansa@kics.edu.pk>:
>>>
>>>     > diff --git a/target-mips/machine.c b/target-mips/machine.c
>>>     > index be72b36..a274ce2 100644
>>>     > --- a/target-mips/machine.c
>>>     > +++ b/target-mips/machine.c
>>>     > @@ -173,6 +179,12 @@ static void load_tc(QEMUFile *f, TCState *tc)
>>>     >      qemu_get_betls(f, &tc->CP0_TCSchedule);
>>>     >      qemu_get_betls(f, &tc->CP0_TCScheFBack);
>>>     >      qemu_get_sbe32s(f, &tc->CP0_Debug_tcstatus);
>>>     > +    qemu_get_betls(f, &tc->MPL0);
>>>     > +    qemu_get_betls(f, &tc->MPL1);
>>>     > +    qemu_get_betls(f, &tc->MPL2);
>>>     > +    qemu_get_betls(f, &tc->P0);
>>>     > +    qemu_get_betls(f, &tc->P1);
>>>     > +    qemu_get_betls(f, &tc->P2);
>>>     >  }
>>>     >
>>>     >  static void load_fpu(QEMUFile *f, CPUMIPSFPUContext *fpu)
>>>
>>>     You're saving new fields, so you'll need to bump the version somewhere.
>>>     For loading, since you're adding at the end, you might be able to make
>>>     your additions conditional on the to-be-bumped version.
>>>
>>>
>>> I 'm not able to understand " bump the version somewhere"  kindly
>>> explain this.
>>
>> "Somewhere" indicates I don't know the exact line for mips. Compare the
>> recent patch to arm_gic.
>> The general idea is that QEMU needs to be able to load files saved with
>> an older version, the file format is therefore versioned. If you
>> unconditionally try to load your new registers, you break loading older
>> files that don't include them.
> 
> Thanks for your response.
> As I can't see any example of bumping the version of registers  in
> mips ( 32 or 64) so i'm in a bit difficult situation
> From arm_gic what i understand is that version_id is related to
> devices which are specific to some board
> as gic is related to RealView board. considering that i'm in user
> mode, can i do the same thing with Cavium's  registers as these are
> related to multiplier unit?

No, this is not board- or device-specific, it's CPU-specific. Cf.
target-mips/cpu.h:CPU_SAVE_VERSION
target-mips/savevm.c:cpu_load()

My suggestion was to bump CPU_SAVE_VERSION to 4, change the error check
to "if (version_id < 3)" and to enclose your cpuo_load() additions in
"if (version_id >= 4) { ... }".

Depending how long you need to resend, note that Juan is working on a
VMState refactoring of machine.c, which will make it more like devices.

Andreas

  reply	other threads:[~2011-11-30 11:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22 10:11 [Qemu-devel] [PATCH v3 0/6] MIPS64 user mode emulation in QEMU with Cavium specific instruction support khansa
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 1/6] linux-user:Support for MIPS64 user mode emulation in QEMU khansa
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 2/6] target-mips:enabling of 64 bit user mode and floating point operations khansa
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 3/6] linux-user:Signal handling for MIPS64 khansa
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 4/6] target-mips:Octeon cpu definition khansa
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 5/6] target-mips: Adding support for Cavium specific instructions khansa
2011-10-22 11:36   ` Andreas Färber
2011-10-28  4:42     ` Khansa Butt
2011-10-31 20:24       ` Andreas Färber
2011-11-22  8:31         ` Khansa Butt
2011-11-30 11:54           ` Andreas Färber [this message]
2011-12-01  5:35             ` Khansa Butt
2011-10-22 10:11 ` [Qemu-devel] [PATCH v3 6/6] Addition of Cavium instructions in disassembler khansa
2011-10-22 11:21 ` [Qemu-devel] [PATCH v3 0/6] MIPS64 user mode emulation in QEMU with Cavium specific instruction support Andreas Färber

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=4ED61970.9040303@web.de \
    --to=andreas.faerber@web.de \
    --cc=aurelien@aurel32.net \
    --cc=khansa@kics.edu.pk \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.