RE: [PATCH v1 0/9] Enable SMP for pc386 based bsps

2020-06-02 Thread Jan.Sommer
Hi Joel,

Yes, that should be the case in patch 5/9.
There, the addition to cpukit/score/cpu/i386/include/rtems/score/cpu.h should 
be the struct the ticket is talking about.

Best regards,

   Jan

From: Joel Sherrill [mailto:j...@rtems.org]
Sent: Monday, June 1, 2020 10:58 PM
To: Sommer, Jan
Cc: rtems-de...@rtems.org
Subject: Re: [PATCH v1 0/9] Enable SMP for pc386 based bsps

Thank you for taking the time and energy to do this. It

Did your patch comments close https://devel.rtems.org/ticket/3335?

On Sun, May 31, 2020 at 9:23 AM Jan Sommer 
mailto:jan.som...@dlr.de>> wrote:
Hello,

Here is a patch set which should enable SMP again for the pc386-based BSPs 
(mainly tested with pc686).
So far I only tested it with qemu. Tests on real hardware are pending.
To me it looks like there are no regressions for the standard non-SMP version 
of the BSP, but it is difficult to say for sure.
Subsequent runs of the testsuite with a current master build already produce 
different numbers of failed/timeout/invalid tests.

However, even with the patch set applied the amount of passed tests continues 
to range from 550-557 and the failed/timeout/invalid tests seem to be generally 
the same.
Regarding smptests, the current status with qemu-4.2.0 and 4 cores looks like 
this:

Passed:55
Failed: 1
User Input: 0
Expected Fail:  0
Indeterminate:  0
Benchmark:  0
Timeout:2
Invalid:1
Wrong Version:  0
Wrong Build:0
Wrong Tools:0
-
Total: 59
Failures:
 smpatomic01.exe
Timeouts:
 smpclock01.exe
 smpopenmp01.exe
Invalid:
 smpfatal09.exe

Some details on the missing tests:
---
smpfatal09: This test actually does pass, but because the fatal error handler 
is executed before the console is initialized, no output is produced.

smpclock01.exe: Here CPU0 disables its local interrupts and waits for a barrier 
release of CPU1. This means it doesn't handle timer interrupts anymore and 
doesn't send corresponding IPIs to other CPUs.
At the same time CPU1 is waiting for a timer event before releasing the 
barrier. Any hints how to resolve this are very welcome.

smpatomic01: This test seems very large and a bit complicated to me. I will 
have a look at it next, but any suggestions are welcome. It fails with this 
information:
] === atomic or/and test case ===
] worker 0 value: 1
] worker 1 value: 0
] atomic value: expected = 1, actual = 1
] 
../../../../../../smp-refex-rtems/c/src/../../testsuites/smptests/smpatomic01/init.c:
 404 n - s < LONG_MAX
]
] *** FATAL ***

smpopenmp01: I don't know more about openmp then what is on wikipedia. It has 
currently a low priority for me.

Some details regarding the patch set:
-

- The first 3 commits are basically cleaning the original start16.S to be used 
for starting the application processors only and updating the general bring up 
infrastructure.
- The next 2 commits are updating the low level context switch and isr handling 
in assembly. I used the ARM implementation as a template and tried to stay 
comparably close to it.
- The last 4 commits are smaller changes made after debugging certain test 
cases.


My next step would be to test the SMP functionality on HW. My goal would be to 
get the final revision published as part of the RTEMS5 release.
If you would like to see any logs from a testsuite run with certain parameters, 
just tell me.

Best regards,

Jan



Jan Sommer (9):
  bsp/pc386: Fix Makefile for building with SMP
  bsp/pc386: Turn start16.S into a startAP.S
  bsp/pc386: Update GDT to work for SMP
  bsp/pc386: Update context switch and restore
  bsp/pc386: Define interrupt stack frame for smp
  bsps/pc386: Fix Clock_isr for SMP
  bsps/pc386: Separate smp API functions. Makes smpfatal08 link
  smpsignal01: Change state before sending the signal
  bsp/pc386: Disable interrupt nesting for job handler

 bsps/i386/include/bsp/smp-imps.h   |   3 +
 bsps/i386/pc386/clock/ckinit.c |   2 +-
 bsps/i386/pc386/include/bsp.h  |   7 +
 bsps/i386/pc386/include/bsp/tblsizes.h |   8 +-
 bsps/i386/pc386/start/bspsmp.c |  43 
 bsps/i386/pc386/start/getcpuid.c   |  22 --
 bsps/i386/pc386/start/ldsegs.S |   4 +-
 bsps/i386/pc386/start/smp-imps.c   |  79 ---
 bsps/i386/pc386/start/start16.S| 254 -
 bsps/i386/pc386/start/startAP.S| 118 ++
 bsps/i386/shared/irq/irq_asm.S | 102 +
 c/src/lib/libbsp/i386/pc386/Makefile.am|   8 +-
 cpukit/score/cpu/i386/cpu_asm.S|  74 --
 cpukit/score/cpu/i386/include/rtems/asm.h  |  26 +++
 cpukit/score/cpu/i386/include/rtems/score/cpu.h|  32 +--
 .../score/cpu/i386/include/rtems/score/cpuimpl.h   |   2 +
 testsuites/smptests/smpsignal01/init.c  

Re: [PATCH] fenv support arm

2020-06-02 Thread Joel Sherrill
Unless someone comments in the next 24 hours,
I think this is ready to post to newlib's mailing list
and get merged.

It looks like a faithful adaptation of the FreeBSD code to
newlib's libm architecture.

--joel

On Mon, Jun 1, 2020 at 7:10 PM Eshan dhawan  wrote:

> This patch adds support for ARM fenv to newlib
>
> the files are taken from FreeBSD
>
> Signed-off-by: Eshan dhawan 
> ---
>  newlib/libc/machine/arm/machine/acle-compat.h | 182 ++
>  newlib/libc/machine/arm/machine/fenv-mangle.h |  53 +++
>  .../libc/machine/arm/machine/fenv-softfloat.h | 187 ++
>  newlib/libc/machine/arm/machine/fenv-vfp.h| 187 ++
>  newlib/libc/machine/arm/sys/fenv.h| 122 +++
>  newlib/libm/machine/arm/Makefile.am   |  18 +-
>  newlib/libm/machine/arm/fe_dfl_env.c  |   7 +
>  newlib/libm/machine/arm/feclearexcept.c   |   7 +
>  newlib/libm/machine/arm/fegetenv.c|   7 +
>  newlib/libm/machine/arm/fegetexceptflag.c |   7 +
>  newlib/libm/machine/arm/fegetround.c  |   7 +
>  newlib/libm/machine/arm/feholdexcept.c|   7 +
>  newlib/libm/machine/arm/fenv-softfp.c |  32 ++
>  newlib/libm/machine/arm/fenv-vfp.c|  32 ++
>  newlib/libm/machine/arm/fenv.c| 328 ++
>  newlib/libm/machine/arm/feraiseexcept.c   |   7 +
>  newlib/libm/machine/arm/fesetenv.c|   7 +
>  newlib/libm/machine/arm/fesetexceptflag.c |   7 +
>  newlib/libm/machine/arm/fesetround.c  |   7 +
>  newlib/libm/machine/arm/fetestexcept.c|   7 +
>  newlib/libm/machine/arm/feupdateenv.c |   7 +
>  21 files changed, 1224 insertions(+), 1 deletion(-)
>  create mode 100644 newlib/libc/machine/arm/machine/acle-compat.h
>  create mode 100644 newlib/libc/machine/arm/machine/fenv-mangle.h
>  create mode 100644 newlib/libc/machine/arm/machine/fenv-softfloat.h
>  create mode 100644 newlib/libc/machine/arm/machine/fenv-vfp.h
>  create mode 100644 newlib/libc/machine/arm/sys/fenv.h
>  create mode 100644 newlib/libm/machine/arm/fe_dfl_env.c
>  create mode 100644 newlib/libm/machine/arm/feclearexcept.c
>  create mode 100644 newlib/libm/machine/arm/fegetenv.c
>  create mode 100644 newlib/libm/machine/arm/fegetexceptflag.c
>  create mode 100644 newlib/libm/machine/arm/fegetround.c
>  create mode 100644 newlib/libm/machine/arm/feholdexcept.c
>  create mode 100644 newlib/libm/machine/arm/fenv-softfp.c
>  create mode 100644 newlib/libm/machine/arm/fenv-vfp.c
>  create mode 100644 newlib/libm/machine/arm/fenv.c
>  create mode 100644 newlib/libm/machine/arm/feraiseexcept.c
>  create mode 100644 newlib/libm/machine/arm/fesetenv.c
>  create mode 100644 newlib/libm/machine/arm/fesetexceptflag.c
>  create mode 100644 newlib/libm/machine/arm/fesetround.c
>  create mode 100644 newlib/libm/machine/arm/fetestexcept.c
>  create mode 100644 newlib/libm/machine/arm/feupdateenv.c
>
> diff --git a/newlib/libc/machine/arm/machine/acle-compat.h
> b/newlib/libc/machine/arm/machine/acle-compat.h
> new file mode 100644
> index 0..888ae2ea8
> --- /dev/null
> +++ b/newlib/libc/machine/arm/machine/acle-compat.h
> @@ -0,0 +1,182 @@
> +/*
> + * Copyright (c) 2014 ARM Ltd
> + * All rights reserved.
> + *
> + * 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. The name of the company may not be used to endorse or promote
> + *products derived from this software without specific prior written
> + *permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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.
> + */
> +
> +#ifndef __ARM_ARCH
> +
> +/* ACLE standardises a set of pre-defines that describe the ARM
> architecture.
> +   These were mostly implemented in GCC around GCC-4.8; older versions
> +   have no, or only partial support.  To provide a level of backwards
> +   comp

Re: [PATCH] hard float support for PowerPC taken from FreeBSD

2020-06-02 Thread Joel Sherrill
This looks ready to submit to newlib for review and incorporation.

Good work.

--joel

On Fri, May 29, 2020 at 6:08 PM Eshan dhawan 
wrote:

> PowerPc Fenv support
>
> Signed-off-by: Eshan dhawan 
> ---
>  newlib/configure.host |   1 +
>  newlib/libc/machine/powerpc/machine/fenv-fp.h | 198 ++
>  newlib/libc/machine/powerpc/sys/fenv.h| 132 
>  newlib/libm/machine/configure.in  |   1 +
>  newlib/libm/machine/powerpc/Makefile.am   |  20 ++
>  newlib/libm/machine/powerpc/configure.in  |  11 +
>  newlib/libm/machine/powerpc/feclearexcept.c   |   7 +
>  newlib/libm/machine/powerpc/fegetenv.c|   7 +
>  newlib/libm/machine/powerpc/fegetexceptflag.c |   7 +
>  newlib/libm/machine/powerpc/fegetround.c  |   7 +
>  newlib/libm/machine/powerpc/feholdexcept.c|   7 +
>  newlib/libm/machine/powerpc/fenv.c|  51 +
>  newlib/libm/machine/powerpc/feraiseexcept.c   |   7 +
>  newlib/libm/machine/powerpc/fesetenv.c|   7 +
>  newlib/libm/machine/powerpc/fesetexceptflag.c |   7 +
>  newlib/libm/machine/powerpc/fesetround.c  |   7 +
>  newlib/libm/machine/powerpc/fetestexcept.c|   7 +
>  newlib/libm/machine/powerpc/feupdateenv.c |   7 +
>  18 files changed, 491 insertions(+)
>  create mode 100644 newlib/libc/machine/powerpc/machine/fenv-fp.h
>  create mode 100644 newlib/libc/machine/powerpc/sys/fenv.h
>  create mode 100644 newlib/libm/machine/powerpc/Makefile.am
>  create mode 100644 newlib/libm/machine/powerpc/configure.in
>  create mode 100644 newlib/libm/machine/powerpc/feclearexcept.c
>  create mode 100644 newlib/libm/machine/powerpc/fegetenv.c
>  create mode 100644 newlib/libm/machine/powerpc/fegetexceptflag.c
>  create mode 100644 newlib/libm/machine/powerpc/fegetround.c
>  create mode 100644 newlib/libm/machine/powerpc/feholdexcept.c
>  create mode 100644 newlib/libm/machine/powerpc/fenv.c
>  create mode 100644 newlib/libm/machine/powerpc/feraiseexcept.c
>  create mode 100644 newlib/libm/machine/powerpc/fesetenv.c
>  create mode 100644 newlib/libm/machine/powerpc/fesetexceptflag.c
>  create mode 100644 newlib/libm/machine/powerpc/fesetround.c
>  create mode 100644 newlib/libm/machine/powerpc/fetestexcept.c
>  create mode 100644 newlib/libm/machine/powerpc/feupdateenv.c
>
> diff --git a/newlib/configure.host b/newlib/configure.host
> index a84c0c80a..9d2166f3d 100644
> --- a/newlib/configure.host
> +++ b/newlib/configure.host
> @@ -290,6 +290,7 @@ case "${host_cpu}" in
> ;;
>powerpc*)
> machine_dir=powerpc
> +   libm_machine_dir=powerpc
> ;;
>pru*)
> newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED"
> diff --git a/newlib/libc/machine/powerpc/machine/fenv-fp.h
> b/newlib/libc/machine/powerpc/machine/fenv-fp.h
> new file mode 100644
> index 0..7cf20218e
> --- /dev/null
> +++ b/newlib/libc/machine/powerpc/machine/fenv-fp.h
> @@ -0,0 +1,198 @@
> +/*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
> + * Copyright (c) 2004-2005 David Schultz 
> + * All rights reserved.
> + *
> + * 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.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
> + *
> + * $FreeBSD$
> + */
> +
> +__fenv_static inline int
> +feclearexcept(int excepts)
> +{
> +   union __fpscr __r;
> +
> +   if (excepts & FE_INVALID)
> +   excepts |= FE_ALL_INVALID;
> +   __mffs(&__r);
> +   __r.__bits.__reg &= ~excepts;
> +   __mtfsf(__r);
> +   return (0);
> +}
> +
> +
> +__fenv_static inline int
> +fegetexceptflag(fexcept_t *flagp, int excepts)
> +{
> +   union __fpscr __r;
> +
> +   __mffs(&__r);
> +   *flagp = __r.__bits.__reg & excepts;
> +   return (0)

[PATCH 2/2] Added weak and strong APA definition

2020-06-02 Thread Richi Dubey
---
 user/glossary/index.rst | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/user/glossary/index.rst b/user/glossary/index.rst
index 5648b39..082483d 100644
--- a/user/glossary/index.rst
+++ b/user/glossary/index.rst
@@ -16,6 +16,22 @@ Glossary
 
   APA
 Arbitrary Processor Affinity
+
+Weak APA: Invariant for this model states that for any backlogged 
task(task not 
+yet assigned a processor), all the processors in its affinity mask are 
+occupied by higher-priority tasks. That is, there is no candidate
+task for preemption scheduled on any of the processors(in a backlogged
+task's affinity mask) on which the backlogged task may execute. Linux's
+push-pull scheduling is an example of weak-APA scheduling.
+
+Strong APA: In this model, on the arrival of a task, every task reachable
+from the newly arrived task is checked to see if an existing task can
+be shifted(or deallocated its processor) and newly arrived task can take 
+its place if the newly arrived task has a higher priority. Similar 
analysis is
+done when a task finishes its execution.
+
+Learn more at: https://people.mpi-sws.org/~bbb/papers/talks/rtss14f.pdf
+
 
   API
 Application Programming Interface
@@ -145,4 +161,4 @@ Glossary
 Waf build system.  For more information see http://www.waf.io/
 
   YAFFS2
-`Yet Another Flash File System version 2 
`_
+`Yet Another Flash File System version 2 

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/2] Adding strong and weak definitions

2020-06-02 Thread Richi Dubey
---
 user/glossary/index.rst | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/user/glossary/index.rst b/user/glossary/index.rst
index 5648b39..2ae0fdf 100644
--- a/user/glossary/index.rst
+++ b/user/glossary/index.rst
@@ -16,6 +16,21 @@ Glossary
 
   APA
 Arbitrary Processor Affinity
+
+Weak APA: Invariant for this model states that for any backlogged 
task(task not 
+yet assigned a processor), all the processors in its affinity mask are 
+occupied by higher-priority tasks. That is, there is no candidate
+task for preemption scheduled on any of the processors(in a backlogged
+task's affinity mask) on which the backlogged task may execute. Linux's
+push-pull scheduling is an example of weak-APA scheduling.
+
+Strong APA: In this model, on the arrival of a task, every task reachable
+from the newly arrived task is checked to see if an existing task can
+be shifted(or deallocated its processor) and newly arrived task can take 
+its place if the newly arrived task has a higher priority. Similar 
analysis is
+done when a task finishes its execution.
+
+Learn more at: https://people.mpi-sws.org/~bbb/papers/talks/rtss14f.pdf
 
   API
 Application Programming Interface
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 2/2] Added weak and strong APA definition

2020-06-02 Thread Richi Dubey
Sorry, Please ignore this patch. I made unneeded changes in other
parts of the glossary.

On Tue, Jun 2, 2020 at 7:16 PM Richi Dubey  wrote:
>
> ---
>  user/glossary/index.rst | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/user/glossary/index.rst b/user/glossary/index.rst
> index 5648b39..082483d 100644
> --- a/user/glossary/index.rst
> +++ b/user/glossary/index.rst
> @@ -16,6 +16,22 @@ Glossary
>
>APA
>  Arbitrary Processor Affinity
> +
> +Weak APA: Invariant for this model states that for any backlogged 
> task(task not
> +yet assigned a processor), all the processors in its affinity mask are
> +occupied by higher-priority tasks. That is, there is no candidate
> +task for preemption scheduled on any of the processors(in a backlogged
> +task's affinity mask) on which the backlogged task may execute. Linux's
> +push-pull scheduling is an example of weak-APA scheduling.
> +
> +Strong APA: In this model, on the arrival of a task, every task reachable
> +from the newly arrived task is checked to see if an existing task can
> +be shifted(or deallocated its processor) and newly arrived task can take
> +its place if the newly arrived task has a higher priority. Similar 
> analysis is
> +done when a task finishes its execution.
> +
> +Learn more at: https://people.mpi-sws.org/~bbb/papers/talks/rtss14f.pdf
> +
>
>API
>  Application Programming Interface
> @@ -145,4 +161,4 @@ Glossary
>  Waf build system.  For more information see http://www.waf.io/
>
>YAFFS2
> -`Yet Another Flash File System version 2 
> `_
> +`Yet Another Flash File System version 2 
> 
> --
> 2.17.1
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Patches for adding various tests

2020-06-02 Thread Eshan Dhawan
Hello everyone,
I sent this patches earlier to add tests.
But these couldn't get reviewed due to release approaching
I would like to request everyone to review these

Patch to add more fenv functions to psxfenv01
- https://lists.rtems.org/pipermail/devel/2020-April/059500.html

Patch to add timer_create() for CLOCK_MONOTONIC
- https://lists.rtems.org/pipermail/devel/2020-April/059474.html

-- 
Thanks
- Eshan
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel