CVS commit: src/sys/arch/arm/include/arm32

2023-04-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 24 16:32:54 UTC 2023

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Fix DEVMAP_FLAGS, patch from Nick.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.174 src/sys/arch/arm/include/arm32/pmap.h:1.175
--- src/sys/arch/arm/include/arm32/pmap.h:1.174	Thu Apr 20 08:28:03 2023
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Apr 24 16:32:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.174 2023/04/20 08:28:03 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.175 2023/04/24 16:32:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -207,7 +207,7 @@ union pmap_cache_state {
 
 #define	DEVMAP_ALIGN(a)	((a) & ~L1_S_OFFSET)
 #define	DEVMAP_SIZE(s)	roundup2((s), L1_S_SIZE)
-#define	DEVMAP_FLAGS	PTE_DEV
+#define	DEVMAP_FLAGS	PMAP_DEV
 
 /*
  * The pmap structure itself



CVS commit: src/sys/arch/arm/include/arm32

2023-04-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 24 16:32:54 UTC 2023

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Fix DEVMAP_FLAGS, patch from Nick.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/include/arm32

2021-10-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 16 07:04:36 UTC 2021

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
pm_remove_all is a shared field so move it out the #ifdefs


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.170 src/sys/arch/arm/include/arm32/pmap.h:1.171
--- src/sys/arch/arm/include/arm32/pmap.h:1.170	Tue May  4 09:02:21 2021
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Oct 16 07:04:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.170 2021/05/04 09:02:21 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.171 2021/10/16 07:04:36 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -238,10 +238,10 @@ struct pmap {
 	struct l2_dtable	*pm_l2[L2_SIZE];
 	struct pmap_statistics	pm_stats;
 	LIST_ENTRY(pmap)	pm_list;
+	bool			pm_remove_all;
 #ifdef ARM_MMU_EXTENDED
 	pd_entry_t		*pm_l1;
 	paddr_t			pm_l1_pa;
-	bool			pm_remove_all;
 #ifdef MULTIPROCESSOR
 	kcpuset_t		*pm_onproc;
 	kcpuset_t		*pm_active;
@@ -255,7 +255,6 @@ struct pmap {
 	union pmap_cache_state	pm_cstate;
 	uint8_t			pm_domain;
 	bool			pm_activated;
-	bool			pm_remove_all;
 #endif
 };
 



CVS commit: src/sys/arch/arm/include/arm32

2021-10-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 16 07:04:36 UTC 2021

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
pm_remove_all is a shared field so move it out the #ifdefs


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/arch/arm/include/arm32

2021-05-30 Thread Simon Burge
"Rin Okuyama" wrote:

> Module Name:  src
> Committed By: rin
> Date: Sun May 30 07:20:00 UTC 2021
>
> Modified Files:
>
>   src/sys/arch/arm/include/arm32: param.h
>
> Log Message:
>
> Include opt_param.h for MSGBUFSIZE ifdef _KERNEL_OPT.

Thanks Rin!  I thought I had checked all the ways MSGBUFSIZE
was pulled in.

Cheers,
Simon.


Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Jason Thorpe


> On Jan 13, 2020, at 10:24 AM, Christos Zoulas  wrote:
> 
> Talking to myself:
> 
> The arm PAGE_SIZE_{MIN,MAX} should go away after nick eliminates the
> need for the 8K pages. This leaves us with m68k to deal with...
> Do modules work on m68k? Should modules be shared between kernels with
> different page sizes? Then perhaps we don't need a new constant?

On m68k, I think the following two statements are true:

a) The platform should use a constant PAGE_SIZE to the extent possible because 
it's a slow platform.

b) Modules should be built such that they can use a non-fixed PAGE_SIZE.

But (b) also requires that all of the OTHER non-same constants on m68k are 
avoided (take a closer look at  for example).  Those 
probably should be properly hidden from module builds so that we can at least 
*catch* such cases.

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Christos Zoulas
In article <20200113163830.e7a6317f...@rebar.astron.com>,
Christos Zoulas  wrote:
>| 
>| Probably this is the same reason of recent arm build failures:
>|  https://releng.netbsd.org/builds/HEAD/202001130720Z/
>|  https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
>| ---
>| /tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably
>doesn't match constraints [-Werror]
>|  __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
>|  ^
>| /tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably
>doesn't match constraints [-Werror]
>|  __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
>|  ^
>| /tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably
>doesn't match constraints [-Werror]
>|  __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
>|  ^
>| /tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably
>doesn't match constraints [-Werror]
>|  __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
>|  ^
>| ---
>| 
>| Should we prepare independent constant for
>| "possible pagesize value among different MACHINE with the same MACHINE_ARCH"
>| for jemalloc(3)?
>
>Ouch, this hurts. Sure, perhaps MALLOC_PAGE_SIZE?

Talking to myself:

The arm PAGE_SIZE_{MIN,MAX} should go away after nick eliminates the
need for the 8K pages. This leaves us with m68k to deal with...
Do modules work on m68k? Should modules be shared between kernels with
different page sizes? Then perhaps we don't need a new constant?

christos



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Jason Thorpe



> On Jan 13, 2020, at 8:15 AM, Izumi Tsutsui  wrote:
> 
> christos@ wrote:
> 
>>> Now I get the following erro during local tests of
>>> "build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
>>> 
>>> ---
>>> #create  compat_util/compat_exec.d
> :
>>> In file included from /s/cvs/src/sys/sys/param.h:149:0,
>>>from /s/cvs/src/sys/compat/common/compat_exec.c:41:
>>> ./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
>>> #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
>>>^
>>> nbmkdep: compile failed.
>>> *** [compat_exec.d] Error code 1
>> 
>> try cc -E?
> 
> It turns out the problem is more complicated.
> 
>  has the following definitions:
> 
> https://nxr.netbsd.org/xref/src/sys/uvm/uvm_param.h?r=1.38#135

I would suggest a possible workaround for this could be to define an additional:

#define __HAVE_FIXED_PAGE_SIZE

...at could also be tested here... the kernel truly does have a fixed page 
size, but userland not necessarily so.

> ---
>135  * If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
>136  * non-constant PAGE_SIZE, et al for LKMs.
>137  */
>138 #if (MIN_PAGE_SIZE != MAX_PAGE_SIZE)
>139 #define__uvmexp_pagesize
>140 #if defined(_LKM) || defined(_MODULE)
>141 #undef PAGE_SIZE
>142 #undef PAGE_MASK
>143 #undef PAGE_SHIFT
>144 #endif
>145 #endif
>146 
>147 /*
>148  * Now provide PAGE_SIZE, PAGE_MASK, and PAGE_SHIFT if we do not
>149  * have ones that are compile-time constants.
>150  */
>151 #if !defined(PAGE_SIZE)
>152 extern const int *const uvmexp_pagesize;
>153 extern const int *const uvmexp_pagemask;
>154 extern const int *const uvmexp_pageshift;
>155 #definePAGE_SIZE   (*uvmexp_pagesize)  /* size of page 
> */
>156 #definePAGE_MASK   (*uvmexp_pagemask)  /* size of page 
> - 1 */
>157 #definePAGE_SHIFT  (*uvmexp_pageshift) /* bits to 
> shift for pages */
>158 #endif /* PAGE_SIZE */
> ---
> 
> I.e.  assumes PAGE_SIZE is not compile time constant
> for MODULEs if (MIN_PAGE_SIZE != MAX_PAGE_SIZE).
> 
> Probably this is the same reason of recent arm build failures:
> https://releng.netbsd.org/builds/HEAD/202001130720Z/
> https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
> ---
> /tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
> ^
> /tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
> ^
> /tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
> ^
> /tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
> ^
> ---
> 
> Should we prepare independent constant for
> "possible pagesize value among different MACHINE with the same MACHINE_ARCH"
> for jemalloc(3)?
> 
> ---
> Izumi Tsutsui

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Christos Zoulas
On Jan 14,  1:15am, tsut...@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/incl

| christos@ wrote:
| 
| > >Now I get the following erro during local tests of
| > >"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
| > >
| > >---
| > >#create  compat_util/compat_exec.d
|  :
| > >In file included from /s/cvs/src/sys/sys/param.h:149:0,
| > > from /s/cvs/src/sys/compat/common/compat_exec.c:41:
| > >./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
| > > #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
| > > ^
| > >nbmkdep: compile failed.
| > >*** [compat_exec.d] Error code 1
| > 
| > try cc -E?
| 
| It turns out the problem is more complicated.
| 
|  has the following definitions:
| 
| https://nxr.netbsd.org/xref/src/sys/uvm/uvm_param.h?r=1.38#135
| ---
| 135  * If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
| 136  * non-constant PAGE_SIZE, et al for LKMs.
| 137  */
| 138 #if (MIN_PAGE_SIZE != MAX_PAGE_SIZE)
| 139 #define   __uvmexp_pagesize
| 140 #if defined(_LKM) || defined(_MODULE)
| 141 #undef PAGE_SIZE
| 142 #undef PAGE_MASK
| 143 #undef PAGE_SHIFT
| 144 #endif
| 145 #endif
| 146 
| 147 /*
| 148  * Now provide PAGE_SIZE, PAGE_MASK, and PAGE_SHIFT if we do not
| 149  * have ones that are compile-time constants.
| 150  */
| 151 #if !defined(PAGE_SIZE)
| 152 extern const int *const uvmexp_pagesize;
| 153 extern const int *const uvmexp_pagemask;
| 154 extern const int *const uvmexp_pageshift;
| 155 #define   PAGE_SIZE   (*uvmexp_pagesize)  /* size of page 
*/
| 156 #define   PAGE_MASK   (*uvmexp_pagemask)  /* size of page 
- 1 */
| 157 #define   PAGE_SHIFT  (*uvmexp_pageshift) /* bits to 
shift for pages */
| 158 #endif /* PAGE_SIZE */
| ---
| 
| I.e.  assumes PAGE_SIZE is not compile time constant
| for MODULEs if (MIN_PAGE_SIZE != MAX_PAGE_SIZE).
| 
| Probably this is the same reason of recent arm build failures:
|  https://releng.netbsd.org/builds/HEAD/202001130720Z/
|  https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
| ---
| /tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably doesn't 
match constraints [-Werror]
|  __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
|  ^
| /tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably doesn't 
match constraints [-Werror]
|  __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
|  ^
| /tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably doesn't 
match constraints [-Werror]
|  __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
|  ^
| /tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably doesn't 
match constraints [-Werror]
|  __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
|  ^
| ---
| 
| Should we prepare independent constant for
| "possible pagesize value among different MACHINE with the same MACHINE_ARCH"
| for jemalloc(3)?

Ouch, this hurts. Sure, perhaps MALLOC_PAGE_SIZE?

christos


Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Izumi Tsutsui
christos@ wrote:

> >Now I get the following erro during local tests of
> >"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
> >
> >---
> >#create  compat_util/compat_exec.d
 :
> >In file included from /s/cvs/src/sys/sys/param.h:149:0,
> > from /s/cvs/src/sys/compat/common/compat_exec.c:41:
> >./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
> > #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
> > ^
> >nbmkdep: compile failed.
> >*** [compat_exec.d] Error code 1
> 
> try cc -E?

It turns out the problem is more complicated.

 has the following definitions:

https://nxr.netbsd.org/xref/src/sys/uvm/uvm_param.h?r=1.38#135
---
135  * If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
136  * non-constant PAGE_SIZE, et al for LKMs.
137  */
138 #if (MIN_PAGE_SIZE != MAX_PAGE_SIZE)
139 #define __uvmexp_pagesize
140 #if defined(_LKM) || defined(_MODULE)
141 #undef PAGE_SIZE
142 #undef PAGE_MASK
143 #undef PAGE_SHIFT
144 #endif
145 #endif
146 
147 /*
148  * Now provide PAGE_SIZE, PAGE_MASK, and PAGE_SHIFT if we do not
149  * have ones that are compile-time constants.
150  */
151 #if !defined(PAGE_SIZE)
152 extern const int *const uvmexp_pagesize;
153 extern const int *const uvmexp_pagemask;
154 extern const int *const uvmexp_pageshift;
155 #define PAGE_SIZE   (*uvmexp_pagesize)  /* size of page */
156 #define PAGE_MASK   (*uvmexp_pagemask)  /* size of page - 1 */
157 #define PAGE_SHIFT  (*uvmexp_pageshift) /* bits to shift for 
pages */
158 #endif /* PAGE_SIZE */
---

I.e.  assumes PAGE_SIZE is not compile time constant
for MODULEs if (MIN_PAGE_SIZE != MAX_PAGE_SIZE).

Probably this is the same reason of recent arm build failures:
 https://releng.netbsd.org/builds/HEAD/202001130720Z/
 https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
---
/tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
 ^
/tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
 ^
/tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
 ^
/tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
 ^
---

Should we prepare independent constant for
"possible pagesize value among different MACHINE with the same MACHINE_ARCH"
for jemalloc(3)?

---
Izumi Tsutsui


Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Christos Zoulas
In article <200114002918.m0108...@mirage.ceres.dti.ne.jp>,
Izumi Tsutsui   wrote:
>christos@ wrote:
>
>> LGTM too.
>
>> >> thorpej@ wrote:
> :
>> >> How about the attached diff? (untested, just for review)
>> > 
>> > This looks good to me.
>
>Now I get the following erro during local tests of
>"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
>
>---
>#create  compat_util/compat_exec.d
>CC=/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/m68k--netbsdelf-gcc
>/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/nbmkdep -f
>compat_exec.d.tmp  --   -std=gnu99   -I/s/cvs/src/common/include
>-DDIAGNOSTIC --sysroot=/s/cvs/src/obj.hp300/destdir.hp300
>-I/s/cvs/src/common/include -DDIAGNOSTIC -nostdinc -I.
>-I/s/cvs/src/sys/modules/compat_util -isystem /s/cvs/src/sys -isystem
>/s/cvs/src/sys/arch -isystem /s/cvs/src/sys/../common/include -D_KERNEL
>-D_LKM -D_MODULE -DSYSCTL_INCLUDE_DESCR
>/s/cvs/src/sys/compat/common/compat_exec.c &&  mv -f compat_exec.d.tmp
>compat_exec.d
>In file included from /s/cvs/src/sys/sys/param.h:149:0,
> from /s/cvs/src/sys/compat/common/compat_exec.c:41:
>./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
> #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
> ^
>nbmkdep: compile failed.
>*** [compat_exec.d] Error code 1
>
>---
>
>I'm not sure why my  change causes this error,
>but I also wonder if we should use "PGSHIFT == 13" rather than
>"PAGE_SIZE == 8192" in ..

try cc -E?

christos



MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Izumi Tsutsui
christos@ wrote:

> LGTM too.

> >> thorpej@ wrote:
 :
> >> How about the attached diff? (untested, just for review)
> > 
> > This looks good to me.

Now I get the following erro during local tests of
"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:

---
#create  compat_util/compat_exec.d
CC=/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/m68k--netbsdelf-gcc 
/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/nbmkdep -f 
compat_exec.d.tmp  --   -std=gnu99   -I/s/cvs/src/common/include -DDIAGNOSTIC 
--sysroot=/s/cvs/src/obj.hp300/destdir.hp300 -I/s/cvs/src/common/include 
-DDIAGNOSTIC -nostdinc -I. -I/s/cvs/src/sys/modules/compat_util -isystem 
/s/cvs/src/sys -isystem /s/cvs/src/sys/arch -isystem 
/s/cvs/src/sys/../common/include -D_KERNEL -D_LKM -D_MODULE 
-DSYSCTL_INCLUDE_DESCR /s/cvs/src/sys/compat/common/compat_exec.c &&  mv -f 
compat_exec.d.tmp compat_exec.d
In file included from /s/cvs/src/sys/sys/param.h:149:0,
 from /s/cvs/src/sys/compat/common/compat_exec.c:41:
./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
 #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
 ^
nbmkdep: compile failed.
*** [compat_exec.d] Error code 1

---

I'm not sure why my  change causes this error,
but I also wonder if we should use "PGSHIFT == 13" rather than
"PAGE_SIZE == 8192" in ..

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-12 Thread Christos Zoulas
LGTM too.

christos

> On Jan 12, 2020, at 10:09 AM, Jason Thorpe  wrote:
> 
> 
> 
>> On Jan 11, 2020, at 10:47 PM, Izumi Tsutsui  wrote:
>> 
>> thorpej@ wrote:
>> 
 PGSHIFT is defined in  and
 PAGE_SHIFT and PAGE_SIZE is in ,
 but there is no common .
>>> 
>>> Make a common  that all of the platforms can #include, and 
>>> just put these common definitions in it (for now)?
>> 
>> How about the attached diff? (untested, just for review)
> 
> This looks good to me.
> 
> -- thorpej



signature.asc
Description: Message signed with OpenPGP


Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-12 Thread Jason Thorpe



> On Jan 11, 2020, at 10:47 PM, Izumi Tsutsui  wrote:
> 
> thorpej@ wrote:
> 
>>> PGSHIFT is defined in  and
>>> PAGE_SHIFT and PAGE_SIZE is in ,
>>> but there is no common .
>> 
>> Make a common  that all of the platforms can #include, and 
>> just put these common definitions in it (for now)?
> 
> How about the attached diff? (untested, just for review)

This looks good to me.

-- thorpej



Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Izumi Tsutsui
thorpej@ wrote:

> > PGSHIFT is defined in  and
> > PAGE_SHIFT and PAGE_SIZE is in ,
> > but there is no common .
> 
> Make a common  that all of the platforms can #include, and 
> just put these common definitions in it (for now)?

How about the attached diff? (untested, just for review)

- Only sun3 use immediate "13" (not PGSHIFT) for PG_SHIFT,
  but sun3/include/param.h also has "#define PGSHIFT 13".
- For now I'll leave evbcf as is. (I doubt its MACHINE_ARCH is m68k)

--- /dev/null   2020-01-12 15:11:38.258153018 +0900
+++ m68k/include/vmparam.h  2020-01-12 15:29:21.866107854 +0900
@@ -0,0 +1,65 @@
+/* $NetBSD$*/
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
+ *
+ * @(#)vmparam.h   8.2 (Berkeley) 4/19/94
+ */
+
+#ifndef _M68K_VMPARAM_H_
+#define_M68K_VMPARAM_H_
+
+/*
+ * Common constants for m68k ports
+ */
+
+/*
+ * hp300 pmap derived m68k ports can use 4K or 8K pages.
+ * (except HPMMU machines)
+ * sun3 and sun3x use 8K pages.
+ * The page size is specified by PGSHIFT in .
+ * Override the PAGE_* definitions to be compile-time constants.
+ */
+#definePAGE_SHIFT  PGSHIFT
+#definePAGE_SIZE   (1 << PAGE_SHIFT)
+#definePAGE_MASK   (PAGE_SIZE - 1)
+
+/* Some implemantations like jemalloc(3) require physical page size details. */
+#defineMIN_PAGE_SHIFT  12
+#defineMAX_PAGE_SHIFT  13
+#defineMIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
+#defineMAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)
+
+#endif /* _M68K_VMPARAM_H_ */

Index: amiga/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/amiga/include/vmparam.h,v
retrieving revision 1.47
diff -u -p -d -r1.47 vmparam.h
--- amiga/include/vmparam.h 27 Mar 2019 17:15:29 -  1.47
+++ amiga/include/vmparam.h 12 Jan 2020 06:29:56 -
@@ -46,12 +46,9 @@
  */
 
 /*
- * We use 8K pages on the Amiga.  Override the PAGE_* definitions
- * to be compie-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: atari/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/atari/include/vmparam.h,v
retrieving revision 1.33
diff -u -p -d -r1.33 vmparam.h
--- atari/include/vmparam.h 27 Mar 2019 17:15:29 -  1.33
+++ atari/include/vmparam.h 12 Jan 2020 06:29:56 -
@@ -46,12 +46,9 @@
  */
 
 /*
- * We use 8K pages on the Atari.  Override the PAGE_* definitions
- * to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: cesfic/include/vmparam.h
===
RCS file: /cvsr

Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Jason Thorpe



> On Jan 11, 2020, at 8:32 PM, Izumi Tsutsui  wrote:
> 
> PGSHIFT is defined in  and
> PAGE_SHIFT and PAGE_SIZE is in ,
> but there is no common .

Make a common  that all of the platforms can #include, and just 
put these common definitions in it (for now)?

-- thorpej



Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Izumi Tsutsui
> >m68k also needs this? (currently no common  though)
> 
> Good catch. Yup, looks like it:
 :
> 
> #define   MIN_PAGE_SHIFT  11  /* sun2 */
> #define   MAX_PAGE_SHIFT  13  /* amiga,atari,sun3 */
> #define   MIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
> #define   MAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)

sun2 is different MACHINE_ARCH (m68000) from other m68k ports,
so MIN_PAGE_SHIFT should be 12.

> Should I take care of it or can you?

I just wonder which header file these definitions should be in.
Is  ok?

PGSHIFT is defined in  and
PAGE_SHIFT and PAGE_SIZE is in ,
but there is no common .

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Christos Zoulas
In article <200112121414.m0101...@mirage.ceres.dti.ne.jp>,
Izumi Tsutsui   wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sat Jan 11 19:06:35 UTC 2020
>> 
>> Modified Files:
>>  src/sys/arch/arm/include/arm32: vmparam.h
>> 
>> Log Message:
>> Define the min and max page size supported for the benefit of jemalloc
>> 
>> 
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/arm32/vmparam.h
>
>--- src/sys/arch/arm/include/arm32/vmparam.h:1.45  Wed Jun 19 09:54:42 2019
>+++ src/sys/arch/arm/include/arm32/vmparam.h   Sat Jan 11 19:06:34 2020
>@@ -84,6 +84,11 @@
> #define   PAGE_SIZE   (1 << PAGE_SHIFT)
> #define   PAGE_MASK   (PAGE_SIZE - 1)
> 
>+#define   MIN_PAGE_SHIFT  12  /* normal */
>+#define   MAX_PAGE_SHIFT  13  /* _ARM_ARCH_6 */
>+#define   MIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
>+#define   MAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)
>+
> /*
>  * Mach derived constants
>  */
>
>---
>
>m68k also needs this? (currently no common  though)

Good catch. Yup, looks like it:

$ fgrep PGSHIFT 
{amiga,atari,hp300,luna68k,mac68k,mvme68k,next68k,sun2,sun3,x68k}/
param.h
amiga/include/param.h:#define   PGSHIFT 13  /* LOG2(NBPG) */
atari/include/param.h:#define   PGSHIFT 13  /* LOG2(NBPG) */
hp300/include/param.h:#define   PGSHIFT 12  /* LOG2(NBPG) */
luna68k/include/param.h:#define PGSHIFT 12  /* LOG2(NBPG) */
mac68k/include/param.h:#define  PGSHIFT 12  /* LOG2(NBPG) */
mvme68k/include/param.h:#define PGSHIFT 12  /* LOG2(NBPG) */
next68k/include/param.h:#define PGSHIFT 12  /* LOG2(NBPG) */
sun2/include/param.h:#define PGSHIFT11  /* LOG2(NBPG) */
sun3/include/param.h:#definePGSHIFT 13  /* LOG2(NBPG) */
x68k/include/param.h:#definePGSHIFT 12  /* LOG2(NBPG) */

...

#define   MIN_PAGE_SHIFT  11  /* sun2 */
#define   MAX_PAGE_SHIFT  13  /* amiga,atari,sun3 */
#define   MIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
#define   MAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)

Should I take care of it or can you?

christos



Re: CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: christos
> Date: Sat Jan 11 19:06:35 UTC 2020
> 
> Modified Files:
>   src/sys/arch/arm/include/arm32: vmparam.h
> 
> Log Message:
> Define the min and max page size supported for the benefit of jemalloc
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/arm32/vmparam.h

--- src/sys/arch/arm/include/arm32/vmparam.h:1.45   Wed Jun 19 09:54:42 2019
+++ src/sys/arch/arm/include/arm32/vmparam.hSat Jan 11 19:06:34 2020
@@ -84,6 +84,11 @@
 #definePAGE_SIZE   (1 << PAGE_SHIFT)
 #definePAGE_MASK   (PAGE_SIZE - 1)
 
+#defineMIN_PAGE_SHIFT  12  /* normal */
+#defineMAX_PAGE_SHIFT  13  /* _ARM_ARCH_6 */
+#defineMIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
+#defineMAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)
+
 /*
  * Mach derived constants
  */

---

m68k also needs this? (currently no common  though)

---
Izumi Tsutsui


CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:54:15 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/arm32/pte.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:54:42 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Update a comment


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/include/arm32/vmparam.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.44 src/sys/arch/arm/include/arm32/vmparam.h:1.45
--- src/sys/arch/arm/include/arm32/vmparam.h:1.44	Sat Mar 30 21:06:42 2019
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Jun 19 09:54:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.44 2019/03/30 21:06:42 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.45 2019/06/19 09:54:42 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -78,7 +78,7 @@
 
 /*
  * While the ARM architecture defines Section mappings, large pages,
- * and small pages, the standard page size is (and will always be) 4K.
+ * and small pages, the standard MMU page size is (and will always be) 4K.
  */
 #define	PAGE_SHIFT	PGSHIFT
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)



CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:54:42 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Update a comment


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/include/arm32/vmparam.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:54:15 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/arm32/pte.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.19 src/sys/arch/arm/include/arm32/pte.h:1.20
--- src/sys/arch/arm/include/arm32/pte.h:1.19	Wed Oct 29 10:59:48 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Wed Jun 19 09:54:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.19 2014/10/29 10:59:48 skrll Exp $	*/
+/*	$NetBSD: pte.h,v 1.20 2019/06/19 09:54:15 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -131,6 +131,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 
 #define	L1_TABLE_SIZE	0x4000		/* 16K */
 #define	L2_TABLE_SIZE	0x1000		/* 4K */
+
 /*
  * The new pmap deals with the 1KB coarse L2 tables by
  * allocating them from a pool. Until every port has been converted,



CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:53:39 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
KNF and add a comment


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/arm32/param.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/include/arm32

2019-06-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 19 09:53:39 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
KNF and add a comment


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/arm32/param.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.26 src/sys/arch/arm/include/arm32/param.h:1.27
--- src/sys/arch/arm/include/arm32/param.h:1.26	Mon Feb  4 13:06:39 2019
+++ src/sys/arch/arm/include/arm32/param.h	Wed Jun 19 09:53:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.26 2019/02/04 13:06:39 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.27 2019/06/19 09:53:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -53,9 +53,8 @@
 #endif
 #endif
 #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
-#define	PGOFSET		(NBPG-1)	/* byte offset into page */
-#define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
-
+#define	PGOFSET		(NBPG - 1)	/* byte offset into page */
+#define	NPTEPG		(NBPG / sizeof(pt_entry_t))	/* PTEs per Page */
 
 #define SSIZE		1		/* initial stack size/NBPG */
 #define SINCR		1		/* increment of stack/NBPG */



Re: CVS commit: src/sys/arch/arm/include/arm32

2017-05-25 Thread Jared McNeill

This breaks kernel builds:

/home/jmcneill/netbsd/cvs-src/sys/uvm/pmap/pmap_tlb.c: In function 
'pmap_tlb_update_addr':
/home/jmcneill/netbsd/cvs-src/sys/uvm/pmap/pmap_tlb.c:739:13: error: implicit 
declaration of function 'pte_valid_p' [-Werror=implicit-function-declaration]
  KASSERTMSG(pte_valid_p(pte), "va %#"PRIxVADDR" %#"PRIxPTE,


On Thu, 25 May 2017, Nick Hudson wrote:


Module Name:src
Committed By:   skrll
Date:   Thu May 25 20:42:41 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Use the define name PMAP_HWPAGEWALKER and not PMAP_TLB_HWPAGEWALKER


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.