Re: ARM pcpu changes, was Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-03-01 Thread Olivier Houchard
On Fri, Mar 01, 2013 at 02:20:16PM +0100, Svatopluk Kraus wrote: > On Tue, Feb 26, 2013 at 1:39 PM, Konstantin Belousov > wrote: > > On Tue, Feb 26, 2013 at 09:06:51PM +1300, Andrew Turner wrote: > >> Does anyone know if it is only curthread that needs to be atomic? If so > >> this should work. Re

Re: ARM pcpu changes, was Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-03-01 Thread Svatopluk Kraus
On Tue, Feb 26, 2013 at 1:39 PM, Konstantin Belousov wrote: > On Tue, Feb 26, 2013 at 09:06:51PM +1300, Andrew Turner wrote: >> Does anyone know if it is only curthread that needs to be atomic? If so >> this should work. Reading the cpuid from the system currently is a >> single instruction, howev

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-26 Thread Olivier Houchard
On Mon, Feb 25, 2013 at 04:26:14PM -0500, John Baldwin wrote: > On Monday, February 25, 2013 7:47:47 am Olivier Houchard wrote: > > On Mon, Feb 25, 2013 at 07:09:20PM +1300, Andrew Turner wrote: > > > On Thu, 21 Feb 2013 10:43:49 -0500 > > > John Baldwin wrote: > > > > > > > On Thursday, February

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-26 Thread John Baldwin
On Monday, February 25, 2013 7:47:47 am Olivier Houchard wrote: > On Mon, Feb 25, 2013 at 07:09:20PM +1300, Andrew Turner wrote: > > On Thu, 21 Feb 2013 10:43:49 -0500 > > John Baldwin wrote: > > > > > On Thursday, February 21, 2013 7:53:52 am Svatopluk Kraus wrote: > > > > On Wed, Feb 20, 2013 a

Re: ARM pcpu changes, was Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-26 Thread Konstantin Belousov
On Tue, Feb 26, 2013 at 09:06:51PM +1300, Andrew Turner wrote: > Does anyone know if it is only curthread that needs to be atomic? If so > this should work. Reading the cpuid from the system currently is a > single instruction, however it appears the code will need to be reworked > for use with mul

ARM pcpu changes, was Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-26 Thread Andrew Turner
On Mon, 25 Feb 2013 13:47:47 +0100 Olivier Houchard wrote: > On Mon, Feb 25, 2013 at 07:09:20PM +1300, Andrew Turner wrote: > > On Thu, 21 Feb 2013 10:43:49 -0500 > > John Baldwin wrote: > > > > > On Thursday, February 21, 2013 7:53:52 am Svatopluk Kraus wrote: > > > > On Wed, Feb 20, 2013 at 4

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-25 Thread Olivier Houchard
On Mon, Feb 25, 2013 at 07:09:20PM +1300, Andrew Turner wrote: > On Thu, 21 Feb 2013 10:43:49 -0500 > John Baldwin wrote: > > > On Thursday, February 21, 2013 7:53:52 am Svatopluk Kraus wrote: > > > On Wed, Feb 20, 2013 at 4:22 PM, John Baldwin > > > wrote: > > > > On Wednesday, February 20, 201

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-24 Thread Andrew Turner
On Thu, 21 Feb 2013 10:43:49 -0500 John Baldwin wrote: > On Thursday, February 21, 2013 7:53:52 am Svatopluk Kraus wrote: > > On Wed, Feb 20, 2013 at 4:22 PM, John Baldwin > > wrote: > > > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > > >> On Tue, Feb 19, 2013 at 7:51 PM, K

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-21 Thread Svatopluk Kraus
On Thu, Feb 21, 2013 at 4:43 PM, John Baldwin wrote: >> > curthread is a bit magic. :) If you perform a context switch during an >> > interrupt (which will change 'curthread') you also change your register >> > state. >> > When you resume, the register state is also restored. This means that >

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-21 Thread John Baldwin
On Thursday, February 21, 2013 7:53:52 am Svatopluk Kraus wrote: > On Wed, Feb 20, 2013 at 4:22 PM, John Baldwin wrote: > > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > >> On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov > >> wrote: > >> > On Mon, Feb 18, 2013 at 11:18:

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-21 Thread Svatopluk Kraus
On Wed, Feb 20, 2013 at 4:22 PM, John Baldwin wrote: > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: >> On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov >> wrote: >> > On Mon, Feb 18, 2013 at 11:18:16PM +0100, Svatopluk Kraus wrote: >> >> On Mon, Feb 18, 2013 at 9:36 PM, K

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-20 Thread Ian Lepore
On Wed, 2013-02-20 at 14:32 -0500, John Baldwin wrote: > On Wednesday, February 20, 2013 2:27:39 pm Konstantin Belousov wrote: > > On Wed, Feb 20, 2013 at 10:22:29AM -0500, John Baldwin wrote: > > > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > > > > On Tue, Feb 19, 2013 at 7:

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-20 Thread John Baldwin
On Wednesday, February 20, 2013 2:27:39 pm Konstantin Belousov wrote: > On Wed, Feb 20, 2013 at 10:22:29AM -0500, John Baldwin wrote: > > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > > > On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov > > > wrote: > > > > On Mon, Feb 18

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-20 Thread Konstantin Belousov
On Wed, Feb 20, 2013 at 10:22:29AM -0500, John Baldwin wrote: > On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > > On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov > > wrote: > > > On Mon, Feb 18, 2013 at 11:18:16PM +0100, Svatopluk Kraus wrote: > > >> On Mon, Feb 18, 2013 a

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-20 Thread John Baldwin
On Wednesday, February 20, 2013 7:31:08 am Svatopluk Kraus wrote: > On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov > wrote: > > On Mon, Feb 18, 2013 at 11:18:16PM +0100, Svatopluk Kraus wrote: > >> On Mon, Feb 18, 2013 at 9:36 PM, Konstantin Belousov > >> wrote: > >> Well, I'm taking a part

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-20 Thread Svatopluk Kraus
On Tue, Feb 19, 2013 at 7:51 PM, Konstantin Belousov wrote: > On Mon, Feb 18, 2013 at 11:18:16PM +0100, Svatopluk Kraus wrote: >> On Mon, Feb 18, 2013 at 9:36 PM, Konstantin Belousov >> wrote: >> Well, I'm taking a part on porting FreeBSD to ARM11mpcore. UP case was >> simple. SMP case is more co

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-19 Thread Konstantin Belousov
On Mon, Feb 18, 2013 at 11:18:16PM +0100, Svatopluk Kraus wrote: > On Mon, Feb 18, 2013 at 9:36 PM, Konstantin Belousov > wrote: > Well, I'm taking a part on porting FreeBSD to ARM11mpcore. UP case was > simple. SMP case is more complex and rather new for me. Recently, I > was solving a problem wi

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Svatopluk Kraus
On Mon, Feb 18, 2013 at 9:36 PM, Konstantin Belousov wrote: > On Mon, Feb 18, 2013 at 09:27:40PM +0100, Svatopluk Kraus wrote: >> On Mon, Feb 18, 2013 at 6:09 PM, Konstantin Belousov >> wrote: >> > On Mon, Feb 18, 2013 at 06:06:42PM +0100, Svatopluk Kraus wrote: >> >> On Mon, Feb 18, 2013 at 4:08

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Konstantin Belousov
On Mon, Feb 18, 2013 at 09:27:40PM +0100, Svatopluk Kraus wrote: > On Mon, Feb 18, 2013 at 6:09 PM, Konstantin Belousov > wrote: > > On Mon, Feb 18, 2013 at 06:06:42PM +0100, Svatopluk Kraus wrote: > >> On Mon, Feb 18, 2013 at 4:08 PM, Konstantin Belousov > >> wrote: > >> > On Mon, Feb 18, 2013 a

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Svatopluk Kraus
On Mon, Feb 18, 2013 at 6:09 PM, Konstantin Belousov wrote: > On Mon, Feb 18, 2013 at 06:06:42PM +0100, Svatopluk Kraus wrote: >> On Mon, Feb 18, 2013 at 4:08 PM, Konstantin Belousov >> wrote: >> > On Mon, Feb 18, 2013 at 01:44:35PM +0100, Svatopluk Kraus wrote: >> >> Hi, >> >> >> >>the acces

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Svatopluk Kraus
On Mon, Feb 18, 2013 at 4:08 PM, Konstantin Belousov wrote: > On Mon, Feb 18, 2013 at 01:44:35PM +0100, Svatopluk Kraus wrote: >> Hi, >> >>the access to sysmaps_pcpu[] should be atomic with respect to >> thread migration. Otherwise, a sysmaps for one CPU can be stolen by >> another CPU and the

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Konstantin Belousov
On Mon, Feb 18, 2013 at 06:06:42PM +0100, Svatopluk Kraus wrote: > On Mon, Feb 18, 2013 at 4:08 PM, Konstantin Belousov > wrote: > > On Mon, Feb 18, 2013 at 01:44:35PM +0100, Svatopluk Kraus wrote: > >> Hi, > >> > >>the access to sysmaps_pcpu[] should be atomic with respect to > >> thread migr

Re: [patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Konstantin Belousov
On Mon, Feb 18, 2013 at 01:44:35PM +0100, Svatopluk Kraus wrote: > Hi, > >the access to sysmaps_pcpu[] should be atomic with respect to > thread migration. Otherwise, a sysmaps for one CPU can be stolen by > another CPU and the purpose of per CPU sysmaps is broken. A patch is > enclosed. And,

[patch] i386 pmap sysmaps_pcpu[] atomic access

2013-02-18 Thread Svatopluk Kraus
Hi, the access to sysmaps_pcpu[] should be atomic with respect to thread migration. Otherwise, a sysmaps for one CPU can be stolen by another CPU and the purpose of per CPU sysmaps is broken. A patch is enclosed. Svata Index: sys/i386/i386/pmap.c =