All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Peter Crosthwaite" <crosthwaitepeter@gmail.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/4] microblaze: boot: Use cpu_set_pc
Date: Tue, 16 Jun 2015 08:38:14 -0700	[thread overview]
Message-ID: <CAEgOgz5qXoztZ+_yXh3W3JtM=UnaWX=Uz3gF4mHyZx1ZOxEo6Q@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_Nq4ABfQAbXpW-weqjxLVW3PqMmb6UCaAEcR1Pag7TeQ@mail.gmail.com>

On Tue, Jun 16, 2015 at 4:33 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 16 June 2015 at 06:46, Peter Crosthwaite <crosthwaitepeter@gmail.com> wrote:
>> Use cpu_set_pc for setting program counters when bootloading. This
>> removes an instance of system level code having to reach into the CPU
>> env.
>>
>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>> ---
>>  hw/microblaze/boot.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
>> index 4c44317..ec68479 100644
>> --- a/hw/microblaze/boot.c
>> +++ b/hw/microblaze/boot.c
>> @@ -54,7 +54,7 @@ static void main_cpu_reset(void *opaque)
>>      env->regs[5] = boot_info.cmdline;
>>      env->regs[6] = boot_info.initrd_start;
>>      env->regs[7] = boot_info.fdt;
>> -    env->sregs[SR_PC] = boot_info.bootstrap_pc;
>> +    cpu_set_pc(CPU(cpu), boot_info.bootstrap_pc, &error_abort);
>
> Well, it sort of removes an instance of reaching into the CPU
> env, but there's all those other ones in plain sight just above.
> Is there much point in setting SR_PC indirectly if we don't
> have a mechanism for setting the other regs indirectly?
>

Yes. Needs more patches :). I'm starting with the easy stuff, and I am
actually more interested in getting rid of the SR_PC macro usage at
this stage. ARMs solution to this is the machine code bootloader. That
would be one way. But what I want to propose was that we add a virtual
method to CPUs that sets these offsets that bootloaders can call. This
brings us closer to one bootloader that can do it all.

Regards,
Peter

> -- PMM
>

  reply	other threads:[~2015-06-16 15:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  5:46 [Qemu-devel] [PATCH v2 0/4] qom-cpu: Wrap set_pc hook and use in bootloaders Peter Crosthwaite
2015-06-16  5:46 ` [Qemu-devel] [PATCH v2 1/4] qom: cpu: Add wrapper to the set-pc hook Peter Crosthwaite
2015-06-16 11:29   ` Peter Maydell
2015-06-22 17:27   ` Andreas Färber
2015-06-16  5:46 ` [Qemu-devel] [PATCH v2 2/4] gdbstub: Use cpu_set_pc helper Peter Crosthwaite
2015-06-22 17:31   ` Andreas Färber
2015-06-24  2:50     ` Peter Crosthwaite
2015-06-24 10:01       ` Peter Maydell
2015-06-24 17:04         ` Peter Crosthwaite
2015-06-24 17:16           ` Andreas Färber
2015-06-24 17:28             ` Peter Crosthwaite
2015-06-24 19:09             ` Peter Maydell
2015-06-16  5:46 ` [Qemu-devel] [PATCH v2 3/4] arm: boot: Use cpu_set_pc Peter Crosthwaite
2015-06-16 11:32   ` Peter Maydell
2015-06-22 17:33     ` Andreas Färber
2015-06-16  5:46 ` [Qemu-devel] [PATCH v2 4/4] microblaze: " Peter Crosthwaite
2015-06-16 11:33   ` Peter Maydell
2015-06-16 15:38     ` Peter Crosthwaite [this message]
2015-06-22 17:36   ` 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='CAEgOgz5qXoztZ+_yXh3W3JtM=UnaWX=Uz3gF4mHyZx1ZOxEo6Q@mail.gmail.com' \
    --to=peter.crosthwaite@xilinx.com \
    --cc=afaerber@suse.de \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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 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.