forked from ibm-power-utilities/powerpc-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangelog
4191 lines (2960 loc) · 165 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
powerpc-utils-1.3.8
=====================================================================
commit ed7f7c84ba320fac543f88b766587328b5ede63b
Author: Mingming Cao <[email protected]>
Date: Tue Aug 11 16:19:49 2020 -0700
Do not use automatic method (DHCP, PPP, etc) when bond interface is setup
When creating bond, by default the ipv4.method is auto, set to dhcp
In the case of mutiple HNV interfaces, this can case bond interfaces deactive and
active again and again.
So here Set default ipv4 method to disable. Bond is created without IP .
User can configure static IP manually with
nmcli con mod id <bond-name> ipv4.method manual ipv4.address 192.168.2.203/24
As long as each interface is on a different network, then they should be able to
all use dhcp, but the dhcp server would need to support all these different
networks and hand out ips on the different subnets
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 9a4a4a2ec9bb8e9d4e69bd2c482d904bc3b27d7f
Author: Mingming Cao <[email protected]>
Date: Mon Jul 27 21:37:38 2020 -0700
Allow hcnqrydev return success when sr-iov VFs are not active
When the sr-iov VF nextwork interfact in the bond is not up, that means
it is failover to the backup virtual network device already. We should
allow hcnqrydev return success in this case, in other words, means it is
safe to dlpar remove sr-iov VFs.
Also add more system and network status info in show_hcnstatus() and move it to
the end of main function.
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 6bd1f8acdbef807738e2270e3974ceb3b892666d
Author: David Michael <[email protected]>
Date: Fri Aug 7 14:14:57 2020 -0400
ofpathname: Remove the dependency on bc
The only use of bc is to convert between decimal and hexadecimal
integers, but this functionality is supported by POSIX shell
arithmetic expansion and a POSIX-compatible printf program. Since
this script uses #!/bin/bash, the printf utility is a bash builtin,
so it won't even add a dependency on an external printf program
(which is provided by the required coreutils package anyway).
Signed-off-by: David Michael <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit bd8dd36b33cda0d0a72111a9a53fc5fb9a73cdb4
Author: Tyrel Datwyler <[email protected]>
Date: Thu Jul 16 15:36:25 2020 -0700
man: add manpage for the drmgr utility
Historically we have discouraged users from invoking drmgr from the commandline
outside of PCI hotplug, and as such provided no documentation. However, for the
sake of those brave powerusers willing to risk putting their system in a state
inconsistent from that of theassociated managment interface lets add a manpage
with the basic documentation of the various usage options for each of the
dynamic reconfiguration connector types.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 1b27e043f00f8f636bdbc6853d7058ee0a63abf3
Author: Kamalesh Babulal <[email protected]>
Date: Wed Jun 17 21:28:38 2020 +0530
lparstat: Update man page with -E option
lparstat -E option reports the actual and normalized system utilization
based on the PURR/SPURR registers. Update the lparstat man page too with
the -E option details.
Reported-by: Pavithra Prakash <[email protected]>
Signed-off-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 0a9b1f2309291c82e68eeb866174aeb676329ed4
Author: Tyrel Datwyler <[email protected]>
Date: Mon Jun 15 19:51:30 2020 -0500
drmgr: use in-kernel dlpar facility for CPU's when available
The helper kernel_dlpar_exists() now queries whether the kernel supports
dlpar based on connector/drc_type. As such allow dlpar of cpu's via the
kernel interface when available by default.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 267474a488d1a957e7704feb2910cdea2310c8b7
Author: Tyrel Datwyler <[email protected]>
Date: Mon Jun 15 19:51:29 2020 -0500
drmgr: query in-kernel dlpar support by DRC connector type
Support to initiate kernel facilitated dlpar for CPU and MEM was
introduced into drmgr back in 2016 with commit bbc5fc0 however, this
proved problematic for CPU as most distros didn't have in kernel CPU
dlpar support yet. As a result CPU support was disabled with commit
a97c566.
The main issue is that drmgr blindly tests for the existence of
/sys/kernel/dlpar to identify in kernel dlpar support. This test doesn't
reveal if support goes beyond MEM and includes CPU. This further
complicates adding new connector types such as PHB, PCI, and SLOT down
the road, and backwards compatability of newer drmgr on older kernels.
The /sys/kernel/dlpar attribute was extended by the following kernel
commit torvalds/linux@673bc43 that introduced a comma separated list of
device support.
Update drmgr utility to use this mechanism to determine which
device/connector/drc_types are supported by in kernel dlpar.
1.) For the case where /sys/kernel/dlpar does not exist use legacy dlpar
facilities.
2.) For the case where /sys/kernel/dlpar exists but does not
reading we assume only memory support for in kernel and use legacy
all other types.
3.) For the case where /sys/kernel/dlpar exists and is readable we parse
the returned list for supported devices and fall back to legacy
facilities for anything not in the list.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 871646f79bdd6c119c87561952dcf5b528419f67
Author: Mingming Cao <[email protected]>
Date: Sun Jun 28 09:41:51 2020 -0600
Add hcnmgr init systemd service hcn-init.service
After LPAR back online, add service automatically
configure hybrid network created at inactive time.
Update the build process to include the service in build.
configure --with-systemd
OR
rpmbuild -ba powerpc-utils.spec --with systemd
Enable this service after reboot.
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit ae08f34eb8197dee7489fc73dc2e29aa5bbe84bc
Author: Mingming Cao <[email protected]>
Date: Sat Jun 27 08:38:13 2020 -0600
Support inactive migration with migratable SR_IOV
HMC supports adding migratable sr-iov when LPAR is inactive.
This allows inactive LPAR migrates with SR_IOV VFs. HMC will
generate unique HCNID and PHYP the migratable sr-iov device
and it's backup virtual device vnic or veth with same ibm
property ibm,hcn-id. This is done while the partion is inactive.
When LPAR backs online, the OS is responsible to find out the
new migritable SR_IOV configured during LPAR was inactive. This
makes the new SR_IOV added eligible for migration, or able to
re-configure SR_IOV with HCN post migration.
Added function in hcnmgr to scan the device-tree, find
migratable SR_IOV that has no hybrid network being configured,
setting up the active-back bonding with backup matching vnic or
veth. Add new SR_IOV and its backing devices as slave. Skip the HCN
has already been configured online before.
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit ed574ffb81e23169d3327e1f8f22fdfb9ad74390
Author: Mingming Cao <[email protected]>
Date: Fri Jun 26 17:02:00 2020 -0600
Tools to support migrtable SR_IOV hybrid virtual network
A LPAR that utilizes an SR-IOV logical port (physical device) cannot be
migrated. To allow SR_IOV eligiable for live partition migration, HMC can
configures a virtual device (virtual ethernet or virtual NIC) as a backup
for each SR-IOV logical port and performs failover network operations to
the virtual device before migration. After migration, then performs
failover network operations again to the SR-IOV logical ports.
When HMC configure an migratiable SR_IOV device, the hypervisor will set
unique hybrid network ID (HCN ID) propterty for the SR_IOV and backup
virtual device. And instruct Guest OS to configre hybrid network.
Guest OS will able to recoganize them and configure hybrid
network. This patch introduces new commands from HMC to linux to configure an
active-backup bonding with the SR-IOV logical port as the primary device and
a virtual device such as a virtual Ethernet device or vNIC device as the
backup device.
hcncfrdrc -- configure migratable SR_IOV hybrid virtual network (HCN) before
or right after migration
hcnqrydev -- pre-migration, query SR_IOV device has active backup virtual device
hcnrmdev -- remove migritable SR_IOV device from HCN right before migration
hcnrmhcn -- clean up hybrid virtual network when remove migratable SR_IOV
hcnversion -- returns current HCN support version back to HMC
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit b289196aa9d9cd02c5d1b7e46cfa6403ea4fbbad
Author: Joel Stanley <[email protected]>
Date: Mon Jul 13 13:20:25 2020 -0700
Update smt snooze delay documentation
Mostly remove it now that it is not used. A mention is left in the
readme so archaeologists can work out where it went.
Signed-off-by: Joel Stanley <[email protected]>
[tyreld: fixed type of setting in README]
Signed-off-by: Tyrel Datwyler <[email protected]>
commit c788e4802205265e653a884e2f0d2dce17e03d2c
Author: Joel Stanley <[email protected]>
Date: Mon Jul 13 13:20:24 2020 -0700
ppc64_cpu: Remove smt_snooze_delay
The kernel has not supported setting the snooze delay through this API
since at least 2014 (v3.14). The sysfs file is present for
compatibility, but it has no effect.
The lack of this sysfs file means we must use a different method for
ppc64_cpu to detect the smt state of the box. It now uses the
threads_per_cpu count from the device tree.
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 3a4617187b300b8c369ca0e30deeb22143dfc2c8
Author: Joel Stanley <[email protected]>
Date: Mon Jul 13 13:20:23 2020 -0700
Modify is_smt_capable to not use smt_snooze_delay
The sysfs file is present for compatibility, but it has no effect. Use
the presence of more than one thread per cpu, which comes from the device
tree, to determine SMT capability.
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 7289eb429e293e33418cc68c922e9c2f61ffd82f
Author: Joel Stanley <[email protected]>
Date: Thu Jul 9 17:20:34 2020 -0700
travis: Add basic CI configuration
This builds the applications on ppc64le with librtas.
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit ab1462b9c5644e8dbf75b42e69ffa13b1b7c2370
Author: Joel Stanley <[email protected]>
Date: Thu Jul 9 17:20:33 2020 -0700
gitignore: don't ignore .*
This includes files such as .travis.yml file that will be part of the
repository.
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 937780a5fcbd887352e458f32a860c67164a2c14
Author: Tyrel Datwyler <[email protected]>
Date: Wed Jun 24 17:25:35 2020 -0500
ofpathname: make goto_dir canonicalize directory argument
Commit c97fe35b5b6d "ofpathname: speed up l2of_scsi()" attempted to
optimize the look up of scsi devices by restricting the base directory
input of the 'find' command to /sys/class/block instead of /sys. This
works as intended for raw scsi disks such as sda, but broke for scsi disk
partitions such as sda1.
(0) root @ linux-td1r: /root/powerpc-utils
$ ./scripts/ofpathname /dev/sda1
: Logical device "/dev/sda1" does not appear
to be configured.
(1) root @ linux-td1r: /root/powerpc-utils
$ ./scripts/ofpathname /dev/sda
/vdevice/v-scsi@30000066/disk@8100000000000000
The differences in looking up sda1 via /sys/class/block vs /sys:
(0) root @ linux-td1r: /root/powerpc-utils
$ find /sys/class/block -name sda1
/sys/class/block/sda1
(0) root @ linux-td1r: /root/powerpc-utils
$ find /sys -name sda1
/sys/devices/vio/30000066/host0/target0:0:1/0:0:1:0/block/sda/sda1
/sys/class/block/sda1
In the end /sys/class/block/sda1 is just a symlink to sda1 under /sys/devices/vio/...
(0) root @ linux-td1r: /root/powerpc-utils
$ ll /sys/class/block/sda1
lrwxrwxrwx 1 root root 0 Jun 22 18:56 /sys/class/block/sda1 ->
../../devices/vio/30000066/host0/target0:0:1/0:0:1:0/block/sda/sda1
However, ofpathname assumes that by moving up to the parent we will
eventually find the raw disk device, in the above example sda, and this
will only happen for paths under /sys/devices in the case of scsi disk
partitions.
Fix this regression by using readlink in goto_dir() to canonicalize the
path name of the device while following all symlinks.
Fixes: c97fe35b5b6d ("ofpathname: speed up l2of_scsi()")
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 60d9f54b13b75feee3fd7b25a92b24d0d97ea984
Author: Tyrel Datwyler <[email protected]>
Date: Tue Jun 9 12:48:38 2020 -0700
drmgr: don't bother with hp children for non PCI slots
Only PCI devices have hotpluggable children. So, there is no need to call
disable_hp_children() or release_hp_children() for non-PCI devices. In
particular this causes messages for VIO slots, that while harmless, could lead a
user to misinterpret as actual errors.
linux-xej6:~/powerpc-utils # drmgr -c slot -r -s U8408.E8E.10A7ACV-V1-C3
Validating I/O DLPAR capability...yes.
failed to open /sys/bus/pci/slots/U8408.E8E.10A7ACV-V1-C3/power: No such file or directory
failed to disable hotplug children
In remove_slot() check that the device type is PCI_DLPAR_DEV before calling
(disable|release)_hp_children().
Signed-off-by: Tyrel Datwyler <[email protected]>
commit cac0e6b68136d9e18eecb3321b9141f98c819b97
Author: Tyrel Datwyler <[email protected]>
Date: Tue Jun 9 12:34:41 2020 -0700
README: add Subscribe link and updated ppc64-diag repo link
Added a mailing list subscribe link. This is helpful for users/developers tyring
to subscribe to the list who may want to use an email address other than a gmail
address. The list is hosted through googlegroups and there is no obvious way
to subscribe using a non-gmail address through their web interface.
The ppc64-diag package has since been migrate from Sourceforge to Github. So the
repository location link has been updated accordingly.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit f8f2f09c413838fe9f0b30478de5d08bdb3e95aa
Author: John Paul Adrian Glaubitz <[email protected]>
Date: Sun Apr 19 11:35:08 2020 +0200
ofpathname: Add support for Mac-compatible OF pathnames
On Macintosh systems, OpenFirmware path follow a slightly
different syntax as compared to other OF systems. In particular,
the disk ID is not preceeded by the string "disk" and - on
SATA systems - the path does not contain the BUS ID as
"scsi@ID" but rather the plug ID in the form "@ID".
Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
Reviewed-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 3fb2c44e220c3051b2593f27105a94208266775d
Author: John Paul Adrian Glaubitz <[email protected]>
Date: Sun Apr 19 11:35:07 2020 +0200
ofpathname: Add support for the plug ID of a SCSI/SATA host
Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
Reviewd-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit a3555d297e963c86b0b9e0e266c5aa8ae6827d87
Author: John Paul Adrian Glaubitz <[email protected]>
Date: Sun Apr 19 11:35:06 2020 +0200
ofpathname: Add partition support to l2of_ide() and l2of_scsi()
Currently, only l2of_nvme() supports handling of partitions which
will print the partition number at the end of an OF path. However,
this feature is also useful for IDE and SCSI targets as well and
mandatory for Macintosh systems.
Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
Reviewed-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit b38076f3022dd0ec9c86df7c792285686b049b2a
Author: Tyrel Datwyler <[email protected]>
Date: Fri May 29 18:08:04 2020 -0500
drmgr: don't treat pmig as unsupported when -m is omitted
If drmgr is invoked for the pmig connector type but the -m option is
not specified get_command() treats the connector type as unsupported.
(1) root @ linux-td1r: /root/powerpc-utils
Dynamic reconfiguration is not supported for connector type "8" on this system
At least one action must be specified
Add a case block to catch DRC_TYPE_MIGRATION connector type.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit bbfe5fac8bad092221768291936932142527bd41
Author: Tyrel Datwyler <[email protected]>
Date: Thu May 21 15:56:56 2020 -0500
drmgr: fix segfault on unsupported connector type
% drmgr -c pmig
Received signal 11, attempting to cleanup and exit
Reading symbols from /usr/sbin/drmgr...
Reading symbols from /usr/lib/debug/usr/sbin/drmgr-1.3.7.1-3.12.1.ppc64le.debug...
(gdb) set args -c pmig
(gdb) r
Starting program: /usr/sbin/drmgr -c pmig
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.26-13.45.1.ppc64le
Program received signal SIGSEGV, Segmentation fault.
0x00007fffb7d742d4 in __strlen_power8 () from /lib64/libc.so.6
(gdb) bt
at /usr/include/bits/stdio2.h:77
The default switch section of get_command() is meant to catch defined
connector types that currently have no support. However, the error
messages passes usr_drc_type (an integral value) to a %s conversion
modifier resulting in a bad address dereference.
Fix up to use a %d conversion modifier instead.
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 1a611c866010792e31a33e2d520f19418af70855
Author: Nathan Lynch <[email protected]>
Date: Thu May 28 18:22:41 2020 -0500
powerpc-utils.spec: configure with --disable-werror
Generally we're not interested in halting the build for compiler
warnings when producing RPMs.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 3d8a7f5e2e3b735570ab99bb3a340ff7e0c14841
Author: Nathan Lynch <[email protected]>
Date: Thu May 28 18:22:40 2020 -0500
add option --disable-werror to configure
Commit a6929691fd25 ("treat compiler warnings as errors") imposed
-Werror unconditionally in Makefile.am, in order to prevent the
addition of new warnings to the build. While it's important to keep
the project reasonably warning-clean, it's also necessary to provide
downstream packagers and users in a variety of environments more
flexibility in this area.
Keep -Werror by default but make it configurable. The user may specify
--disable-werror at configure time to prevent compiler warnings from
halting the build. This is a reasonably common way to deal with
this (examples include glibc, gdb, json-c).
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 0f7abc7f08e088bbc9448b3a77def7c6da61c507
Author: Michal Suchanek <[email protected]>
Date: Wed May 27 09:52:07 2020 -0700
ofpathname: Fix udevadm location
The canonical location for udevadm is /usr/bin.
Signed-off-by: Michal Suchanek <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 3c5a57b5e4dcc661f14a2c6bd11d2203922b66c7
Author: Michal Suchanek <[email protected]>
Date: Wed May 27 09:52:06 2020 -0700
bootlist: Fix redirection of error messages.
The redirection added in commit 73839d6bab4d ("powerpc-utils: Suppress
errors reading kernel files") does nothing for echo. I assume the intent
was to print the error messages to stderr.
Fixes: 73839d6bab4d ("powerpc-utils: Suppress errors reading kernel files")
Signed-off-by: Michal Suchanek <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 5a1e57363554fb609c27e18e9163956580f6632c
Author: Michal Suchanek <[email protected]>
Date: Wed May 27 09:52:05 2020 -0700
Fix ofpathname: Could not retrieve logical device name for Open Firmware path
With commit 73839d6bab4d ("powerpc-utils: Suppress errors reading kernel files")
the return status of tr rather than ofpathname is tested.
Fixes: 73839d6bab4d ("powerpc-utils: Suppress errors reading kernel files")
Signed-off-by: Michal Suchanek <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 85fe6bf04463ea1dc85d8108f068c1cd1b3609cf
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:58 2020 -0500
add generated smtstate files to .gitignore
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit a6929691fd2578f3049877d2e54a60dd86f07957
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:57 2020 -0500
treat compiler warnings as errors
In order to keep the project warning-clean, add -Werror to AM_CFLAGS.
If needed, this can be inhibited at build time by specifying
-Wno-error:
$ make CFLAGS=-Wno-error
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 9d851ad2e44da07775b9ea3a547488ce04b11027
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:56 2020 -0500
drmgr/common_ofdt: correct stringop-truncation warning
With -Wall -Werror GCC 9.3.1 emits:
In file included from /usr/include/string.h:495,
from src/drmgr/common_ofdt.c:24:
In function ‘strncpy’,
inlined from ‘drc_info_connectors_v2’ at src/drmgr/common_ofdt.c:338:4,
inlined from ‘get_drc_info’ at src/drmgr/common_ofdt.c:431:8:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 48 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
The GCC manual's documentation for -Wstringop-truncation suggests
correcting this case by specifying 'sizeof buf - 1' for the strncpy
bound and setting the last element of the buffer to 'NUL', which is
sufficient.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 6def5726b1785195121219b1af46c3270270ff9e
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:55 2020 -0500
cpu_info_helpers: fix format-truncation warning
GCC 9.3.1 warns:
In file included from src/common/cpu_info_helpers.c:34:
src/common/cpu_info_helpers.c: In function ‘get_cpu_info’:
src/common/cpu_info_helpers.h:29:25: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 105 [-Wformat-truncation=]
29 | #define INTSERV_PATH "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/common/cpu_info_helpers.h:29:25: note: in definition of macro ‘INTSERV_PATH’
29 | #define INTSERV_PATH "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/common/cpu_info_helpers.h:29:49: note: format string is defined here
29 | #define INTSERV_PATH "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s"
| ^~
src/common/cpu_info_helpers.c:140:5: note: ‘snprintf’ output between 51 and 306 bytes into a destination of size 128
140 | snprintf(path, sizeof(path), INTSERV_PATH, de->d_name);
It's unlikely that any known device tree would have CPU nodes with
names long enough too result in the overrun this is warning about, but
it's easy enough to address by enlarging the on-stack path buffer.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 5f253c8a04734501822ca77bbace48ca38e14d5d
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:54 2020 -0500
drmgr/drslot_chrp_phb: fix format-overflow warnings (part 2)
GCC 9.3.1 warns:
src/drmgr/drslot_chrp_phb.c: In function ‘drslot_chrp_phb’:
src/drmgr/drslot_chrp_phb.c:172:33: warning: ‘%s’ directive writing up to 255 bytes into a region of size 235 [-Wformat-overflow=]
172 | rc = sprintf(hpdev->path, "%s/%s", SYSFS_PCI_DEV_PATH,
Address this by dynamically allocating struct hpdev->path using
asprintf.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 1ec98d4168511af85217404d2a6167185c430a5f
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:53 2020 -0500
drmgr/drslot_chrp_phb: fix format-overflow warnings (part 1)
GCC 9.3.1 warns:
src/drmgr/drslot_chrp_phb.c: In function ‘disable_os_hp_children_recurse’:
src/drmgr/drslot_chrp_phb.c:244:26: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
244 | sprintf(devspec, "%s/%s", ofpath + strlen(OFDT_BASE),
| ^
src/drmgr/drslot_chrp_phb.c:203:20: warning: ‘%s’ directive writing 6 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
203 | sprintf(path, "%s/%s", hpdev->path, "remove");
| ^~ ~~~~~~~~
Address these by simply enlarging the too-small on-stack buffers.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit e1ff85745e76346c7df00f5e1e981de78feed4a6
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:52 2020 -0500
drmgr/drslot_chrp_mem: fix format-overflow warnings
GCC 9.3.1 warns:
src/drmgr/drslot_chrp_mem.c: In function ‘get_mem_scn_state’:
src/drmgr/drslot_chrp_mem.c:950:19: warning: ‘/state’ directive writing 6 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
950 | sprintf(path, "%s/state", mem_scn->sysfs_path);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from src/drmgr/drslot_chrp_mem.c:21:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 1030 bytes into a destination of size 1024
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/drmgr/drslot_chrp_mem.c: In function ‘set_mem_scn_state’:
src/drmgr/drslot_chrp_mem.c:993:19: warning: ‘/state’ directive writing 6 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
993 | sprintf(path, "%s/state", mem_scn->sysfs_path);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from src/drmgr/drslot_chrp_mem.c:21:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 1030 bytes into a destination of size 1024
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In these cases simply enlarging the on-stack buffer suffices.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 7823f5b4d0b8c48d620a68418df77b4eba785151
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:51 2020 -0500
drmgr/drslot_chrp_hea: fix format-overflow warning
GCC 9.3.1 warns:
src/drmgr/drslot_chrp_hea.c: In function ‘hotplug_port’:
src/drmgr/drslot_chrp_hea.c:136:18: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 128 [-Wformat-overflow=]
136 | sprintf(fname, "%s/%s", hea->sysfs_dev_path,
| ^~
In file included from /usr/include/stdio.h:867,
from src/drmgr/drslot_chrp_hea.c:24:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 12 and 1036 bytes into a destination of size 128
In this case just enlarge the on-stack buffer.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit a209e103b3cd43163da8a05157371e0e22a9f4fb
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:50 2020 -0500
drmgr/common_pci: fix format-overflow warnings
GCC 9.3.1 warns:
src/drmgr/common_pci.c: In function ‘init_node’:
src/drmgr/common_pci.c:350:27: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
350 | sprintf(child_path, "%s/%s", node->ofdt_path, de->d_name);
| ^~
In file included from /usr/include/stdio.h:867,
from src/drmgr/common_pci.c:25:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 1280 bytes into a destination of size 1024
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/drmgr/common_pci.c: In function ‘pci_remove_device’:
src/drmgr/common_pci.c:1288:20: warning: ‘%s’ directive writing 6 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
1288 | sprintf(path, "%s/%s", node->sysfs_dev_path, "remove");
| ^~ ~~~~~~~~
In file included from /usr/include/stdio.h:867,
from src/drmgr/common_pci.c:25:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 8 and 1031 bytes into a destination of size 1024
Avoid these by replacing fixed length stack buffers with dynamic
allocations.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 7a5d2cfcdbc6d9f7a757e10a408dd11d0abdbd3c
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:49 2020 -0500
drmgr/common_cpu: dynamicallly allocate cache_info->path
GCC 9.3.1 warns:
src/drmgr/common_cpu.c: In function ‘init_cache_info.isra.0’:
src/drmgr/common_cpu.c:556:38: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 256 [-Wformat-truncation=]
556 | snprintf(cache->path, DR_BUF_SZ, "%s", path);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from src/drmgr/common_cpu.c:22:
/usr/include/bits/stdio2.h:67:10: note: ‘__builtin_snprintf’ output
between 1 and 1024 bytes into a destination of size 256
Instead of bloating the cache_info structure to accommodate longer
path strings and avoid this (legitimate) warning, dynamically allocate
them.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 39441c4b53245496d61680386628e689c38b4a34
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:48 2020 -0500
drmgr/common: add const to char * function parameters
Add const qualifier in a couple of places where it's plain that the
argument is a path string that isn't altered by the function through
that pointer. This will facilitate changes to come.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 456a96cbb511ef2b0424e1649b82594c27d0df27
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:47 2020 -0500
rtas_dbg: address string format truncation warning
GCC 9.3.1 warns:
src/rtas_dbg.c: In function ‘get_rtas_tokens’:
src/rtas_dbg.c:137:26: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 105 [-Werror=format-truncation=]
137 | snprintf(dir, 128, "%s/%s", OFDT_RTAS_PATH, dp->d_name);
| ^~
In file included from /usr/include/stdio.h:867,
from src/rtas_dbg.c:30:
/usr/include/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 24 and 279 bytes into a destination of size 128
The lazy but least risky change to make here is to simply enlarge the
(oddly named) on-stack buffer to accommodate the longest possible
result.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 7a65ca0551b387a228c70e224b1db3626a603e92
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:46 2020 -0500
serv_config: ensure nul-termination of parameter strings
GCC 9.3.1 warns:
In file included from /usr/include/string.h:495,
from src/serv_config.c:50:
In function ‘strncpy’,
inlined from ‘update_value’ at src/serv_config.c:861:4:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 4998 equals destination size [-Wstringop-truncation]
This means that a value string with length 4998 or greater not
including a terminating nul byte would result in this copy leaving the
destination buffer unterminated, which violates the specification for
ibm,set-system-parameter.
In this case we need only reduce the bound by 1.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 7ecf9ebc3a2f18670cf11b1020e1cbe9def96d26
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:45 2020 -0500
serv_config: use correct length for system parameter string data
"val" here is a character string; sizeof(val) yields the size of the
pointer. The ibm,set-system-parameter call expects the prepended
length field to reflect the string length including the terminating
NUL byte.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit f00392a9ae2c43b2c061674a10a4eb28141672ba
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:44 2020 -0500
lparstat: ensure nul-termination of sysentry->value strings
GCC 9.3.1 warns:
In function ‘strncpy’,
inlined from ‘parse_lparcfg’ at src/lparstat.c:273:4:
/usr/include/bits/string_fortified.h:106:10: warning:
‘__builtin_strncpy’ specified bound 64 equals destination size
[-Wstringop-truncation]
This means that parsed value strings of length SYSDATA_VALUE_SZ or
more are not truncated and nul-terminated after copying into the
sysentry data structure, which violates assumptions made elsewhere in
this file (e.g. get_sysdata()).
Correct this by zeroing the value buffer and copying at most
SYSDATA_VALUE_SZ - 1 characters.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 3a9cf1c525d3489a739b30340f44d9bbc1ecce37
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:43 2020 -0500
nvram: suppress stringop-truncation warning
GCC 9.3.1 warns:
In function ‘strncpy’,
inlined from ‘update_of_config_var’ at src/nvram.c:1376:2:
/usr/include/bits/string_fortified.h:106:10: warning:
‘__builtin_strncpy’ output truncated before terminating nul copying as
many bytes from a string as its length [-Wstringop-truncation]
The code does take care to nul-terminate the copied string; in this
case the GCC manual suggests using memcpy instead of strncpy. No
functional change intended.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 05b83d51943997e04c94cae3d132ee7951345a07
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:42 2020 -0500
define _GNU_SOURCE project-wide
This project uses several nonstandard GNU-specific extensions which
are exposed only when _GNU_SOURCE is defined. Examples include
CPU_SET(3) and related APIs by necessity and asprintf(3) for
convenience.
Currently _GNU_SOURCE is used in a piecemeal fashion, meaning you have
to add it to the source file when you introduce a use of asprintf, for
example. Also, note that it is used incorrectly in a couple of places:
it must appear before any headers are included for it to work reliably.
There's not much justification for the code duplication and lack of
uniformity here. Put '-D _GNU_SOURCE' in AM_CPPFLAGS for a more
consistent experience across the project's C code.
This will cause all C code to be built with _GNU_SOURCE.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 65b8e5af04bed31846c1462c48ac940822d70789
Author: Nathan Lynch <[email protected]>
Date: Mon May 18 00:05:41 2020 -0500
place preprocessor flags in AM_CPPFLAGS
Setting the include path belongs in AM_CPPFLAGS, not AM_CFLAGS.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit c97fe35b5b6d767b88419fa2084a59e986ac3da0
Author: Nathan Lynch <[email protected]>
Date: Mon Apr 27 20:48:04 2020 -0500
ofpathname: speed up l2of_scsi()
There is no need to search the entire /sys hierarchy for kernel device
names like "sda". We know that if it is present it will be in
/sys/class/block.
In an environment with more than 800 scsi devices, this brings the
execution time for a command like "lsdevinfo -F name -c -q
parent=host1" from over 20 minutes to under two minutes.
Signed-off-by: Nathan Lynch <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit c6c0a86c41d81e85a2e68587ce280bdcff40d079
Author: Kamalesh Babulal <[email protected]>
Date: Fri May 15 11:13:11 2020 +0530
lparstat: Use get_delta_value() helper
Use get_delta_value(), helper, to calculate the delta of interested
values instead of duplicating it in various functions. This reduces
the amount of duplication and makes code more readable.
Signed-off-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit fc785bea981598948a9a8f94e926f52f2ee3c6a4
Author: Kamalesh Babulal <[email protected]>
Date: Fri May 15 11:13:10 2020 +0530
lparstat: Add support for cpu-hotplug
For optimizing the read of sysfs file, the file descriptors are
assigned at the beginning of the run but they do not change dynamically
in event of a cpu hotplug, resulting under-estimated load average in
case of new cpus onlined or error in case of cpu removed. This can be
solved by checking for the online cpus every interval and re-assign
the file descriptors again with new set of cpu on hotplug event.
Signed-off-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit f3ac228ff410bca41a544032dc597df030f6c95f
Author: Kamalesh Babulal <[email protected]>
Date: Fri May 15 11:13:09 2020 +0530
lparstat: Add switch to print Scaled metrics
Add '-E' command line switch to print scaled version of meterics, this
switch prints CPU utilization/Idle based on Actual (PURR) and Scaled
(SPURR) values along with the current effective frequency of the system.
output:
~ # lparstat -E 1 3
System Configuration
type=Dedicated mode=Capped smt=8 lcpu=2 mem=4324928 kB cpus=0 ent=2.00
---Actual--- -Normalized-
%busy %idle Frequency %busy %idle
------ ------ ------------- ------ ------
0.10 99.90 2.13GHz[ 70%] 0.10 69.91
0.07 99.92 2.10GHz[ 69%] 0.05 68.95
0.08 99.92 2.10GHz[ 69%] 0.05 68.95
Signed-off-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
commit 0ed656ae4a268569fec68df6f2ca860ea57b9026
Author: Kamalesh Babulal <[email protected]>
Date: Fri May 15 11:13:08 2020 +0530
lparstat: Move displaying system configuration details to new func
System configuration details is required while displaying the
scaled metrics too. Move it to a new function, to be called by both
default, scaled metrics too.
Signed-off-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>