Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-09 Thread Richard Earnshaw
On 09/03/12 16:20, Nicolas Pitre wrote: > On Fri, 9 Mar 2012, Dave Martin wrote: > >> Register variables feel like a red herring though. We're only using >> those because we can't do the needful thing and actually desscribe >> these constraints in the asm constraints (which would seem to be the >>

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-09 Thread Nicolas Pitre
On Fri, 9 Mar 2012, Dave Martin wrote: > Register variables feel like a red herring though. We're only using > those because we can't do the needful thing and actually desscribe > these constraints in the asm constraints (which would seem to be the > right place). We specifically don't care wher

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-09 Thread Dave Martin
On Thu, Mar 8, 2012 at 6:47 PM, Richard Earnshaw wrote: > On 08/03/12 17:21, Nicolas Pitre wrote: >> On Thu, 8 Mar 2012, Richard Earnshaw wrote: >> >>> On 02/03/12 21:15, Nicolas Pitre wrote: So, to me, the gcc documentation is perfectly clear on this topic. there really _is_ a guarantee

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-08 Thread Richard Earnshaw
On 08/03/12 17:21, Nicolas Pitre wrote: > On Thu, 8 Mar 2012, Richard Earnshaw wrote: > >> On 02/03/12 21:15, Nicolas Pitre wrote: >>> So, to me, the gcc documentation is perfectly clear on this topic. >>> there really _is_ a guarantee that those asm marked variables will be in >>> the expected reg

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-08 Thread Nicolas Pitre
On Thu, 8 Mar 2012, Richard Earnshaw wrote: > On 02/03/12 21:15, Nicolas Pitre wrote: > > So, to me, the gcc documentation is perfectly clear on this topic. > > there really _is_ a guarantee that those asm marked variables will be in > > the expected registers on entry to the inline asm, given tha

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-08 Thread Dave Martin
On Thu, Mar 08, 2012 at 09:58:23AM +, Richard Earnshaw wrote: > On 02/03/12 21:15, Nicolas Pitre wrote: > > [ coming back from vacation and trying to catch up ] > > > > On Wed, 29 Feb 2012, Dave Martin wrote: > > > >> Just had a chat with some tools guys -- apparently, when passing register > >

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-08 Thread Richard Earnshaw
On 02/03/12 21:15, Nicolas Pitre wrote: > [ coming back from vacation and trying to catch up ] > > On Wed, 29 Feb 2012, Dave Martin wrote: > >> Just had a chat with some tools guys -- apparently, when passing register >> arguments to gcc inline asms there really isn't a guarantee that those >> vari

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-02 Thread Nicolas Pitre
On Wed, 29 Feb 2012, Ian Campbell wrote: > On Wed, 2012-02-29 at 12:58 +, Dave Martin wrote: > > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote:

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-02 Thread Nicolas Pitre
[ coming back from vacation and trying to catch up ] On Wed, 29 Feb 2012, Dave Martin wrote: > Just had a chat with some tools guys -- apparently, when passing register > arguments to gcc inline asms there really isn't a guarantee that those > variables will be in the expected registers on entry

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Stefano Stabellini
On Thu, 1 Mar 2012, Russell King - ARM Linux wrote: > On Thu, Mar 01, 2012 at 10:27:02AM +, Dave Martin wrote: > > So, where there's a compelling reason to inline these things, we can use > > the existing techniques if we're alert to the risks. But in cases where > > there isn't a compelling r

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Russell King - ARM Linux
On Thu, Mar 01, 2012 at 10:27:02AM +, Dave Martin wrote: > So, where there's a compelling reason to inline these things, we can use > the existing techniques if we're alert to the risks. But in cases where > there isn't a compelling reason, aren't we just inviting fragility > unnecessarily? T

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Dave Martin
On Thu, Mar 01, 2012 at 10:10:29AM +, Russell King - ARM Linux wrote: > On Wed, Feb 29, 2012 at 12:58:26PM +, Dave Martin wrote: > > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > > On Tue, Feb 28, 2012 at 12:2

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Russell King - ARM Linux
On Wed, Feb 29, 2012 at 02:44:24PM +, Ian Campbell wrote: > > If you need a specific register, this means that you must set up that > > register explicitly inside the asm if you want a guarantee that the > > code will work: > > > > asm volatile ( > > "movw r12, %[hvc_num]\n\t

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Russell King - ARM Linux
On Wed, Feb 29, 2012 at 12:58:26PM +, Dave Martin wrote: > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > > > > > I don't have a very strong op

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Dave Martin
On Wed, Feb 29, 2012 at 02:52:38PM +, Stefano Stabellini wrote: > On Wed, 29 Feb 2012, Dave Martin wrote: > > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabe

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-03-01 Thread Dave Martin
On Wed, Feb 29, 2012 at 02:44:24PM +, Ian Campbell wrote: > On Wed, 2012-02-29 at 12:58 +, Dave Martin wrote: > > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefa

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Ian Campbell
On Wed, 2012-02-29 at 12:58 +, Dave Martin wrote: > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > > > > > I don't have a very strong opinion o

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Ian Campbell
On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > I don't have a very strong opinion on which register we should use, but > > I would like to avoid r7 if it is already actively used by gcc. > > But there is no framepoin

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Stefano Stabellini
On Wed, 29 Feb 2012, Dave Martin wrote: > On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > > > > > I don't have a very strong opinion on which regist

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Dave Martin
On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > > > I don't have a very strong opinion on which register we should use, but > > > I would like to avoid

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Dave Martin
On Wed, Feb 29, 2012 at 09:56:02AM +, Ian Campbell wrote: > On Wed, 2012-02-29 at 09:34 +, Dave Martin wrote: > > On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > > > > I don't have a very strong opinion on which register we should use, but > > > I would like to avoid

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-29 Thread Dave Martin
On Tue, Feb 28, 2012 at 12:28:29PM +, Stefano Stabellini wrote: > On Tue, 28 Feb 2012, Ian Campbell wrote: > > On Tue, 2012-02-28 at 10:20 +, Dave Martin wrote: > > > On Mon, Feb 27, 2012 at 07:33:39PM +, Ian Campbell wrote: > > > > On Mon, 2012-02-27 at 18:03 +, Dave Martin wrote:

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Stefano Stabellini
On Tue, 28 Feb 2012, Ian Campbell wrote: > On Tue, 2012-02-28 at 10:20 +, Dave Martin wrote: > > On Mon, Feb 27, 2012 at 07:33:39PM +, Ian Campbell wrote: > > > On Mon, 2012-02-27 at 18:03 +, Dave Martin wrote: > > > > > Since we support only ARMv7+ there are "T2" and "T3" encodings >

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Stefano Stabellini
On Tue, 28 Feb 2012, Dave Martin wrote: > > Given that Stefano is proposing to make the ISS a (per-hypervisor) > > constant we could consider just defining the Thumb and non-Thumb > > constants instead of doing all the construction with the __HVC_IMM stuff > > -- that would remove a big bit of the

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Ian Campbell
On Mon, 2012-02-27 at 21:05 +, Peter Maydell wrote: > On 27 February 2012 16:27, Ian Campbell wrote: > > R12 is not accessible from the 16 bit "T1" Thumb encoding of mov > > immediate (which can only target r0..r7). > > > > Since we support only ARMv7+ there are "T2" and "T3" encodings availab

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Ian Campbell
On Tue, 2012-02-28 at 10:20 +, Dave Martin wrote: > On Mon, Feb 27, 2012 at 07:33:39PM +, Ian Campbell wrote: > > On Mon, 2012-02-27 at 18:03 +, Dave Martin wrote: > > > > Since we support only ARMv7+ there are "T2" and "T3" encodings available > > > > which do allow direct mov of an im

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Ian Campbell
On Tue, 2012-02-28 at 09:46 +, Dave Martin wrote: > On Mon, Feb 27, 2012 at 07:48:45PM +, Ian Campbell wrote: > > Given that Stefano is proposing to make the ISS a (per-hypervisor) > > constant we could consider just defining the Thumb and non-Thumb > > constants instead of doing all the co

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Dave Martin
On Mon, Feb 27, 2012 at 07:33:39PM +, Ian Campbell wrote: > On Mon, 2012-02-27 at 18:03 +, Dave Martin wrote: > > On Mon, Feb 27, 2012 at 04:27:23PM +, Ian Campbell wrote: > > > On Thu, 2012-02-23 at 17:48 +, Stefano Stabellini wrote: > > > > We need a register to pass the hypercall

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-28 Thread Dave Martin
On Mon, Feb 27, 2012 at 07:48:45PM +, Ian Campbell wrote: > On Mon, 2012-02-27 at 17:53 +, Dave Martin wrote: > > On Thu, Feb 23, 2012 at 05:48:22PM +, Stefano Stabellini wrote: > > > We need a register to pass the hypercall number because we might not > > > know it at compile time and

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Peter Maydell
On 27 February 2012 16:27, Ian Campbell wrote: > R12 is not accessible from the 16 bit "T1" Thumb encoding of mov > immediate (which can only target r0..r7). > > Since we support only ARMv7+ there are "T2" and "T3" encodings available > which do allow direct mov of an immediate into R12, but are 3

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Ian Campbell
On Mon, 2012-02-27 at 18:03 +, Dave Martin wrote: > On Mon, Feb 27, 2012 at 04:27:23PM +, Ian Campbell wrote: > > On Thu, 2012-02-23 at 17:48 +, Stefano Stabellini wrote: > > > We need a register to pass the hypercall number because we might not > > > know it at compile time and HVC onl

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Ian Campbell
On Mon, 2012-02-27 at 17:53 +, Dave Martin wrote: > On Thu, Feb 23, 2012 at 05:48:22PM +, Stefano Stabellini wrote: > > We need a register to pass the hypercall number because we might not > > know it at compile time and HVC only takes an immediate argument. > > > > Among the available reg

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Dave Martin
On Mon, Feb 27, 2012 at 04:27:23PM +, Ian Campbell wrote: > On Thu, 2012-02-23 at 17:48 +, Stefano Stabellini wrote: > > We need a register to pass the hypercall number because we might not > > know it at compile time and HVC only takes an immediate argument. > > > > Among the available re

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Dave Martin
On Thu, Feb 23, 2012 at 05:48:22PM +, Stefano Stabellini wrote: > We need a register to pass the hypercall number because we might not > know it at compile time and HVC only takes an immediate argument. > > Among the available registers r12 seems to be the best choice because it > is defined a

Re: [PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-27 Thread Ian Campbell
On Thu, 2012-02-23 at 17:48 +, Stefano Stabellini wrote: > We need a register to pass the hypercall number because we might not > know it at compile time and HVC only takes an immediate argument. > > Among the available registers r12 seems to be the best choice because it > is defined as "intr

[PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

2012-02-23 Thread Stefano Stabellini
We need a register to pass the hypercall number because we might not know it at compile time and HVC only takes an immediate argument. Among the available registers r12 seems to be the best choice because it is defined as "intra-procedure call scratch register". Use the ISS to pass an hypervisor