News for hackers. Stuff that matters.
Re:A Big Week for RISC-V by miohtama on Sunday February 13, 2022 @06:28AM (#30320982)
> It’s a tradeoff: With RISC-V you get innovation, you can create new extensions, but you lost software compatibility. And more importantly, you lose the guarantee of software compatibility,” he said. Arm’s founders made “that a key tenet, and that will serve us well going forward. I’m confident of that.”

How long does it take until we have server-side Ubuntu Linux and staple applications like PostgreSQL humming nicely on RISC-V? It does not matter if RISC-V has less ported software today, as long as there is clear roadmap when this advantage of ARM will be gone.

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @06:57AM (#30321137)
The Arm guy is talking nonsense as you'd expect. Fedora & the vast majority of packages have been ported to RISC-V since 2016/2017. Debian about a year later. I just started a PostgreSQL server on one of my (four) RISC-V machines here:

  ● postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vend>
     Active: active (running) since Sun 2022-02-13 06:56:50 EST; 1s ago
    Process: 1861715 ExecStartPre=/usr/libexec/postgresql-check-db-dir postgres>
   Main PID: 1861722 (postmaster)
      Tasks: 8 (limit: 9510)
     Memory: 15.6M
        CPU: 262ms
     CGroup: /system.slice/postgresql.service
             ├─1861722 /usr/bin/postmaster -D /var/lib/pgsql/data
             ├─1861746 postgres: logger
             ├─1861752 postgres: checkpointer
             ├─1861753 postgres: background writer
             ├─1861754 postgres: walwriter
             ├─1861755 postgres: autovacuum launcher
             ├─1861756 postgres: stats collector
             └─1861757 postgres: logical replication launcher

  Feb 13 06:56:50 five systemd[1]: Starting PostgreSQL database >
  Feb 13 06:56:50 five postmaster[1861722]: 2022-02-13 06:56:50.>
  Feb 13 06:56:50 five postmaster[1861722]: 2022-02-13 06:56:50.>
  Feb 13 06:56:50 five postmaster[1861722]: 2022-02-13 06:56:50.>
  Feb 13 06:56:50 five postmaster[1861722]: 2022-02-13 06:56:50.>
The biggest problem I had was remembering the name of the Fedora PostgreSQL package and that I had to initdb before starting the service. If the Arm CEO really believes software compatibility/availability is Arm's moat then I'm afraid he's in for a big shock.
Re:A Big Week for RISC-V by jabl on Sunday February 13, 2022 @09:25AM (#30321909)
> Fedora & the vast majority of packages have been ported to RISC-V since 2016/2017. Debian about a year later.

Any idea whether distros are planning to move towards the upcoming RVA22 profile or are they going to remain on GC?

Re:A Big Week for RISC-V by __s on Sunday February 13, 2022 @09:41AM (#30321989)
Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @07:32AM (#30321290)
Which RISC-V machines do you have?
Re:A Big Week for RISC-V by geokon on Sunday February 13, 2022 @08:58AM (#30321786)
While Intel is talking and investing the Chinese are already putting out chips and boards

https://www.cnx-software.com/2022/02/13/arm-or-risc-v-mangop...

https://www.cnx-software.com/2021/12/30/sipeed-lichee-rv-ris...

There are also the expensive dev boards from SiFive as well as the softcores from zepan. I think Alibaba and Rockchip will be available soon as well

Jean-Luc's website is great for tracking this space:

https://www.cnx-software.com/news/risc-v/

Re:A Big Week for RISC-V by FullyFunctional on Sunday February 13, 2022 @06:18PM (#30326595)
That's a cheap shot as the highend has long lead time, but the momentum hasn't died, it has only picked up. Personally I have more RISC-V embedded silicon than I have a count on, but of "application class" (= 64-bit with MMU that can run Linux), I have many boards that spans three completely distinct design origins and backing companies. And it's a multinational mix.

The growth of RISC-V will come from the innovation that the freedom allows. Literally anyone looking to design their own core from scratch will consider RISC-V and many have chosen it (Rivos, Tenstorrent, Esperanto Technologies, Alibaba, and many others I forgot).

EDIT: typos

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @12:29PM (#30323510)
Actually a lot more than 4, but only 4 working at present.

- 2 x HiFive Unleashed

- 2 x HiFive Unmatched

and on the shelf:

- Beagle V Beta (they decided not to proceed)

- PolarFire

- various FPGA-based RISC-V impls, notably a Lattice running PicoRV32

Re:A Big Week for RISC-V by 2Gkashmiri on Sunday February 13, 2022 @09:12AM (#30321852)
how long we have raspberry pi or equivalent priced SBU on risc-v?

my understanding is that would be a gamechanger because many people would be exposed to it. right?

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @12:31PM (#30323534)
It's unlikely to happen for a long time. The only reason the RPi exists is because they can divert some Broadcom chips which are produced in vast volumes for things like set-top boxes, get them for a few dollars, and package them as SBCs.

There was a run of ~ 5 million AllWinner chips and Beagle packaged one into a board which I have, which would have sold for sub $200, but they decided not to pursue the idea.

Re:A Big Week for RISC-V by hajile on Sunday February 13, 2022 @02:35PM (#30324814)
This was the case at first, but they are so big today that there are dedicated RPi chip runs (in fact, I believe they are the only thing using the RPi 4 processor).
Re:A Big Week for RISC-V by fasquoika on Sunday February 13, 2022 @06:38PM (#30326746)
Closer to pi zero than pi 4 but you can order it right now

https://aliexpress.com/item/1005003741287162.html

Re:A Big Week for RISC-V by goodpoint on Sunday February 13, 2022 @08:47AM (#30321743)
> How long does it take until we have server-side Ubuntu Linux

Debian is almost entirely ported to RISC-V and it's been the biggest early adopter.

96% of the packages are ported: https://wiki.debian.org/RISC-V#Progress

What is missing is powerful and inexpensive CPUs. (Easier said than done)

Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @06:35AM (#30321027)
If everyone implements their own custom extensions, you would have to compile your software for each RISC-V device. To be able to do that, the compiler needs to support those extensions. I think that is what was meant with "you lost software compatibility".

Edit: I am mistaken, thanks everyone for educating me.

Re:A Big Week for RISC-V by vbezhenar on Sunday February 13, 2022 @06:42AM (#30321061)
Intel CPUs have plenty of optional extensions. Basically you're building two versions of machine code and choose correct one at runtime.
Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @06:58AM (#30321142)
How would that work if you have a hundred custom extensions?
Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @07:01AM (#30321151)
Apparently it works fine:

  flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
Re:A Big Week for RISC-V by colejohnson66 on Sunday February 13, 2022 @08:21AM (#30321585)
Forgive my ignorance if there’s an answer, but for x86, those extensions don’t overlap (mainly because Intel and AMD avoid stepping on each other). RISC-V doesn’t have a guarantee of non-overlapping vendor extensions, no?
Re:A Big Week for RISC-V by dzaima on Sunday February 13, 2022 @08:33AM (#30321651)
There's no way to prevent overlapping extensions. One could easily make an x86 extension that overlaps with some existing one. There's just as much an incentive to not do that for x86 as there is for RISC-V.

See AMD's SSE5 vs Intel's SSE4 conflict in x86 - both have instructions that the other doesn't have, and some that both have, and, from what I understand, even the instruction formats conflict.

Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @08:45AM (#30321729)
> One could easily make an x86 extension

One cannot easily make an x86 extension because there are approximately ~3 entities on the planet allowed to make x86 extensions.

Re:A Big Week for RISC-V by sudosysgen on Sunday February 13, 2022 @11:26AM (#30322849)
Not really, China also added their own crypto extensions to x86 chips, though under AMD/VIA's license.

I wouldn't be surprised if Sony/Microsoft did too for their consoles.

It's doable if you have enough money to get AMD or VIA to make you a one-off.

Re:A Big Week for RISC-V by dzaima on Sunday February 13, 2022 @08:52AM (#30321759)
Here's my random x86 extension: the byte sequence 0xc5,0xfd,0xd4,0x00 sorts the 64-bit floats in ymm0. It conflicts with AVX2. :)
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @09:03AM (#30321815)
You’ll have trouble shipping that extension. Not because it conflicts with AVX2, but because Intel will sue you for your comparability with the rest of x86.
Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @07:13AM (#30321199)
I wasn't aware that we already have so many extensions. But doesn't the binary get more bloated the more extensions you have?
Re:A Big Week for RISC-V by dzaima on Sunday February 13, 2022 @07:21AM (#30321226)
In practice, at least C compilers don't automatically generate code for multiple extensions, so you get the performance of the base ISA by default. This does indeed mean that every C program for x86-64 that isn't compiled with a specific target architecture just won't ever use AVX/AVX2/AVX-512/any other extension.

There is the idea of profiles, i.e. a single nice name for a group of extensions so that there's something one could provide a precompiled binary for, but I don't know what, if any, are RISC-V's plans for that.

Re:A Big Week for RISC-V by snvzz on Sunday February 13, 2022 @05:22PM (#30326221)
>but I don't know what, if any, are RISC-V's plans for that.

Profiles. See RVA22.

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @12:26PM (#30323478)
With x86 there are common extensions that form a baseline (eg. you need SSE2 for any program to run at all). And there are more specialized extensions, eg. for high performance mathematical work. The specialized extensions can usually be confined to a library, and the library can work out at runtime what the hardware supports and swap in optimized functions.

It'll likely work much the same way for RISC-V, eg. in Fedora we require that the C (compressed) extension is supported, otherwise the distro won't boot, and things like the vector extension will probably be used only by specialized math libraries and the like.

Re:A Big Week for RISC-V by demindiro on Sunday February 13, 2022 @07:22AM (#30321238)
You can choose which extensions to support at compile time and whether this extension is optional. E.g. many binaries don't use AVX at all, while binaries compiled with -march=native may assume that AVX is supported (and emit SIGILL if not).
Re:A Big Week for RISC-V by panick21_ on Monday February 14, 2022 @06:50AM (#30330913)
Open Source software will not adopt 100s of costume extensions. If something becomes a standard it will likely move into a reserved place.
Re:A Big Week for RISC-V by makapuf on Sunday February 13, 2022 @06:44AM (#30321067)
Isn't it the same with some ARM vendors ? Of course, a random foundry can't, but what's preventing Apple from including specific instructions on their core (not that it would make sense) or a specific coprocessor that may or may not be integrated ?
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @08:51AM (#30321754)
Apple does ship custom instructions on their code but does not expose it to third parties: their external compilers will not generate those instructions, and they remain in the kernel and system libraries where they can be hidden behind APIs without being directly exposed.
Re:A Big Week for RISC-V by geokon on Sunday February 13, 2022 @06:42AM (#30321056)
I find it hard to believe there is no way to probe for extensions and provide a fallback

It's a problem that already exists right now.

If you compile code on a machine with SSE or AVX and run it on an old Pentium, does it crash?

I had a fun bug once running ARM code that had some NEON in it and it would crashed on Scaleway's VPS bc their servers ran chips that didn't have NEON implemented

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @06:59AM (#30321145)
This is the standard FUD spread around by Arm apologists. Of course you can detect RISC-V extensions at both compile and run time. In fact it's the first widespread ISA that was designed with extension in mind (so for example there's a uniform way to find instruction boundaries even if you do not know how to fully interpret an extension). This is in stark contrast to x86 where extensions are basically hacks piled on hacks.
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @08:50AM (#30321753)
> so for example there's a uniform way to find instruction boundaries even if you do not know how to fully interpret an extension

This doesn’t make sense, though. If you have something in your instruction stream that you don’t understand, it would be insane to do anything but fault immediately, unless the instruction is some sort of optional feature such as a hint or security mechanism where there is no real behavior associated with it. I mean ARM has this “capability” too by virtue of a fixed length instruction set but it doesn’t do anything with this like you’re describing.

Re:A Big Week for RISC-V by tux3 on Sunday February 13, 2022 @11:30AM (#30322893)
It will be useful for disassemblers, among other things.
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @06:41PM (#30326775)
Sure, it’s helpful but not really a requirement by any means. Normal x86 code tends to be self-synchronizing, for example.
Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @07:25AM (#30321250)
Sorry, my post was not intended to be FUD. I tried to follow the original claim but apparently placed too much merit in it.
Re:A Big Week for RISC-V by ori_b on Sunday February 13, 2022 @08:54AM (#30321771)
> If you compile code on a machine with SSE or AVX and run it on an old Pentium, does it crash?

Yes. Or it leaves them unused on the machine with avx.

For short runs of instructions, the overhead of fallback selection is larger than the overhead of using the least common denominator. For large functions, fallback selection is done by selecting specific functions after benchmarking.

Re:A Big Week for RISC-V by rjsw on Sunday February 13, 2022 @10:04AM (#30322119)
Plenty of open source packages probe for extensions when built for either X86_64 or ARM, then call fallback code if the extension isn't there.

Things like OpenJDK, pixman, nss, ffmpeg.

Re:A Big Week for RISC-V by fake-name on Sunday February 13, 2022 @06:45AM (#30321082)
Something something gentoo is eating the world.
Re:A Big Week for RISC-V by ido on Sunday February 13, 2022 @09:11AM (#30321846)
Maybe this is naive - but why is software compatibility so important for servers (that mostly run open source software, like psql)? I assume none of it is written in ARM/x86 assembly language and all of it in higher level languages like c/c++/python/java/js/etc that can be compiled/run on RISC-V?
Re:A Big Week for RISC-V by pid-1 on Sunday February 13, 2022 @09:24AM (#30321901)
When rpi was a new thing writing Python in it was a pain in the ass. You had to compile a lot of stuff from source, which was a huge time sink.

To this day writing ARM lambdas on AWS has its own gotchas.

Idk, I think their CEO has a point, it's just that it might be a short lived one given how much money Chinese companies are throwing at risc V.

Re:A Big Week for RISC-V by NelsonMinar on Sunday February 13, 2022 @11:29AM (#30322885)
Old timers remember when "compiling open source C code to this other platform" was a real chore. Ever run the old school GNU configure and watched the giant stream of compatibility tests for weird architectures that go by? It's for a reason, one nearly forgotten in our current amd64 monoculture.

The good news is even if the CPU is weird the C compiler is likely to be clang and the OS is likely to be some Linux/glibc variant. A lot of the old porting challenges had to do with OS and compiler differences.

Re:A Big Week for RISC-V by londons_explore on Sunday February 13, 2022 @08:20AM (#30321580)
ARM also has a good chunk of compatibility issues... There are plenty of times I've had ARM7 vs NEON vs thumb vs big endian/little endian issues...

Even today, getting random debian packages running on a raspberry pi, I've hit issues of SIGILL due to packages being compiled with the wrong compiler for my CPU...

Re:A Big Week for RISC-V by stefan_ on Sunday February 13, 2022 @01:28PM (#30324159)
This is just the peak of irony from the guys that couldn't be bothered to copy ACPI for 30 years plus requiring anything running on ARM to set up a bespoke firmware build. That's before you get into all the hard/soft-float, thumb, non-thumb mess and toolchains targeting ARMv6jwzufgka.
Re:A Big Week for RISC-V by makapuf on Sunday February 13, 2022 @06:45AM (#30321077)
You could say the same with ARM wrt intel.
Re:A Big Week for RISC-V by trasz on Sunday February 13, 2022 @08:06AM (#30321504)
Not Linux, but riscv64 FreeBSD works quite well.
Re:A Big Week for RISC-V by upofadown on Sunday February 13, 2022 @09:27AM (#30321912)
OpenBSD has some support with 7.0:

* https://www.openbsd.org/riscv64.html

Re:A Big Week for RISC-V by throw0101a on Sunday February 13, 2022 @08:46AM (#30321734)
Re:A Big Week for RISC-V by snvzz on Sunday February 13, 2022 @08:13AM (#30321542)
So does the RISC-V Haiku port.