forked from ibm-power-utilities/librtas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangelog
1776 lines (1273 loc) · 69 KB
/
Changelog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Changelog for librtas-2.0.5
=======================================
commit 8aee694e8070be4f16db9d52556f1fd33421ed35
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Oct 9 14:35:10 2023 -0700
ci: update package index in qemu jobs
Looks like this is necessary after all.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 0bba0c5282960cb8fbf57de72973a158ca7e1c53
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Oct 9 14:35:09 2023 -0700
librtas: fix buffer length determination in rtas_set_sysparm()
The data passed by callers has this layout:
struct {
uint8_t len_msb;
uint8_t len_lsb;
char payload[];
};
I.e. the length of valid data in payload[] is stored in the first two
bytes of the buffer. However, rtas_set_sysparm() wrongly assumes that
the length is in host-endian, leading to miscalculation of allocation
and copy sizes.
For example, given this code in rtas_set_sysparm():
int rtas_set_sysparm(unsigned int parameter, char *data) {
...
size = *(short *)data;
...
memcpy(kernbuf, data, size + sizeof(short));
...
}
on little-endian targets, the following code:
struct {
uint16_t len_be;
char data[1024];
} sp_block = {
.len_be = htobe16(sizeof"hello"),
.data = "hello",
};
rtas_set_sysparm(0, (char *)&sp_block);
results in a copy of size ((6 << 8) + 2) = 1538, reading beyond the
end of the passed object.
Similarly, objects with an encoded size of 256 or greater will result
in copying too little data.
Extract the size from the buffer correctly, always treating it as
big-endian.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 0a8a540e1fb8855febbfbc6d15ed494aa16c53d8
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Aug 10 09:47:52 2023 -0500
ci: switch Fedora registry locations
I had thought registry.fedoraproject.org was preferable for their
images, but with rawhide (not latest) pulls we're seeing:
Trying to pull registry.fedoraproject.org/fedora:rawhide...
Error: choosing an image from manifest list
docker://registry.fedoraproject.org/fedora:rawhide: no image found in
manifest list for architecture amd64, variant "", OS linux
And it's happening for me locally too. Switch to docker.io.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 4b23104d5c91975d44ae1b13b94046b1eb0452d9
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Aug 9 19:04:47 2023 -0500
new test: rtas_set_debug
Ensure rtas_set_debug() returns 0 without altering errno for a range
of reasonable values. Anything other behavior would be an ABI break
at this point.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 617bc187bc6543a6ece2031985aad52aa287e5e0
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Aug 9 16:26:19 2023 -0500
librtas: revert unintended printf in rtas_get_vpd()
Commit 629856c6f661 ("librtas: fix printf format signedness
mismatches") inadvertently replaced a use of the dbg() macro in
rtas_get_vpd() with a call to printf(). Revert that part of the
commit, and add a necessary newline to the debug message.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit fac8fcf98695edcad2cd8f44b162c12393d96c6e
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Aug 9 13:29:07 2023 -0500
ci: ensure -Werror in runner-native builds
Commit 7874574f5026 ("ci: parameterize runner-native builds on
cflags") inadvertently disabled -Werror for the runner-native builds
since it uses build-with's --cflags option to override the default.
Add -Werror to both cases in the matrix.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit ca4c1d20c4061352330bd653d373715220488552
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Aug 7 13:23:42 2023 -0500
ci: add cppcheck workflow
Run cppcheck twice:
* First with relatively narrow criteria that will fail the run when
violated.
* Next with a wider set of checks that is a superset of the
first. This reports a variety of issues that may or may not be worth
fixing, and will never fail the run.
When a class of issues in the second set is fixed, the first cppcheck
run should be ratcheted up to match. E.g. if all portability
diagnostics are addressed, the 'portability' key should be added to
the --enable=... argument of the first cppcheck invocation.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit b7c5f844aacf0d824c567d89e677c180f5043993
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Tue Aug 8 15:01:33 2023 -0500
configure.ac: set default compile flags at configure time
Define default compiler flags at configure time, using
ax_append_compile_flags() from the Autoconf archive to apply only
those supported by the selected compiler.
At this point the project builds cleanly with recent Clang and GCC
using -Wall and -Wextra. So far the only warning from -Wextra we need
to suppress is -Wno-unused-parameter.
Some warnings depend on higher optimization levels to work, and -O2 is
commonly used by distros. Use -O2 as the default optimization level.
Much of this code was written in the early 2000s, before C11, and has
been relatively undisturbed since. For now, specify gnu99 for the C
dialect instead of accepting the compiler default. I believe it should
be relatively easy to update this though.
Users and packagers are of course free to supplement or override these
default flags using the conventional methods, e.g.:
$ ./configure CFLAGS=-Werror # treat warnings as errors
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit f060d6b6fa6e9c94ad07d34690d37c8c76881a70
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Aug 7 17:00:12 2023 -0500
librtasevent: 'format' function attribute for printf-style functions
Clang (but not GCC) says:
librtasevent_src/print_rtas_event.c:146:61: error: format string is
not a string literal [-Werror,-Wformat-nonliteral]
offset += vsnprintf(buf + offset, sizeof(buf) - offset, fmt, ap);
^~~
librtasevent_src/print_rtas_event.c:314:52: error: format string is
not a string literal [-Werror,-Wformat-nonliteral]
tmpbuf_len = vsnprintf(tmpbuf, sizeof(tmpbuf), fmt, ap);
Adding a 'format' function attribute to print_scn_title() and
rtas_print() yields the following warnings:
*** fixme ***
Fix the fallout.
Notably, this found longstanding bugs in print_re_post_scn(), which
passes pointers where integers are specified by format strings. These
sites have been fixed to print the contents of the structure fields
they were intended to report.
See discussion of -Wformat-nonliteral at
https://clang.llvm.org/docs/AttributeReference.html#format
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 742ca68b2cb330a7252d6d8c936115d4687feed0
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Aug 3 07:42:23 2023 -0500
fix -Wsign-compare warnings
librtas_src/syscall_calls.c:1381:33: error: comparison of integer
expressions of different signedness: '__uint32_t' {aka 'unsigned int'}
and 'int' [-Werror=sign-compare]
1381 | if (be32toh(resp_bytes) > *work_area_bytes) {
| ^
librtas_src/syscall_rmo.c: In function 'get_phys_region':
librtas_src/syscall_rmo.c:242:42: error: comparison of integer
expressions of different signedness: 'int' and 'uint32_t' {aka
'unsigned int'} [-Werror=sign-compare]
242 | if ((i * WORK_AREA_SIZE) >= kregion->size)
| ^~
librtas_src/syscall_rmo.c: In function 'release_phys_region':
librtas_src/syscall_rmo.c:291:18: error: comparison of integer
expressions of different signedness: 'uint64_t' {aka 'long unsigned
int'} and 'int' [-Werror=sign-compare]
291 | if (bits != ((1 << n_pages) - 1)) {
| ^~
librtasevent_src/get_rtas_event.c: In function 'parse_rtas_event':
librtasevent_src/get_rtas_event.c:411:26: error: comparison of integer
expressions of different signedness: 'uint32_t' {aka 'unsigned int'}
and 'int' [-Werror=sign-compare]
411 | if (re->event_length > buflen) {
| ^
librtasevent_src/rtas_srcfru.c: In function 'print_fru_mr_scn':
librtasevent_src/rtas_srcfru.c:518:19: error: comparison of integer
expressions of different signedness: 'int' and 'uint32_t' {aka
'unsigned int'} [-Werror=sign-compare]
518 | for (i = 0; i < frumr_num_callouts(fru_mr); i++) {
| ^
This is a step toward enabling a more strict set of warnings by
default.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 7129aa91e1899eddc5d2116f16e611ceae162b85
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Aug 3 07:37:47 2023 -0500
librtas: fix printf format signedness mismatches
Fix all instances of signed/unsigned format mismatches with use of the
dbg() macro, e.g.
librtas_src/syscall_calls.c:1209:13: error: format '%d' expects
argument of type 'int', but argument 2 has type 'unsigned int'
[-Werror=format=]
1209 | dbg("(%d, %p) = %d\n", parameter, data, rc ? rc : status);
| ^~~~~~~~~~~~~~~~~ ~~~~~~~~~
| |
| unsigned int
This is a step toward enabling a more strict set of warnings by
default.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 58e24d71ea30e9507350f4ede10f99a1b77cad5d
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Aug 2 11:45:18 2023 -0500
librtas: fix cppcheck uninitialized variable warning
cppcheck (somewhat dubiously) warns:
Checking librtas_src/syscall_rmo.c ...
librtas_src/syscall_rmo.c:76:6: warning: Uninitialized variable: fd [uninitvar]
if (fd < 0)
^
librtas_src/syscall_rmo.c:69:16: note: Assuming condition is false
for (i = 0; i < npaths; i++) {
But it's easy enough to satisfy it by making npaths const. This makes
the project "clean" for cppcheck's default behavior, without
additional checks enabled.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit f463aa42278a3ce0b328dd75c45e337f1c7cbc72
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Jul 17 13:45:09 2023 -0500
tests: add simple link and rtld tests
link_librtas: ensure we can link librtas and call a function in it.
dlopen_librtas: ensure we can dlopen librtas.so and look up all API
symbols.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit b62ecd42180d7ac7b32cac6a50802455850a857a
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Jul 17 11:24:51 2023 -0500
build system: add support for cmocka-based tests
Add an --enable-tests switch to configure, which is off by
default. When enabled, check for a recent version of
cmocka (https://cmocka.org/) libraries to build tests with.
It is intended that 'configure --enable-tests' without a suitable
cmocka installation results in an error.
For now, the set of tests is empty.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 2cb840af56da4e592fee3a5dfe7e6c26eb6640cd
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Jul 19 17:32:54 2023 -0500
ci: parameterize runner-native builds on cflags
Add a matrix dimension for compiler flags, allowing us to run+test
with typical production flags as well as sanitizers. Just install the
necessary sanitizer libraries unconditionally.
Ideally we would run with sanitizers enabled in emulation, but
combining sanitizers and qemu gave me no end of trouble. I have found
various reports that sanitizers and user space qemu emulation on Linux
are basically incompatible.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit eddc8a2bc74e2f215ecffa5b2fad1f2fdf8f23b4
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Jul 19 17:31:40 2023 -0500
ci: skip distcheck in qemu runs
I don't think it's too irresponsible to omit distcheck when running in
emulation; the runner-native jobs exercise it fine. This substantially
reduces overall CI runtime.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 9612f6ac0fda9af21cc81c65c3ae71b8ab23af64
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Jul 19 13:38:33 2023 -0500
ci: disable unit tests for cross compiles
So far 'make check' hasn't done anything; we haven't had any
testcases. Changes to follow will add real testcases which we won't be
able to easily build or execute when using these toolchains.
We will get test coverage in the runner-native and qemu-based jobs.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 6626fd7e1b5e55050f861dc0914d8c59fcef7353
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Tue Jul 18 17:46:42 2023 -0500
tools/build-with: various updates
* Add pkgconf and cmocka package lists, for enabling tests.
* Remove the created container by default. This can be overridden with
the new '--keep' option.
* Add --abi-check boolean option, removing the special case for
Alpine. Defaults to true. Update the CI configuration to use this.
* Build configure arguments outside of the here document, making them
easier to manipulate.
* Add --tests boolean option, which determines whether to run 'make
check'. Defaults to true.
* Add --distcheck boolean option, which determines whether to run
'make distcheck'. Defaults to true.
* Add --cflags option, which enables the user to control compiler
flags for the build. This will allow us to flexibly experiment with
things like sanitizers in CI.
* Run 'make check' with VERBOSE=1, so failed test outputs are
displayed.
* Run autoreconf before entering the container, which allows us to use
a read-only volume.
* Use unprivileged user for build and test, which better matches
typical local development practice.
* Implement a workaround for LeakSanitizer internal errors seen only
in CI. When using -fanitize=address, we consistently get spurious test
failures due to some issue with the leak detection pass at the end of
execution:
[==========] tests: Running 1 test(s).
[ RUN ] call_rtas_set_debug
[ OK ] call_rtas_set_debug
[==========] tests: 1 test(s) run.
[ PASSED ] 1 test(s).
==2492==LeakSanitizer has encountered a fatal error.
==2492==HINT: For debugging, try setting environment variable
LSAN_OPTIONS=verbosity=1:log_threads=1
==2492==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
FAIL tests/link_librtas (exit status: 1)
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 133ddcfba6ec8dc44867bcacb8360a096bf0f169
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed May 10 22:48:23 2023 -0500
fixes for -Wstrict-prototypes
We should always specify the argument list and types.
librtas_src/librtas.h:55:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
55 | int rtas_activate_firmware();
| ^~~
librtas_src/internal.h:50:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
50 | int interface_exists();
| ^~~
librtas_src/syscall_calls.c:254:5: warning: function declaration isn't a prototype [-Wstrict-prototypes]
254 | int rtas_activate_firmware()
| ^~~~~~~~~~~~~~~~~~~~~~
librtas_src/syscall_rmo.c:309:12: warning: function declaration isn't a prototype [-Wstrict-prototypes]
309 | static int init_workarea_config()
| ^~~~~~~~~~~~~~~~~~~~
librtas_src/syscall_rmo.c:388:5: warning: function declaration isn't a prototype [-Wstrict-prototypes]
388 | int interface_exists()
| ^~~~~~~~~~~~~~~~
librtasevent_src/print_rtas_event.c:62:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
62 | static int (*re_print_fns[])() = {
| ^~~~~~
The only thing noteworthy here is rtas_activate_firmware(), which is
declared in a public header. But updating the declaration to
rtas_activate_firmware(void), which matches the implementation and all
known callers, should not pose any compatibility issues.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 753a2e01dbd2f9da7fcf45302e23d5f73312d522
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Tue Jan 17 13:14:29 2023 -0600
librtas.h: drop extern from function declarations
Reduce clutter in librtas.h by removing all the unnecessary
extern's. No functional change.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit b97bdd69e0f1e70de95446ad6e4f6769f0e6f385
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Apr 24 17:00:54 2023 -0500
Makefile.am: separate library interface versions
Since librtas and librtasevent can experience ABI-related changes
independently, it only makes sense to manage their interface versions
separately. This is consistent with libtool's guidance: the version
tuple supplied to -version-info should be maintained independently of
the package/release version.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 742bef09f06a3dd370de331796e06700f5b7a69c
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Fri Jun 23 11:34:36 2023 -0500
ci: add "native" and QEMU-emulated jobs
Add two more job categories to the workflow:
- qemu-ppc64le-builds: Runs the build as ppc64le code on Fedora latest
and rawhide, as well as on Alpine latest (which achieves musl-libc
coverage). These seem to typically run between seven and twenty
minutes.
- native-builds: These run the build in Fedora latest and rawhide
containers matching the machine architecture of the
runner (presumably x86_64). These take roughly two minutes or
less (rawhide seems consistently faster for some reason).
GCC and Clang are used in both cases.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit ad56fe263f9f39ac4e1cee6501c4150d0476c316
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Fri Apr 28 17:33:36 2023 -0500
ci: cross build matrix rework
- Drop x86_64; we will get that coverage back in a change to come.
- Use the "build-with" script, which enables us to expand coverage to
each of Debian's stable, testing, and unstable tags.
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit c09d6589ee65d0bf1046d1c569abf9441b143cfe
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Jul 3 11:50:55 2023 -0500
ci: tidy workflow configuration
Sort the workflow trigger list, dropping comments that duplicate what
can be found easily in the GH Actions documentation.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit ad163aa18e28e3f5f6b304c5220c70634b09c920
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Fri Jun 30 14:36:42 2023 -0500
add tools/build-with for container-based build and test
This script runs a build (and any tests/checks) from scratch in a
container. The user can specify:
- The distro as well as any additional packages to install.
- The compiler command (e.g. "clang" or "powerpc64le-linux-gnu-gcc").
- Whether to run under QEMU user mode emulation. Currently, this may
be the best option for running ppc64le code in GitHub Actions.
Benefits:
- Enables consistency between local development and CI.
- Can build with a variety of distros and compilers, allowing us to
easily construct build matrices and experiment quickly.
- Allows for build and test in emulation, assuming user has performed
the appropriate QEMU+binfmt setup.
About half of the script is code generated by the argbash utility for
handling command-line arguments:
https://argbash.readthedocs.io/en/latest/
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit e645594877491abfe4b438b767531e519003e2c2
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Apr 27 09:09:20 2023 -0500
add build system support for ABI regression checks
Add a custom abi-check Makefile target that uses the libabigail
abidiff tool to check for ABI breakage.
If an ABI definition for the target arch is not found, such as when
building for x86, emit a message that clearly says the check has been
skipped.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 6f97982fa04a76c5cf78cbc6aa5f937bb5e6d30b
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Apr 27 08:35:08 2023 -0500
add ABI definitions as of v2.0.4
Generated against a v2.0.4 checkout using tools/generate-abi-defs.
Note: these include many visible symbols that are clearly intended for
internal use since they do not have declarations in the shipped
headers: basically every symbol without "rtas" in the name. The
question of whether these can be hidden in future releases is not
addressed in this change.
Future changes to the ABIs of librtas and librtasevent should be
accompanied by updates to these definitions.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit d3a16ed45a1a2050b9e8df7b6e0442f8e6c4b69b
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Apr 27 09:08:30 2023 -0500
add tools/generate-abi-defs script for ABI maintenance
This tool is invoked manually outside of the build system to generate
ABI definitions using the libabigail project's abidw tool:
https://sourceware.org/libabigail/manual/libabigail-overview.html
ABI definitions are generated in a Debian stable/bookworm container
for each of the PowerPC targets that the project has supported over
its life.
About half of the script is code generated by the argbash utility for
handling command line arguments.
https://argbash.readthedocs.io/en/latest/
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 83ff23b51e7e486286c552822140dcdd6cee9ffe
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:25 2023 -0700
convert PAGE_SIZE to WORK_AREA_SIZE
By defining PAGE_SIZE, librtas.h risks conflicts with system
headers. Substitute a new internal constant WORK_AREA_SIZE throughout
the source tree, and update comments accordingly.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes #7
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit b00bfc5402921b0872aaac6741b165dc14a8855d
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:24 2023 -0700
ensure non-powerpc builds do not attempt a real syscall
While we allow non-powerpc builds for the sake of coverage, the fact
that we force __NR_rtas to be defined means that such builds will
generate calls to nonsensical system calls. For example, syscall 255
is inotify_rm_watch on x86_64.
We don't anticipate anyone actually running non-powerpc librtas builds
to the point of attempting the rtas syscall, but it's best to ensure
that the syscall() invocation here always fails in an easily
understood way.
* Drop the local definition of __NR_rtas.
* When targeting powerpc, use SYS_rtas, which should always be
defined.
* When targeting other architectures, use an invalid syscall number to
ensure ENOSYS at runtime.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 620efff512ec1a4bca9b49379e2b42094a22e74c
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:23 2023 -0700
drop obsolete _syscall() usage
This method of invoking a system call without library support has been
deprecated for years (decades?):
https://man7.org/linux/man-pages/man2/_syscall.2.html
It should be safe to drop this in favor of the syscall() facility
implemented by glibc and musl.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit bbfe6453e68a692c0222be559e1243211a331048
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:22 2023 -0700
librtas: internal.h cleanups
Remove trailing whitespace and unnecessary 'extern' for function
declarations.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit e12a3bb2117a106cde2dbe9a1819f9eacf3cb2b1
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:21 2023 -0700
avoid reserved names for inclusion guards in internal header
All identifiers that begin with an underscore and either an uppercase
letter or another underscore are reserved in the C standard.
The identifier changed here is just an inclusion guard and nothing
should be referring to it directly. Alter it to reflect the header
file name, adding a corresponding comment to the #endif that
terminates the guard.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes #4
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit efc3d7091117eb37941b84554945313e2828e5bc
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:20 2023 -0700
rename syscall.h to internal.h
This is librtas's sole internal header and it has more than
syscall-related declarations. Rename it so its function is clear,
updating its inclusion guard to use a non-reserved identifier.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes #4
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 9077f0833cc06606897cb023accac9ba268dad48
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:19 2023 -0700
avoid reserved names for inclusion guards in shipped headers
All identifiers that begin with an underscore and either an uppercase
letter or another underscore are reserved in the C standard.
The identifiers changed here are just inclusion guards and nothing
should be referring to them directly. Alter them to reflect the header
file names, adding corresponding comments to the #endif directives
where missing.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes #4
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit de2dda2fa96cedbc80cd9ec777c79b1afc532d51
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Apr 19 15:11:18 2023 -0700
ci: bump GH actions/checkout to v3
v2 is deprecated.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Changelog for librtas-2.0.4
=======================================
commit 33aa9aee37cfc4bdc93ba4aff25afb962b6a7606
Author: Tyrel Datwyler <tyreld@linux.ibm.com>
Date: Mon Jan 23 11:48:23 2023 -0800
ci: rev Ubuntu action runner from 20.04 -> 22.04
Move from previous LTS release to the latest LTS release. This has the
benefit of also moving gcc-toolchain from gcc-10 -> gcc-11.
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 44d189b070eb04af6d237d52084e703327ea6243
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Tue Aug 2 15:39:02 2022 -0500
rtas_platform_dump: fix uninitialized use of local variable
The Clang Static Analyzer correctly identifies an uninitialized use:
librtas_src/syscall_calls.c:930:6: warning: Branch condition evaluates to a
garbage value [core.uninitialized.Branch]
if (kernbuf)
^~~~~~~
When rtas_platform_dump() is called with a NULL buffer argument,
rtas_free_rmo_buffer() is called with a stack garbage value for the buffer
address, which is ultimately passed to munmap().
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 1116a74b8ed01722957098eb934c0a8c186e2b27
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Mon Aug 1 09:52:51 2022 -0500
configure.ac: discard LOCAL_CHECK_FLAGS
As pointed out by Thomas Petazzoni, unconditionally setting build flags in
this manner is problematic for downstreams, potentially conflicting with
distribution policies.
Drop LOCAL_CHECK_FLAGS and associated m4 code, preserving -Wall in
AM_CFLAGS. This leaves m4/ empty, but removing altogether provokes a
warning from autoreconf, so leave an empty file in the directory.
Fixes #25.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 7e2216265ce2621e48036f4dcd2ea23b032d7eb5
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Jul 13 15:01:33 2022 -0500
update .gitignore
'git status' in a built tree gives:
Untracked files:
(use "git add <file>..." to include in what will be committed)
config.h
config.h.in
librtas.la
librtas_src/ofdt.lo
librtas_src/syscall_calls.lo
librtas_src/syscall_rmo.lo
librtasevent.la
librtasevent_src/get_rtas_event.lo
librtasevent_src/print_rtas_event.lo
librtasevent_src/rtas_cpu.lo
librtasevent_src/rtas_dump.lo
librtasevent_src/rtas_epow.lo
librtasevent_src/rtas_hotplug.lo
librtasevent_src/rtas_io.lo
librtasevent_src/rtas_lri.lo
librtasevent_src/rtas_mem.lo
librtasevent_src/rtas_post.lo
librtasevent_src/rtas_sp.lo
librtasevent_src/rtas_srcfru.lo
librtasevent_src/rtas_v6_misc.lo
librtasevent_src/rtas_vend.lo
libtool
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
stamp-h1
Ideally 'git status' should not report any untracked files after a build.
This reduces the likelihood of accidentally checking in build outputs when
making changes.
Update .gitignore. Add things that aren't ignored but should be,
remove irrelevant patterns, remove comments which don't match current
practice (the git ls-files.. command just gives an error).
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit b51c540e15d00ec0e079d55d83e97ebc9c08fece
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Feb 17 08:27:35 2022 -0600
librtas: drop inline function attributes
There's no real need to specify inline on file-static functions in this
code. The compiler will inline these as it sees fit.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 29ad6be0b4a595441c3093457aaa7432d38ba4be
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Fri Feb 18 08:09:47 2022 -0600
use AC_CONFIG_SRCDIR
This allows configure to verify that the specified source directory
actually contains the project source code.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit ad5868616777037350c2abd720dc547c6141bb52
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Feb 16 16:45:12 2022 -0600
drop AM_PROG_AR
$(AR) isn't used in our build system, so this isn't needed.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 755943eb5d8fabb11977b1d690187f51342328d9
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Feb 16 16:28:47 2022 -0600
drop AC_CANONICAL_TARGET
In autoconf parlance, "target" refers to the type of system for which any
compiler tools in the package produce code. No compiler-like tools here,
drop it.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit e473e2991f4a69438f618aa1c8e55d2f65229a4f
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Feb 16 10:21:26 2022 -0600
remove position-independent executable flags
Seems odd to specify -fPIE, -pie at the top level for a library project.
Libtool takes care of adding -fPIC where it's appropriate.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit a0d932bbbdf23999c6e2d13a5a3b9e796b470263
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Wed Feb 16 09:53:11 2022 -0600
drop redundant ssp-buffer-size specification
It appears that setting ssp-buffer-size to the minimum changes the code
emitted with -fstack-protector but not -fstack-protector-strong or
-fstack-protector-all. We're using -fstack-protector-all so our use of
--param=ssp-buffer-size=1 is redundant.
Examples/background:
https://bugzilla.redhat.com/show_bug.cgi?id=1105456
https://lore.kernel.org/all/1471862567.5256.18.camel@linux.intel.com
https://lwn.net/Articles/584225/
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit f30ebfe896de3712b922fe8a26444bfd29497da4
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Feb 10 13:19:20 2022 -0600
use AM_CPPFLAGS for include directives
Preprocessor search paths are more appropriately set in AM_CPPFLAGS than
AM_CFLAGS.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit 05c043f59d2cae5378a705c1d674c9bad432643b
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Thu Feb 17 08:36:31 2022 -0600
require Autoconf 2.69
Autoscan suggests requiring a minimum version of 2.69, which is a decade
old as of this writing. All Linux distributions we care about supporting
satisfy this.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
commit ee8ed1384b15f24df83f3c9de6eabcac03a2d698
Author: Nathan Lynch <nathanl@linux.ibm.com>
Date: Fri Feb 18 08:50:32 2022 -0600
drop useless librtas.pc
It's impossible that anyone actually uses the librtas.pc generated by the
build since all the flags are completely wrong and don't match the library
name(s) or the installed header paths.
We don't use pkg-config to configure dependencies during our build so we
can drop PKG_PROG_PKG_CONFIG from configure.ac as well.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Changelog for librtas-2.0.3
=======================================
commit c8a4104ac76ceb0eb61d36c6a1b6043ec92e2eb3
Author: Than Ngo <than@redhat.com>
Date: Thu Mar 25 16:13:20 2021 +0100
librtasevent: Fix coverity issues found by Covscan
Error: RESOURCE_LEAK (CWE-772): [#def1]
librtas-2.0.2/librtasevent_src/rtas_srcfru.c:208: alloc_fn: Storage is returned from allocation function "malloc".
librtas-2.0.2/librtasevent_src/rtas_srcfru.c:208: var_assign: Assigning: "src_raw" = storage returned from "malloc(88UL)".
librtas-2.0.2/librtasevent_src/rtas_srcfru.c:216: noescape: Resource "src_raw" is not freed or pointed-to in "memset". [Note: The source code implementation of the function has been overridden by a builtin model.]
librtas-2.0.2/librtasevent_src/rtas_srcfru.c:219: noescape: Resource "src_raw" is not freed or pointed-to in "rtas_copy".
librtas-2.0.2/librtasevent_src/rtas_srcfru.c:220: noescape: Resource "&src_raw->v6hdr" is not freed or pointed-to in "parse_v6_hdr".