Re: armv7 -pmap_prefer

2018-03-15 Thread Artturi Alm
On Fri, Jul 21, 2017 at 06:49:01AM +0300, Artturi Alm wrote:
> On Thu, Jul 20, 2017 at 11:50:55PM +0300, Artturi Alm wrote:
> > Hi,
> > 
> > one of the removals of mine i never understood why it was there to
> > begin w/, given it's not in our pmap.9, nor really doing anything.
> > 
> > -Artturi
> > 
> 
> Took a better look, and this might actually be considered a bug fix,
> if expected value for armv7 out of PMAP_PREFER_ALIGN() actually is
> 0x1000, as it would be after this diff, but nothing else changes, as
> pmap_alias_dist is always 0.
> 
> I'm not going to learn any more of uvm_map.c, to know if there's any
> actual difference between PMAP_PREFER_ALIGN() returning current 0
> instead of PAGE_SIZE.., so will leave this to those who know more:)
> -Artturi
> 

pong? :)
-Artturi

> 
> > 
> > diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c
> > index f99ee582e00..d47d8058736 100644
> > --- a/sys/arch/arm/arm/pmap7.c
> > +++ b/sys/arch/arm/arm/pmap7.c
> > @@ -2872,20 +2872,3 @@ pmap_pte_init_armv7(void)
> > if ((id_mmfr3 & 0x00f0) == 0x0010)
> > pmap_needs_pte_sync = 0;
> >  }
> > -
> > -uint32_t pmap_alias_dist;
> > -uint32_t pmap_alias_bits;
> > -
> > -vaddr_t
> > -pmap_prefer(vaddr_t foff, vaddr_t va)
> > -{
> > -   long d, m;
> > -
> > -   m = pmap_alias_dist;
> > -   if (m == 0) /* m=0 => no cache aliasing */
> > -   return va;
> > -
> > -   d = foff - va;
> > -   d &= (m - 1);
> > -   return va + d;
> > -}
> > diff --git a/sys/arch/arm/include/pmap.h b/sys/arch/arm/include/pmap.h
> > index 83c3395f710..3284418f924 100644
> > --- a/sys/arch/arm/include/pmap.h
> > +++ b/sys/arch/arm/include/pmap.h
> > @@ -619,23 +619,6 @@ l2pte_is_writeable(pt_entry_t pte, struct pmap *pm)
> >  #defineL2_L_MAPPABLE_P(va, pa, size)   
> > \
> > va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
> >  
> > -#ifndef _LOCORE
> > -/* pmap_prefer bits for VIPT ARMv7 */
> > -#define PMAP_PREFER(fo, ap)pmap_prefer((fo), (ap))
> > -vaddr_tpmap_prefer(vaddr_t, vaddr_t);
> > -
> > -extern uint32_t pmap_alias_dist;
> > -extern uint32_t pmap_alias_bits;
> > -
> > -/* pmap prefer alias alignment. */
> > -#define PMAP_PREFER_ALIGN()(pmap_alias_dist)
> > -/* pmap prefer offset withing alignment. */
> > -#define PMAP_PREFER_OFFSET(of) 
> > \
> > -(PMAP_PREFER_ALIGN() == 0 ? 0 : ((of) & (PMAP_PREFER_ALIGN() - 1)))
> > -
> > -
> > -#endif /* _LOCORE */
> > -
> >  #endif /* _KERNEL */
> >  
> >  #ifndef _LOCORE



Re: armv7 -pmap_prefer

2017-07-20 Thread Artturi Alm
On Thu, Jul 20, 2017 at 11:50:55PM +0300, Artturi Alm wrote:
> Hi,
> 
> one of the removals of mine i never understood why it was there to
> begin w/, given it's not in our pmap.9, nor really doing anything.
> 
> -Artturi
> 

Took a better look, and this might actually be considered a bug fix,
if expected value for armv7 out of PMAP_PREFER_ALIGN() actually is
0x1000, as it would be after this diff, but nothing else changes, as
pmap_alias_dist is always 0.

I'm not going to learn any more of uvm_map.c, to know if there's any
actual difference between PMAP_PREFER_ALIGN() returning current 0
instead of PAGE_SIZE.., so will leave this to those who know more:)
-Artturi


> 
> diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c
> index f99ee582e00..d47d8058736 100644
> --- a/sys/arch/arm/arm/pmap7.c
> +++ b/sys/arch/arm/arm/pmap7.c
> @@ -2872,20 +2872,3 @@ pmap_pte_init_armv7(void)
>   if ((id_mmfr3 & 0x00f0) == 0x0010)
>   pmap_needs_pte_sync = 0;
>  }
> -
> -uint32_t pmap_alias_dist;
> -uint32_t pmap_alias_bits;
> -
> -vaddr_t
> -pmap_prefer(vaddr_t foff, vaddr_t va)
> -{
> - long d, m;
> -
> - m = pmap_alias_dist;
> - if (m == 0) /* m=0 => no cache aliasing */
> - return va;
> -
> - d = foff - va;
> - d &= (m - 1);
> - return va + d;
> -}
> diff --git a/sys/arch/arm/include/pmap.h b/sys/arch/arm/include/pmap.h
> index 83c3395f710..3284418f924 100644
> --- a/sys/arch/arm/include/pmap.h
> +++ b/sys/arch/arm/include/pmap.h
> @@ -619,23 +619,6 @@ l2pte_is_writeable(pt_entry_t pte, struct pmap *pm)
>  #define  L2_L_MAPPABLE_P(va, pa, size)   
> \
>   va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
>  
> -#ifndef _LOCORE
> -/* pmap_prefer bits for VIPT ARMv7 */
> -#define PMAP_PREFER(fo, ap)  pmap_prefer((fo), (ap))
> -vaddr_t  pmap_prefer(vaddr_t, vaddr_t);
> -
> -extern uint32_t pmap_alias_dist;
> -extern uint32_t pmap_alias_bits;
> -
> -/* pmap prefer alias alignment. */
> -#define PMAP_PREFER_ALIGN()  (pmap_alias_dist)
> -/* pmap prefer offset withing alignment. */
> -#define PMAP_PREFER_OFFSET(of)   
> \
> -(PMAP_PREFER_ALIGN() == 0 ? 0 : ((of) & (PMAP_PREFER_ALIGN() - 1)))
> -
> -
> -#endif /* _LOCORE */
> -
>  #endif /* _KERNEL */
>  
>  #ifndef _LOCORE



armv7 -pmap_prefer

2017-07-20 Thread Artturi Alm
Hi,

one of the removals of mine i never understood why it was there to
begin w/, given it's not in our pmap.9, nor really doing anything.

-Artturi


diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c
index f99ee582e00..d47d8058736 100644
--- a/sys/arch/arm/arm/pmap7.c
+++ b/sys/arch/arm/arm/pmap7.c
@@ -2872,20 +2872,3 @@ pmap_pte_init_armv7(void)
if ((id_mmfr3 & 0x00f0) == 0x0010)
pmap_needs_pte_sync = 0;
 }
-
-uint32_t pmap_alias_dist;
-uint32_t pmap_alias_bits;
-
-vaddr_t
-pmap_prefer(vaddr_t foff, vaddr_t va)
-{
-   long d, m;
-
-   m = pmap_alias_dist;
-   if (m == 0) /* m=0 => no cache aliasing */
-   return va;
-
-   d = foff - va;
-   d &= (m - 1);
-   return va + d;
-}
diff --git a/sys/arch/arm/include/pmap.h b/sys/arch/arm/include/pmap.h
index 83c3395f710..3284418f924 100644
--- a/sys/arch/arm/include/pmap.h
+++ b/sys/arch/arm/include/pmap.h
@@ -619,23 +619,6 @@ l2pte_is_writeable(pt_entry_t pte, struct pmap *pm)
 #defineL2_L_MAPPABLE_P(va, pa, size)   
\
va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
 
-#ifndef _LOCORE
-/* pmap_prefer bits for VIPT ARMv7 */
-#define PMAP_PREFER(fo, ap)pmap_prefer((fo), (ap))
-vaddr_tpmap_prefer(vaddr_t, vaddr_t);
-
-extern uint32_t pmap_alias_dist;
-extern uint32_t pmap_alias_bits;
-
-/* pmap prefer alias alignment. */
-#define PMAP_PREFER_ALIGN()(pmap_alias_dist)
-/* pmap prefer offset withing alignment. */
-#define PMAP_PREFER_OFFSET(of) \
-(PMAP_PREFER_ALIGN() == 0 ? 0 : ((of) & (PMAP_PREFER_ALIGN() - 1)))
-
-
-#endif /* _LOCORE */
-
 #endif /* _KERNEL */
 
 #ifndef _LOCORE