Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Marc Glisse

On Thu, 24 Aug 2023, Torbjörn Granlund wrote:


Marc Glisse  writes:

 There is, it is called (u)intptr_t, the standard name for an integer
 type that can hold a pointer.

Right!

I only naively checked intmax_t, assuming max would mean max. :-)


Hmm, for old ABIs gaining a new integer type, I understand why intmax_t 
cannot increase. But for a new ABI like here, it is surprising. I guess 
they consider (u)intptr_t as not a true integer type but just a kind of 
pointer through which they can track memory. That would explain why they 
don't like non-pointer arithmetic on that type.


The failures I get in the testsuite are "Invalid address alignment." 
during temporary allocation, which is not too surprising.


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Torbjörn Granlund
Marc Glisse  writes:

  There is, it is called (u)intptr_t, the standard name for an integer
  type that can hold a pointer.

Right!

I only naively checked intmax_t, assuming max would mean max. :-)


There seem to be a problem with arithmetic on uintptr_t, though.  The
compiler generates a plain "mul" instruction for multiplying two of
these fat integers, which is not quite right.  Admittedly, the compiler
outputs an arm (no pun intended) long warning message:

foo.c:7:12: warning: binary expression on capability types 'uintptr_t' (aka 
'unsigned __intcap') and 'uintptr_t'; it is not clear which should be used as 
the source of provenance; currently provenance is inherited from the left-hand 
side [-Wcheri-provenance]

Not sure what that means, though.  But it probably means "I generate
garbage code from your sources, sorry about that".


-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Marc Glisse

On Thu, 24 Aug 2023, Torbjörn Granlund wrote:


Note the size of pointers, 16 bytes.  There is no integer type mathing
that, so if code tries to cast a pointer through some integer type for,
say, aligning it, things will break.


There is, it is called (u)intptr_t, the standard name for an integer type 
that can hold a pointer.


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Torbjörn Granlund
Marc Glisse  writes:

  Hmm, but with that proposed patch, configure later fails with

  checking size of void *... 16
  checking size of unsigned short... 2
  checking size of unsigned... 4
  checking size of unsigned long... 8
  checking size of mp_limb_t... 8
  configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
  in this configuration expects 32 bits.

  configure --disable-assembly does allow to build the library, but then
  quite a few tests fail with "bus error": t-toom6h, t-toom8h,
  t-toom8-sqr, t-div, t-mulmod_bnm1, ..., t-sizeinbase.

  So more work is needed on the GMP side :-(

Note the size of pointers, 16 bytes.  There is no integer type mathing
that, so if code tries to cast a pointer through some integer type for,
say, aligning it, things will break.

Apparently, this is some sort of research platform.  I have no idea how
hard a GMP port might be,

I've given up trying to make GMP run well on Arm since it is too hard
and too expensive to find hardware for 90% of the Arm cores.  There are
lots of "Fruit Pi" boards, but they all use a small set of processor
cores (essentially A55, A72, and A73) or cost and arm (no pun intended)
and a leg.

But GMP at least runs on most Arm cores, as long as they follow the
standard ABI.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Marc Glisse

On Thu, 24 Aug 2023, Marc Glisse wrote:

It seems that uname -p returns aarch64c, configfsf.guess uses that, and 
configfsf.sub gets confused by that, so it should be reported there. Ah, I 
already see at least

https://lists.gnu.org/archive/html/config-patches/2023-08/msg00043.html
so hopefully it will get discussed / solved there.


Hmm, but with that proposed patch, configure later fails with

checking size of void *... 16
checking size of unsigned short... 2
checking size of unsigned... 4
checking size of unsigned long... 8
checking size of mp_limb_t... 8
configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
in this configuration expects 32 bits.


configure --disable-assembly does allow to build the library, but then 
quite a few tests fail with "bus error": t-toom6h, t-toom8h, t-toom8-sqr, 
t-div, t-mulmod_bnm1, ..., t-sizeinbase.


So more work is needed on the GMP side :-(

I think it is possible to use a more traditional ABI on this computer, but 
that's not interesting.


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Marc Glisse
It seems that uname -p returns aarch64c, configfsf.guess uses that, and 
configfsf.sub gets confused by that, so it should be reported there. Ah, I 
already see at least

https://lists.gnu.org/archive/html/config-patches/2023-08/msg00043.html
so hopefully it will get discussed / solved there.

On Thu, 24 Aug 2023, Paul Zimmermann wrote:


  Hi,

gmp 6.3.0 does not compile on this machine:

zimmerma@cfarm240:~/gmp-6.3.0 $ ./configure
checking build system type... Invalid configuration 
'aarch64c-unknown-freebsd14.0': machine 'aarch64c-unknown' not recognized
configure: error: /bin/sh ./config.sub aarch64c-unknown-freebsd14.0 failed

Should I try a specific ABI?

Paul


Date: Wed, 23 Aug 2023 14:14:47 -0500
From: CFarm Annoucements via cfarm-announces
 
Cc: CFarm Annoucements 

The Compile Farm project is pleased to announce the immediate
availability of cfarm240, an Arm Morello SoC [1] prototype board
running CheriBSD (a FreeBSD derivative).

This system-on-chip research platform [2] features a custom
quad-core aarch64 Neoverse N1-based CPU implementing CHERI [3]
(a memory protection model), and has 32GB system memory. Disk
space is limited (~200GB); be mindful of your resource usage.

We are still in the process of transitioning to our new domain
name and website; please SSH to cfarm240.cfarm.net.

Notes:

  * Morello boards are the only physical implementation of this
ISA; lessons learned will be carried to future Arm extensions,
so binary compatibility with Morello is not guaranteed.

  * You will want to read about packages [4].

  * If you need help with CHERI-specific problems (not Compile
Farm issues), consider joining their Slack [5].

Thank you to the University of Cambridge for hosting
(and developing) this machine!


[1]: https://www.arm.com/architecture/cpu/morello
[2]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-morello.html
[3]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
[4]: https://ctsrd-cheri.github.io/cheribsd-getting-started/packages/index.html
[5]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-slack.html
___
cfarm-announces mailing list
cfarm-announ...@lists.tetaneutral.net
https://lists.tetaneutral.net/listinfo/cfarm-announces


___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs



--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Paul Zimmermann
   Hi,

gmp 6.3.0 does not compile on this machine:

zimmerma@cfarm240:~/gmp-6.3.0 $ ./configure
checking build system type... Invalid configuration 
'aarch64c-unknown-freebsd14.0': machine 'aarch64c-unknown' not recognized
configure: error: /bin/sh ./config.sub aarch64c-unknown-freebsd14.0 failed

Should I try a specific ABI?

Paul

> Date: Wed, 23 Aug 2023 14:14:47 -0500
> From: CFarm Annoucements via cfarm-announces
>  
> Cc: CFarm Annoucements 
> 
> The Compile Farm project is pleased to announce the immediate
> availability of cfarm240, an Arm Morello SoC [1] prototype board
> running CheriBSD (a FreeBSD derivative).
> 
> This system-on-chip research platform [2] features a custom
> quad-core aarch64 Neoverse N1-based CPU implementing CHERI [3]
> (a memory protection model), and has 32GB system memory. Disk
> space is limited (~200GB); be mindful of your resource usage.
> 
> We are still in the process of transitioning to our new domain
> name and website; please SSH to cfarm240.cfarm.net.
> 
> Notes:
> 
>   * Morello boards are the only physical implementation of this
> ISA; lessons learned will be carried to future Arm extensions,
> so binary compatibility with Morello is not guaranteed.
> 
>   * You will want to read about packages [4].
> 
>   * If you need help with CHERI-specific problems (not Compile
> Farm issues), consider joining their Slack [5].
> 
> Thank you to the University of Cambridge for hosting
> (and developing) this machine!
> 
> 
> [1]: https://www.arm.com/architecture/cpu/morello
> [2]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-morello.html
> [3]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
> [4]: 
> https://ctsrd-cheri.github.io/cheribsd-getting-started/packages/index.html
> [5]: https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-slack.html
> ___
> cfarm-announces mailing list
> cfarm-announ...@lists.tetaneutral.net
> https://lists.tetaneutral.net/listinfo/cfarm-announces
> 
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs