Imre Deak | 6 Aug 11:55 2008

[PATCH] ARM: VIPT cache coherency fix

Currently page loaning (at least) is broken on ARM VIPT platforms.
The reason is that possible dirty cache lines are not taken into account
at the moment, following is a fix for this.

The fix is validated against the latest breakage related to the socket
page loaning reported earlier on the list.

--Imre

diff --git a/sys/arch/arm/arm32/pmap.c b/sys/arch/arm/arm32/pmap.c
index 2b62477..3ed914d 100644
--- a/sys/arch/arm/arm32/pmap.c
+++ b/sys/arch/arm/arm32/pmap.c
 <at>  <at>  -877,6 +877,7  <at>  <at>  pmap_enter_pv(struct vm_page *pg, struct pv_entry *pve, pmap_t pm,
 		pg->mdpage.uro_mappings++;

 #ifdef PMAP_CACHE_VIPT
+	pmap_vac_me_harder(pg, pm, va);
 	/*
 	 * If this is an exec mapping and its the first exec mapping
 	 * for this page, make sure to sync the I-cache.
 <at>  <at>  -1833,6 +1834,7  <at>  <at>  pmap_vac_me_harder(struct vm_page *pg, pmap_t pm, vaddr_t va)
 	/* Already a conflict? */
 	if (__predict_false(pg->mdpage.pvh_attrs & PVF_NC)) {
 		/* just an add, things are already non-cached */
+		KASSERT(!(pg->mdpage.pvh_attrs & PVF_DIRTY));
 		bad_alias = false;
 		if (va) {
 			PMAPCOUNT(vac_color_none);
 <at>  <at>  -1849,17 +1851,21  <at>  <at>  pmap_vac_me_harder(struct vm_page *pg, pmap_t pm, vaddr_t va)
(Continue reading)

Matt Thomas | 7 Aug 00:48 2008

Re: [PATCH] ARM: VIPT cache coherency fix


On Aug 6, 2008, at 2:55 AM, Imre Deak wrote:

> Currently page loaning (at least) is broken on ARM VIPT platforms.
> The reason is that possible dirty cache lines are not taken into  
> account
> at the moment, following is a fix for this.
>
> The fix is validated against the latest breakage related to the socket
> page loaning reported earlier on the list.

This is close to what I checked in but actually has a few missing corner
cases.  The version I checked works for the always failing
scp sdp:/lib/libc.so .

Adding KASSERT's for PVF_DIRTY helped me track down the last bug in  
my code.

Matt Thomas | 7 Aug 06:01 2008

Re: [PATCH 1/8] OMAP2: enable fast soft interrupts


On Jun 27, 2008, at 10:53 AM, Imre Deak wrote:

> diff --git a/sys/arch/arm/omap/files.omap2 b/sys/arch/arm/omap/ 
> files.omap2
> index 03ecae7..4314bec 100644
> --- a/sys/arch/arm/omap/files.omap2
> +++ b/sys/arch/arm/omap/files.omap2
>  <at>  <at>  -4,6 +4,8  <at>  <at> 
>  # Based on xscale/files.pxa2x0
>  #
>
> +options __HAVE_FAST_SOFTINTS
> +
>  include "arch/arm/pic/files.pic"
>
>  file	arch/arm/arm32/irq_dispatch.S
> -- 
>

This has been enable in std.tisdpxx (the correct place).

Matt Thomas | 7 Aug 06:02 2008

Re: [PATCH 3/8] Reworked: ARM: fix interrupt depth counting softint breakage


On Jun 27, 2008, at 11:08 AM, Imre Deak wrote:

>
> From: Andy Shevchenko <andy.shevchenko <at> teleca.com>
>
> The fast soft interrupt handler should be executed when interrupt  
> depth
> is equal to 0. So, we need to revert back the depth value before
> cpu_dosoftints() call. Without this we have got panic just after  
> Ctrl+C
> pressing in the shell when __HAVE_FAST_SOFTINTS is enabled.

This has been properly fixed in <arm/arm32/frame.h>

Imre Deak | 7 Aug 12:40 2008

Re: [PATCH] ARM: VIPT cache coherency fix

On Wed, Aug 06, 2008 at 03:48:22PM -0700, Matt Thomas wrote:
>
> On Aug 6, 2008, at 2:55 AM, Imre Deak wrote:
>
>> Currently page loaning (at least) is broken on ARM VIPT platforms.
>> The reason is that possible dirty cache lines are not taken into  
>> account
>> at the moment, following is a fix for this.
>>
>> The fix is validated against the latest breakage related to the socket
>> page loaning reported earlier on the list.
>
> This is close to what I checked in but actually has a few missing corner
> cases.  The version I checked works for the always failing
> scp sdp:/lib/libc.so .

I have a boot-time crash with your patch see a follow-up mail about it.

I checked your patch from yesterday, and I have the following questions
about it:

diff --git a/sys/arch/arm/arm32/pmap.c b/sys/arch/arm/arm32/pmap.c
index 2b62477..a23e0aa 100644
--- a/sys/arch/arm/arm32/pmap.c
+++ b/sys/arch/arm/arm32/pmap.c
[...]
 <at>  <at>  -1833,130 +1853,177  <at>  <at>  pmap_vac_me_harder(struct vm_page *pg, pmap_t pm, vaddr_t va)
[...]
 					bad_alias = true;
 			}
(Continue reading)

Imre Deak | 7 Aug 13:01 2008

Re: [PATCH] ARM: VIPT cache coherency fix

On Thu, Aug 07, 2008 at 01:40:12PM +0300, Imre Deak wrote:
> On Wed, Aug 06, 2008 at 03:48:22PM -0700, Matt Thomas wrote:
> >
> > On Aug 6, 2008, at 2:55 AM, Imre Deak wrote:
> >
> >> Currently page loaning (at least) is broken on ARM VIPT platforms.
> >> The reason is that possible dirty cache lines are not taken into  
> >> account
> >> at the moment, following is a fix for this.
> >>
> >> The fix is validated against the latest breakage related to the socket
> >> page loaning reported earlier on the list.
> >
> > This is close to what I checked in but actually has a few missing corner
> > cases.  The version I checked works for the always failing
> > scp sdp:/lib/libc.so .
> 
> I have a boot-time crash with your patch see a follow-up mail about it.
> 

The following is easily reproducible with today's -current. Removing the
latest pmap changes gets away with the crash.

--Imre

NetBSD/evbarm (SDP2430) booting ...
initarm: Configuring system ...
Allocating page tables
setup_real_page_tables: physical_freestart 0x80554000
setup_real_page_tables: kernel_l1pt: 0x80554000:0x80554000
(Continue reading)

Imre Deak | 8 Aug 10:19 2008

Re: [PATCH 1/8] OMAP2: enable fast soft interrupts

On Wed, Aug 06, 2008 at 09:01:36PM -0700, Matt Thomas wrote:
>
> On Jun 27, 2008, at 10:53 AM, Imre Deak wrote:
>
>> diff --git a/sys/arch/arm/omap/files.omap2 b/sys/arch/arm/omap/ 
>> files.omap2
>> index 03ecae7..4314bec 100644
>> --- a/sys/arch/arm/omap/files.omap2
>> +++ b/sys/arch/arm/omap/files.omap2
>>  <at>  <at>  -4,6 +4,8  <at>  <at> 
>>  # Based on xscale/files.pxa2x0
>>  #
>>
>> +options __HAVE_FAST_SOFTINTS
>> +
>>  include "arch/arm/pic/files.pic"
>>
>>  file	arch/arm/arm32/irq_dispatch.S
>> -- 
>>
>
>
> This has been enable in std.tisdpxx (the correct place).

Why so? Isn't this a processor specific stuff rather than board
specific?

--Imre

(Continue reading)

Donald T Hayford | 9 Aug 06:01 2008

Error when building the kernel for NSLU2: Function pmap_vac_me_user in pmap.c

I received the following error while building the kernel for the NSLU2. 

#   compile  NSLU2_ALL/pmap.o
/home/hayford/net60/src/../tools/bin/armeb--netbsdelf-gcc -ffreestanding 
-fno-zero-initialized-in-bss -mcpu=xscale -mbig-endian -O2 -std=gnu99 
-Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith 
-Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wno-unreachable-code -Wno-sign-compare 
-Wno-pointer-sign -Wno-attributes -fno-strict-aliasing -Werror -Wall 
-Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes 
-Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings 
-Wno-unreachable-code -Wno-sign-compare -Wno-pointer-sign 
-Wno-attributes -Werror -mcpu=xscale -mbig-endian -DIXP425_NPE_MICROCODE 
-I. -I/home/hayford/net60/src/sys/../common/include 
-I/home/hayford/net60/src/sys/arch -I/home/hayford/net60/src/sys 
-nostdinc -DKERNEL_BASE_EXT=0xc0000000 -DCONSPEED=115200 -DCONUNIT=0 
-DDIAGNOSTIC -DDEBUG -DMAXUSERS=8 -D_KERNEL -D_KERNEL_OPT 
-I/home/hayford/net60/src/sys/lib/libkern/../../../common/lib/libc/quad 
-I/home/hayford/net60/src/sys/lib/libkern/../../../common/lib/libc/string 
-I/home/hayford/net60/src/sys/lib/libkern/../../../common/lib/libc/arch/arm/string 
-c /home/hayford/net60/src/sys/arch/arm/arm32/pmap.c
cc1: warnings being treated as errors
/home/hayford/net60/src/sys/arch/arm/arm32/pmap.c: In function 
'pmap_vac_me_user':
/home/hayford/net60/src/sys/arch/arm/arm32/pmap.c:1677: warning: 'npv' 
may be used uninitialized in this function

The code in question is:

> static void
(Continue reading)

Donald T Hayford | 9 Aug 20:37 2008

Re: Error when building the kernel for NSLU2: Function pmap_vac_me_user in pmap.c

Donald T Hayford wrote:
> The header line for the file is
>
> /*    $NetBSD: pmap.c,v 1.183 2008/08/06 19:13:45 matt Exp $    */
I see I'm a day behind, and that 1.184 has been released.

Regards, Don

Donald T Hayford | 9 Aug 22:01 2008

Re: Error when building the kernel for NSLU2: Function pmap_vac_me_user in pmap.c: PROBLEM SOLVED

Donald T Hayford wrote:
> Donald T Hayford wrote:
>> The header line for the file is
>>
>> /*    $NetBSD: pmap.c,v 1.183 2008/08/06 19:13:45 matt Exp $    */
> I see I'm a day behind, and that 1.184 has been released.
Yup, that's fixed it.

Regards, Don


Gmane