xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Tim (Xen.org)" <tim@xen.org>
Subject: Re: [PATCH 5/7] xen/arm: wake up secondary cpus
Date: Fri, 26 Oct 2012 08:30:18 +0100	[thread overview]
Message-ID: <1351236618.8558.4.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.02.1210251303130.2689@kaball.uk.xensource.com>

On Thu, 2012-10-25 at 18:45 +0100, Stefano Stabellini wrote:
> > >  
> > >  boot_cpu:
> > > @@ -98,6 +98,10 @@ boot_cpu:
> > >  	PRINT(" booting -\r\n")
> > >  #endif
> > >  
> > > +	/* Wake up secondary cpus */
> > > +	teq   r12, #0
> > > +	bleq  kick_cpus
> > 
> > Does this have to be done this early? Couldn't we defer it to C land
> > where it would be easier to isolate the processor/platform specific
> > behaviour?
> 
> Yes, it does because we need to send an interrupt to cpus running in
> secure mode, so this has to happen before we drop off secure state and we
> enter hypervisor state.

Hrm, so maybe this stuff does belong in mode_switch.S after all?

Or is there perhaps some register (e.g. in the GIC?) which would allow
non-secure hyp mode to sent an event to a processor in secure monitor
mode? Or are secondary CPUs actually spinning in secure supervisor mode?

I guess this works in Linux because the boot CPU is in *secure* kernel
mode and that is allowed to send events to other secure modes? That's a
further argument that this is related to the firmware not bringing us up
in Hyp / NS mode and therefore that the fix should be in mode_switch.S.

> > >  	/* Check that this CPU has Hyp mode */
> > >  	mrc   CP32(r0, ID_PFR1)
> > >  	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
> > > diff --git a/xen/arch/arm/mode_switch.S b/xen/arch/arm/mode_switch.S
> > > index 83a682b..39d80e8 100644
> > > --- a/xen/arch/arm/mode_switch.S
> > > +++ b/xen/arch/arm/mode_switch.S
> > > @@ -21,6 +21,37 @@
> > >  #include <asm/page.h>
> > >  #include <asm/asm_defns.h>
> > >  
> > > +/* XXX: Versatile Express specific code */
> > > +/* wake up secondary cpus */
> > > +.globl kick_cpus
> > > +kick_cpus:
> > 
> > My understanding was the mode_switch.S was intended to be a place to
> > hold the hacks and fixups required because there is no firmware on the
> > models and/or to address short comings in the firmware. This kick
> > function is a normal/expected part of booting on a vexpress so I don't
> > think it especially belongs here.
> 
> I have created a processor.S file for processor specific initializations
> (see ACTLR), maybe I can move it there.

proc-ca15.S perhaps? So we can add proc-exynos.S etc in the future?

Ian

  reply	other threads:[~2012-10-26  7:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 15:03 [PATCH 0/7] xen/arm: run on real hardware Stefano Stabellini
2012-10-24 15:03 ` [PATCH 1/7] xen/arm: fix rank calculation in vgic_vcpu_inject_irq Stefano Stabellini
2012-10-25  9:27   ` Ian Campbell
2012-10-26 16:33     ` Stefano Stabellini
2012-10-26 16:40       ` Ian Campbell
2012-10-26 18:42         ` Stefano Stabellini
2012-10-26 20:47           ` Ian Campbell
2012-10-27 10:09             ` Tim Deegan
2012-10-27 10:44               ` Ian Campbell
2012-11-13 11:57               ` Stefano Stabellini
2012-11-13 12:00                 ` Ian Campbell
2012-11-13 12:23                   ` Stefano Stabellini
2012-10-24 15:03 ` [PATCH 2/7] xen/arm: setup the fixmap in head.S Stefano Stabellini
2012-10-24 15:27   ` Tim Deegan
2012-10-24 15:37     ` Stefano Stabellini
2012-10-25  9:33   ` Ian Campbell
2012-10-25 11:00     ` Stefano Stabellini
2012-10-24 15:03 ` [PATCH 3/7] pl011: set baud and clock_hz to the right defaults for Versatile Express Stefano Stabellini
2012-10-25  9:37   ` Ian Campbell
2012-10-25 10:57     ` Stefano Stabellini
2012-10-25 11:00       ` Ian Campbell
2012-10-24 15:03 ` [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR register Stefano Stabellini
2012-10-25  9:52   ` Ian Campbell
2012-10-25 11:57     ` Stefano Stabellini
2012-10-25 12:04       ` Ian Campbell
2012-10-26  8:56         ` Tim Deegan
2012-10-26  8:59           ` Ian Campbell
2012-10-24 15:03 ` [PATCH 5/7] xen/arm: wake up secondary cpus Stefano Stabellini
2012-10-24 15:38   ` Tim Deegan
2012-10-24 15:59     ` Stefano Stabellini
2012-10-24 16:05       ` Tim Deegan
2012-10-25  9:59   ` Ian Campbell
2012-10-25 17:45     ` Stefano Stabellini
2012-10-26  7:30       ` Ian Campbell [this message]
2012-10-26 11:18         ` Stefano Stabellini
2012-10-26 12:16           ` Ian Campbell
2012-10-26 15:24             ` Stefano Stabellini
2012-10-26 15:32               ` Ian Campbell
2012-10-24 15:03 ` [PATCH 6/7] xen/arm: flush D-cache and I-cache when appropriate Stefano Stabellini
2012-10-24 15:59   ` Tim Deegan
2012-10-24 16:05     ` Ian Campbell
2012-10-24 16:17       ` Tim Deegan
2012-10-24 17:35     ` Stefano Stabellini
2012-10-26  9:01       ` Tim Deegan
2012-10-26 15:53         ` Stefano Stabellini
2012-10-26 15:55           ` Stefano Stabellini
2012-10-26 16:03             ` Stefano Stabellini
2012-10-26 16:55               ` Tim Deegan
2012-10-26 18:40                 ` Stefano Stabellini
2012-10-27 10:44                   ` Tim Deegan
2012-10-27 11:54                     ` Tim Deegan
2012-10-29  9:53                       ` Stefano Stabellini
2012-10-29  9:52                     ` Stefano Stabellini
2012-11-13 12:01                     ` Stefano Stabellini
2012-11-13 12:15                       ` Tim Deegan
2012-10-26 16:45           ` Tim Deegan
2012-10-24 15:03 ` [PATCH 7/7] xen/arm: get the number of cpus from device tree Stefano Stabellini
2012-10-25 10:02   ` Ian Campbell
2012-10-24 16:02 ` [PATCH 0/7] xen/arm: run on real hardware Tim Deegan
  -- strict thread matches above, loose matches on Subject: below --
2012-11-13 15:40 [PATCH v2 " Stefano Stabellini
2012-11-13 15:42 ` [PATCH 5/7] xen/arm: wake up secondary cpus Stefano Stabellini
2012-11-15 10:28   ` Ian Campbell

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=1351236618.8558.4.camel@dagon.hellion.org.uk \
    --to=ian.campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xensource.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).