Bug#1012077: linuxinfo FTBFS on riscv64

2022-06-04 Thread Paul Wise
Control: severity -1 important

On Sun, 29 May 2022 14:45:29 -0400 Alan Beadle wrote:

> Package: linuxinfo
> Severity: serious
> Tags: ftbfs patch upstream
> Justification: fails to build from source
...
> linuxinfo currently fails to build on riscv64 

Please note that FTBFS bugs on unofficial non-release arches like
riscv64 are not RC and so should only be filed at important severity.

Please note that bugs in specific Debian architectures should be
usertagged properly and XCCed to the architecture mailing list.
Thanks for xiao sheng wen(肖盛文) for fixing this particular bug.

https://wiki.debian.org/Teams/Debbugs/ArchitectureTags
https://www.debian.org/Bugs/Reporting#xcc

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Bug#1012077: linuxinfo FTBFS on riscv64

2022-06-04 Thread Helge Kreutzmann
Hello Alan,
On Sat, Jun 04, 2022 at 08:52:40AM -0400, Alan Beadle wrote:
> It looks like this will always be a complex issue on RISC-V since
> there is such a variety of manufacturers. However I think the
> following would be the best approach.
> 
> First, if there is a uarch field, use that since it will describe the
> design of the cores present, such as Sifive's U74-MC which can be
> licensed to other manufacturers, in a similar way to ARM core IP.
> 
> If there isn't a uarch field, try to use the "model name" field if it
> is present, since on the C910 this seems to replace the uarch field
> (C910 is a core).
> 
> Finally, if neither of those fields exist, the isa field might be ok
> but I would add "unknown core" to the output. The letters at the end
> of the isa field indicate which instruction set extensions are
> present. (i for basic integer support, a for atomics, v for vector,
> etc) So it is useful info, but it is vendor-generic for the most part.

Ok, implented this.

Thanks!

I'll release the new version in the next days and then feedback is
highly welcome (as I cannot try it out myself).

Greetings

   Helge


-- 
  Dr. Helge Kreutzmann deb...@helgefjell.de
   Dipl.-Phys.   http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
   Help keep free software "libre": http://www.ffii.de/


signature.asc
Description: PGP signature


Bug#1012077: linuxinfo FTBFS on riscv64

2022-06-04 Thread Alan Beadle
Hi Helge,

It looks like this will always be a complex issue on RISC-V since
there is such a variety of manufacturers. However I think the
following would be the best approach.

First, if there is a uarch field, use that since it will describe the
design of the cores present, such as Sifive's U74-MC which can be
licensed to other manufacturers, in a similar way to ARM core IP.

If there isn't a uarch field, try to use the "model name" field if it
is present, since on the C910 this seems to replace the uarch field
(C910 is a core).

Finally, if neither of those fields exist, the isa field might be ok
but I would add "unknown core" to the output. The letters at the end
of the isa field indicate which instruction set extensions are
present. (i for basic integer support, a for atomics, v for vector,
etc) So it is useful info, but it is vendor-generic for the most part.

-Alan



Bug#1012077: linuxinfo FTBFS on riscv64

2022-06-04 Thread Helge Kreutzmann
Hello Alan,
hello Bo,
hello Xiao,
hello Tienhock,
I have preliminary support for riscv now locally. However, there is a
design question:

How would you put riscv processors into families? On x86, thats done
be vendor and some marketing label ("AMD" and "Ryzen"). On Alpha,
that's the model (i.e. generation). 

Looking at the cpuinfos you send me, I think the field "isa" is the
suitable one. Is this correct?

If so, what should linuxinfo write:
rv64imafdc → ???
rv64imafdcsu → ???
any other?

Some (but not all) cpuinfo also carry the field uarch. But since this
is not always present, it doesn't look like a good candidate.

Greetings

   Helge

-- 
  Dr. Helge Kreutzmann deb...@helgefjell.de
   Dipl.-Phys.   http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
   Help keep free software "libre": http://www.ffii.de/


signature.asc
Description: PGP signature


Bug#1012077: linuxinfo FTBFS on riscv64

2022-05-30 Thread Helge Kreutzmann
Hello Alan,
On Sun, May 29, 2022 at 02:45:29PM -0400, Alan Beadle wrote:
> Package: linuxinfo
> Version: 3.3.3-1
> Severity: serious
> Tags: ftbfs patch upstream
> Justification: fails to build from source
> X-Debbugs-Cc: ab.bea...@gmail.com
> 
> Dear Maintainer,
> 
> linuxinfo currently fails to build on riscv64 due to this architecture not 
> being
> supported by upstream. I am attaching a patch which adds placeholder support 
> for
> this architecture and allows building the riscv64 debian package from source.
> 
> Please consider applying this patch (or similar) for the next upload.
> In addition, the /proc information below is for a riscv64 VisionFive V1 SBC.


Thanks a lot! This was on my wishlist already.

I'll review and possibly ammend your patch next weekend and then will
proceed with an upload.

Greetings

 Helge

-- 
  Dr. Helge Kreutzmann deb...@helgefjell.de
   Dipl.-Phys.   http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
   Help keep free software "libre": http://www.ffii.de/


signature.asc
Description: PGP signature


Bug#1012077: linuxinfo FTBFS on riscv64

2022-05-29 Thread Alan Beadle
Package: linuxinfo
Version: 3.3.3-1
Severity: serious
Tags: ftbfs patch upstream
Justification: fails to build from source
X-Debbugs-Cc: ab.bea...@gmail.com

Dear Maintainer,

linuxinfo currently fails to build on riscv64 due to this architecture not being
supported by upstream. I am attaching a patch which adds placeholder support for
this architecture and allows building the riscv64 debian package from source.

Please consider applying this patch (or similar) for the next upload.
In addition, the /proc information below is for a riscv64 VisionFive V1 SBC.

Thank you,
-Alan Beadle


-- Package-specific info:
/proc/cpuinfo:
processor   : 0
hart: 1
isa : rv64imafdc
mmu : sv39
uarch   : sifive,u74-mc

processor   : 1
hart: 0
isa : rv64imafdc
mmu : sv39
uarch   : sifive,u74-mc

Size of /proc/kcore:
-r 1 root root 18446744000862892032 May 25 19:58 /proc/kcore

/proc/meminfo:
MemTotal:7351200 kB
MemFree: 1778728 kB
MemAvailable:6685728 kB
Buffers:   75344 kB
Cached:  4719384 kB
SwapCached:0 kB
Active:   894708 kB
Inactive:4391724 kB
Active(anon):460 kB
Inactive(anon):   497556 kB
Active(file): 894248 kB
Inactive(file):  3894168 kB
Unevictable:   15396 kB
Mlocked:   15396 kB
SwapTotal: 0 kB
SwapFree:  0 kB
Dirty:   912 kB
Writeback: 0 kB
AnonPages:507140 kB
Mapped:   260068 kB
Shmem:   628 kB
KReclaimable: 204236 kB
Slab: 241012 kB
SReclaimable: 204236 kB
SUnreclaim:36776 kB
KernelStack:1696 kB
PageTables: 3264 kB
NFS_Unstable:  0 kB
Bounce:0 kB
WritebackTmp:  0 kB
CommitLimit: 3675600 kB
Committed_AS: 687620 kB
VmallocTotal:   67108864 kB
VmallocUsed:6316 kB
VmallocChunk:  0 kB
Percpu:  552 kB
CmaTotal: 655360 kB
CmaFree:  650112 kB
HugePages_Total:   0
HugePages_Free:0
HugePages_Rsvd:0
HugePages_Surp:0
Hugepagesize:   2048 kB
Hugetlb:   0 kB

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: riscv64

Kernel: Linux 5.18.0-starfive-5.18 (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages linuxinfo depends on:
ii  libc6  2.33-7

linuxinfo recommends no packages.

linuxinfo suggests no packages.

-- no debconf information
Index: linuxinfo-3.3.3/linuxinfo.h
===
--- linuxinfo-3.3.3.orig/linuxinfo.h
+++ linuxinfo-3.3.3/linuxinfo.h
@@ -103,6 +103,10 @@
 #define system_avr32
 #endif
 
+#if defined(__riscv)
+#define system_riscv
+#endif
+
 #if (SIZEOF_LONG > 4)
 #define LONGLONG long int
 #define LONGSPEC "%ld"
Index: linuxinfo-3.3.3/linuxinfo_riscv.c
===
--- /dev/null
+++ linuxinfo-3.3.3/linuxinfo_riscv.c
@@ -0,0 +1,25 @@
+/*
+linuxinfo_riscv.c
+
+   This allows compilation on riscv
+
+*/
+
+#include 
+#include "linuxinfo.h"
+
+#ifdef system_riscv
+
+void GetHardwareInfo(int fd, struct hw_stat *hw)
+{
+   sprintf(hw->hw_memory, LONGSPEC, 0);
+
+   hw->hw_processors = 0;
+
+   sprintf(hw->hw_cpuinfo, "%s", "Unknown");
+   sprintf(hw->hw_bogomips, "%0.2f", 0.0);
+   sprintf(hw->hw_megahertz, "?");
+   hw->hw_processors = 0;
+}
+
+#endif /* system_riscv */
Index: linuxinfo-3.3.3/Makefile.am
===
--- linuxinfo-3.3.3.orig/Makefile.am
+++ linuxinfo-3.3.3/Makefile.am
@@ -4,7 +4,8 @@ linuxinfo_SOURCES = linuxinfo.c linuxinf
linuxinfo_alpha.c linuxinfo_ia64.c linuxinfo_intel.c \
linuxinfo_m68k.c linuxinfo_ppc.c linuxinfo_sh.c \
linuxinfo_hppa.c linuxinfo_s390.c linuxinfo_avr.c \
-   linuxinfo_sparc.c linuxinfo_mips.c linuxinfo_unknown.c
+   linuxinfo_sparc.c linuxinfo_mips.c linuxinfo_riscv.c \
+   linuxinfo_unknown.c
 man_MANS  = po4a/linuxinfo.1
 EXTRA_DIST= config.rpath CREDITS
 VERSION  = 3.3.3