qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: Edgar Iglesias <edgar.iglesias@xilinx.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC v1 3/3] target-microblaze: Convert use-fpu to a CPU property
Date: Sun, 17 May 2015 17:12:49 +0200	[thread overview]
Message-ID: <5558AFF1.6080206@suse.de> (raw)
In-Reply-To: <CAKmqyKPybSVgJE1vEr=EWDxGf8wGuDfAXFBFU2YeGykw_ZE-Vw@mail.gmail.com>

Am 17.05.2015 um 14:26 schrieb Alistair Francis:
> On Fri, May 15, 2015 at 9:15 PM, Andreas Färber <afaerber@suse.de> wrote:
>> Am 15.05.2015 um 08:36 schrieb Alistair Francis:
>>> On Fri, May 15, 2015 at 4:32 PM, Peter Crosthwaite
>>> <peter.crosthwaite@xilinx.com> wrote:
>>>> On Thu, May 14, 2015 at 10:56 PM, Alistair Francis
>>>> <alistair.francis@xilinx.com> wrote:
>>>>> On Fri, May 15, 2015 at 3:52 PM, Peter Crosthwaite
>>>>> <peter.crosthwaite@xilinx.com> wrote:
>>>>>> On Thu, May 14, 2015 at 10:48 PM, Alistair Francis
>>>>>> <alistair.francis@xilinx.com> wrote:
>>>>>>> On Fri, May 15, 2015 at 3:22 PM, Peter Crosthwaite
>>>>>>> <peter.crosthwaite@xilinx.com> wrote:
>>>>>>>> On Wed, May 13, 2015 at 11:08 PM, Alistair Francis
>>>>>>>> <alistair.francis@xilinx.com> wrote:
>>>>>>>>>                          | PVR2_FPU_EXC_MASK \
>>>>>>>>>                          | 0;
>>>>>>>>> +
>>>>>>>>> +    if (cpu->cfg.usefpu) {
>>>>>>>>> +        env->pvr.regs[0] |= PVR0_USE_FPU_MASK;
>>>>>>>>> +        env->pvr.regs[2] |= PVR2_USE_FPU_MASK;
>>>>>>>>> +
>>>>>>>>> +        if (cpu->cfg.usefpu > 1) {
>>>>>>>>> +            env->pvr.regs[2] |= PVR2_USE_FPU2_MASK;
>>>>>>>>> +        }
>>>>>>>>> +    }
>>>>>>>>
>>>>>>>> This should be handled at realize time. See pl330_realize for example
>>>>>>>> of realize-time PVR ("cfg" in that case) population.
>>>>>>>
>>>>>>> But the env state gets wiped out at reset, so the information will be lost.
>>>>>>
>>>>>> Ahh, so the solution there is to do what ARM does and have a section
>>>>>> at the back of the env which survives reset. Check the memset in
>>>>>> arm_cpu_reset.
>>>>>
>>>>> Ok, just to clarify we want all of the pvr registers to be preserved on reset?
>>>>
>>>> yes. But something that just occured to me, does it make sense to move
>>>> it outside the env? into the CPUState? Andreas mentioned that fields
>>>> in the CPU state before the env can be used with negative env* offsets
>>>> by translated code. This means the PVR could just be pushed up to
>>>> CPUState.
>>>
>>> Do any other machines do that?
>>>
>>> I'm happy with leaving it in the env (partly because I just did it)
>>> and it also matches the way that ARM does it.
>>
>> All targets had everything in env originally, so that's not really an
>> argument for anything. You need to decide what makes sense for your
>> target - icount is an example using negative offsets in CPUState now,
>> whereas TCGv* variables declared via offset from env remained in env.
> 
> I think env makes sense in this case, especially as the
> DEFINE_PROP_UINT8() macro defaults to setting variables in the env
> structure. Admittedly I haven't looked into it, so it might be just as
> easy to set variables in the MicroBlazeCPU.

In fact the CPU properties operate on MicroBlazeCPU. The legacy
properties thus need an explicit env.foo as macro argument.

But as usual things can be done in multiple steps.

Andreas

> I have another patch set ready to send out tomorrow with all of the
> variables in env. We can decide from there if they should be moved to
> the MicroBlazeCPU struct.
> 
> Thanks,
> 
> Alistair

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)

  reply	other threads:[~2015-05-17 15:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  6:08 [Qemu-devel] [RFC v1 0/3] Add Microblaze configuration options Alistair Francis
2015-05-14  6:08 ` [Qemu-devel] [RFC v1 1/3] target-microblaze: Fix up indentation Alistair Francis
2015-05-14  6:08 ` [Qemu-devel] [RFC v1 2/3] target-microblaze: Allow the stack protection to be disabled Alistair Francis
2015-05-14 18:36   ` Richard Henderson
2015-05-14 22:53     ` Alistair Francis
2015-05-15  5:26   ` Peter Crosthwaite
2015-05-15  6:51     ` Alistair Francis
2015-05-14  6:08 ` [Qemu-devel] [RFC v1 3/3] target-microblaze: Convert use-fpu to a CPU property Alistair Francis
2015-05-15  5:22   ` Peter Crosthwaite
2015-05-15  5:48     ` Alistair Francis
2015-05-15  5:52       ` Peter Crosthwaite
2015-05-15  5:56         ` Alistair Francis
2015-05-15  6:32           ` Peter Crosthwaite
2015-05-15  6:36             ` Alistair Francis
2015-05-15  6:41               ` Peter Crosthwaite
2015-05-15 11:15               ` Andreas Färber
2015-05-17 12:26                 ` Alistair Francis
2015-05-17 15:12                   ` Andreas Färber [this message]
2015-05-18  1:10                     ` Alistair Francis

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=5558AFF1.6080206@suse.de \
    --to=afaerber@suse.de \
    --cc=alistair.francis@xilinx.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@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).