On 2020-04-21 07:18, John Paul Adrian Glaubitz wrote:
Hi Mathieu!
On 4/21/20 11:26 AM, Mathieu Malaterre wrote:
Dear Debian-kernel team,
Would it be possible to ship an alternate ppc64 kernel build without
the 64K page option ?
Could someone please clarify if this is possible/acceptable ? The new
ppc64 kernel would not be the default but could be installed on G5
machine after installation.
Another kernel flavor for powerpc64 is surely possible. It should be
called -4k though as Debian does not allow uppercase letters in
package names.
On sh4, we also have two different flavors, see [1].
I suggest creating a branch in your Salsa home project with the necessary
changes and then open a pull request. It should be mostly copy and paste
work.
What problems ?
I installed with the 2020-04-18 a few days ago and then instantly cooked
up a new kernel and I don't see issues anywhere. Is there some pagesize
issue with big-endian ppc64 ?
Example :
enceladus$
enceladus$ uname -a
Linux enceladus 5.7.0-rc2 #1 SMP Mon Apr 20 02:51:45 UTC 2020 ppc64
GNU/Linux
enceladus$
enceladus$ cat -n /tmp/foo.c
1
2
/*********************************************************************
3 * The Open Group Base Specifications Issue 6
4 * IEEE Std 1003.1, 2004 Edition
5 *
6 * An XSI-conforming application should ensure that the feature
7 * test macro _XOPEN_SOURCE is defined with the value 600 before
8 * inclusion of any header. This is needed to enable the
9 * functionality described in The _POSIX_C_SOURCE Feature Test
10 * Macro and in addition to enable the XSI extension.
11 *
12
*********************************************************************/
13 #define _XOPEN_SOURCE 600
14
15 #include <locale.h>
16 #include <stddef.h>
17 #include <stdint.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <stdarg.h>
21 #include <string.h>
22 #include <inttypes.h>
23 #include <unistd.h>
24 #include <sys/resource.h>
25 #include <sys/utsname.h>
26 #include <math.h>
27 #include <fenv.h>
28
29 int sysinfo(void);
30 uint64_t system_memory(void);
31
32 int main(int argc, char **argv)
33 {
34
35 setlocale( LC_ALL, "C" );
36 sysinfo();
37
38 return( EXIT_SUCCESS );
39
40 }
41
42 int sysinfo(void) {
43
44 struct utsname uname_data;
45 uint64_t sysmem = system_memory();
46 uint64_t pagesize = (uint64_t)sysconf(_SC_PAGESIZE);
47 int fp_round_mode;
48
49 /* can we guess the architecture endianess? */
50 int end_check = 1;
51 int little_endian = (*(uint8_t*)&end_check == 1) ? 1 : 0;
52
53 setlocale( LC_MESSAGES, "C" );
54 if ( uname( &uname_data ) < 0 ) {
55 fprintf ( stderr,
56 "WARNING : Could not attain system uname
data.\n" );
57 perror ( "uname" );
58 } else {
59 printf ( "-------------------------------" );
60 printf ( "------------------------------\n" );
61 printf ( " system name = %s\n",
uname_data.sysname );
62 printf ( " node name = %s\n",
uname_data.nodename );
63 printf ( " release = %s\n",
uname_data.release );
64 printf ( " version = %s\n",
uname_data.version );
65 printf ( " machine = %s\n",
uname_data.machine );
66 printf ( " page size = %" PRIu64 "\n",
pagesize );
67 printf ( " avail memory = %" PRIu64 "\n",
sysmem );
68 printf ( " = %" PRIu64 " kB\n",
sysmem/1024 );
69 printf ( " = %" PRIu64 " MB\n",
sysmem/1048576 );
70 /*
71 * this doesn't really work for memory size near GB
boundaries
72 *
73 * if ( sysmem > ( 1024 * 1048576 ) ) {
74 * printf ( " = %" PRIu64 " GB\n",
75 * sysmem/( 1024 * 1048576 ) );
76 * }
77 */
78 /* get the current floating point rounding mode */
79
80 printf ( " endian = ");
81 if ( little_endian ) {
82 printf ( "little");
83 } else {
84 printf ( "big");
85 }
86 printf ( " endian\n" );
87
88 printf ( " sizeof(unsigned long) = %i\n",
sizeof(unsigned long) );
89 printf ( " sizeof(int) = %i\n", sizeof(int) );
90 printf ( " sizeof(void*) = %i\n", sizeof(void*) );
91
92 fp_round_mode = fegetround();
93 printf(" fp rounding mode is ");
94 switch(fp_round_mode){
95 case FE_TONEAREST:
96 printf("FE_TONEAREST\n");
97 break;
98 case FE_TOWARDZERO:
99 printf("FE_TOWARDZERO\n");
100 break;
101 case FE_UPWARD:
102 printf("FE_UPWARD\n");
103 break;
104 case FE_DOWNWARD:
105 printf("FE_DOWNWARD\n");
106 break;
107 default:
108 printf("bloody unknown!\n");
109 break;
110 }
111
112 printf ( "-------------------------------" );
113 printf ( "------------------------------" );
114 }
115 printf ("\n");
116
117 return ( EXIT_SUCCESS );
118
119 }
120
121 uint64_t system_memory()
122 {
123 /* should return the amount of memory available in bytes */
124 long en;
125 uint64_t pages, page_size;
126
127 en = sysconf(_SC_PHYS_PAGES);
128 if ( en < 0 ){
129 perror("sysconf(_SC_PHYS_PAGES) : ");
130 exit(EXIT_FAILURE);
131 }
132 pages = (uint64_t) en;
133
134 page_size = (uint64_t)sysconf(_SC_PAGE_SIZE);
135 return ( pages * page_size );
136
137 }
138
enceladus$
enceladus$ $CC $CFLAGS $CPPFLAGS -o /tmp/foo /tmp/foo.c -lm
enceladus$ /tmp/foo
-------------------------------------------------------------
system name = Linux
node name = enceladus
release = 5.7.0-rc2
version = #1 SMP Mon Apr 20 02:51:45 UTC 2020
machine = ppc64
page size = 65536
avail memory = 8347320320
= 8151680 kB
= 7960 MB
endian = big endian
sizeof(unsigned long) = 8
sizeof(int) = 4
sizeof(void*) = 8
fp rounding mode is FE_TONEAREST
-------------------------------------------------------------
enceladus$
Should pagesize be reduced down to 4096 bytes for some reason ?
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
ps:
enceladus$
enceladus$ echo $CC
/usr/bin/gcc
enceladus$
enceladus$ echo $CFLAGS
-std=iso9899:1999 -pedantic -fno-builtin -g -m64 -mcpu=970 -mno-altivec
-mno-isel -mno-vsx -mno-crypto -mno-htm -mno-quad-memory-atomic
-mfull-toc -mno-multiple -mupdate -mno-avoid-indexed-addresses
-ffp-contract=off -mno-mulhw -mno-dlmzb -mno-bit-align -mno-strict-align
-mbig -mregnames -mno-recip -fno-unsafe-math-optimizations
enceladus$
enceladus$ echo $CPPFLAGS
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE
-D_X_OPEN_SOURCE=600
enceladus$
enceladus$