Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable UART1 before configuring it. #3

Closed
wants to merge 1 commit into from
Closed

Disable UART1 before configuring it. #3

wants to merge 1 commit into from

Conversation

williamspatrick
Copy link
Contributor

Signed-off-by: Patrick Williams [email protected]

Signed-off-by: Patrick Williams <[email protected]>
@ghost
Copy link

ghost commented Sep 11, 2014

Can one of the admins verify this patch?

@ozbenh
Copy link
Contributor

ozbenh commented Nov 6, 2014

On Thu, 2014-11-06 at 15:35 -0800, Patrick Williams wrote:

Assigned #3 to @ozbenh.

Didn't I fix that eons ago ?

Cheers,
Ben.

@williamspatrick
Copy link
Contributor Author

I don't know? As long as "eons" is less than the time between now and September, maybe. I just saw the pull request I made was still open and wanted to poke on it to get it closed.

@ozbenh
Copy link
Contributor

ozbenh commented Nov 7, 2014

On Thu, 2014-11-06 at 16:01 -0800, Patrick Williams wrote:

I don't know? As long as "eons" is less than the time between now and
September, maybe. I just saw the pull request I made was still open
and wanted to poke on it to get it closed.

Oh, I missed the pulled request. I think I fixed that in the code itself
as part of other fixes when you first told me about it, or possibly when
I reworked that code to fix its operations with the VUART.

Cheers,
Ben.

@williamspatrick
Copy link
Contributor Author

Appears to have been fixed by @ozbenh under b33fd8d .

ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Dec 24, 2014
So my great attempt at avoiding all re-entencies fails due to HBRT... at
least until we have some kind of way to thread things, it will have to
re-enter so let's bite the bullet, make the poller list walking lockless
(we'll handle removal when we have to, ie, not yet) and slightly extend
the coverage of the PSI lock while at it. All the other pollers already
have their own locks anyway so we are actually removing some overhead.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
ghost pushed a commit that referenced this pull request Sep 2, 2016
This ends up being harmless bug due to memory layout.

$ ./pflash -F ~/op-build/output/images/firestone.pnor -i
==31829==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000062f0
80 at pc 0x410226 bp 0x7ffedba9c950 sp 0x7ffedba9c948
WRITE of size 8 at 0x00000062f080 thread T0
    #0 0x410225 in file_get_info (/home/stewart/skiboot/external/pflash/pflash+0
x410225)
    #1 0x40d832 in blocklevel_get_info (/home/stewart/skiboot/external/pflash/pf
lash+0x40d832)
    #2 0x401f0c in main (/home/stewart/skiboot/external/pflash/pflash+0x401f0c)
    #3 0x7fc77439ab44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21
b44)
    #4 0x403884 (/home/stewart/skiboot/external/pflash/pflash+0x403884)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 23, 2017
…nt', which requires 8 byte alignment

UBSan caught this:

hdata/test/../iohub.c:83:2: runtime error: load of misaligned address 0x7f1dc7b0210a for type 'long unsigned int', which requires 8 byte alignment
0x7f1dc7b0210a: note: pointer points here
 31 4c  58 08 31 00 04 01 00 30  00 42 50 46 02 00 00 78  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^
    #0 0x41470a in io_get_lx_info hdata/test/../iohub.c:83
    open-power#1 0x41759f in io_add_p8_cec_vpd hdata/test/../iohub.c:450
    open-power#2 0x417d35 in io_parse_fru hdata/test/../iohub.c:538
    open-power#3 0x41812a in io_parse hdata/test/../iohub.c:600
    open-power#4 0x425aa2 in parse_hdat hdata/test/../spira.c:1337
    open-power#5 0x43d9f8 in main hdata/test/hdata_to_dt.c:358
    open-power#6 0x7f1dcb868509 in __libc_start_main (/lib64/libc.so.6+0x20509)
    open-power#7 0x4019e9 in _start (/home/stewart/skiboot/hdata/test/hdata_to_dt+0x4019e9)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 23, 2017
LeakSanitizer caught this with libflash/test/test-flash.c:

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7f72546ee850 in malloc (/lib64/libasan.so.4+0xde850)
    open-power#1 0x405ff0 in flash_init libflash/test/../libflash.c:830
    open-power#2 0x408632 in main libflash/test/test-flash.c:382
    open-power#3 0x7f7253540509 in __libc_start_main (/lib64/libc.so.6+0x20509)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 24, 2017
…nt', which requires 8 byte alignment

UBSan caught this:

hdata/test/../iohub.c:83:2: runtime error: load of misaligned address 0x7f1dc7b0210a for type 'long unsigned int', which requires 8 byte alignment
0x7f1dc7b0210a: note: pointer points here
 31 4c  58 08 31 00 04 01 00 30  00 42 50 46 02 00 00 78  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^
    #0 0x41470a in io_get_lx_info hdata/test/../iohub.c:83
    open-power#1 0x41759f in io_add_p8_cec_vpd hdata/test/../iohub.c:450
    open-power#2 0x417d35 in io_parse_fru hdata/test/../iohub.c:538
    open-power#3 0x41812a in io_parse hdata/test/../iohub.c:600
    open-power#4 0x425aa2 in parse_hdat hdata/test/../spira.c:1337
    open-power#5 0x43d9f8 in main hdata/test/hdata_to_dt.c:358
    open-power#6 0x7f1dcb868509 in __libc_start_main (/lib64/libc.so.6+0x20509)
    open-power#7 0x4019e9 in _start (/home/stewart/skiboot/hdata/test/hdata_to_dt+0x4019e9)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 24, 2017
LeakSanitizer caught this with libflash/test/test-flash.c:

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7f72546ee850 in malloc (/lib64/libasan.so.4+0xde850)
    open-power#1 0x405ff0 in flash_init libflash/test/../libflash.c:830
    open-power#2 0x408632 in main libflash/test/test-flash.c:382
    open-power#3 0x7f7253540509 in __libc_start_main (/lib64/libc.so.6+0x20509)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 24, 2017
…nt', which requires 8 byte alignment

UBSan caught this:

hdata/test/../iohub.c:83:2: runtime error: load of misaligned address 0x7f1dc7b0210a for type 'long unsigned int', which requires 8 byte alignment
0x7f1dc7b0210a: note: pointer points here
 31 4c  58 08 31 00 04 01 00 30  00 42 50 46 02 00 00 78  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^
    #0 0x41470a in io_get_lx_info hdata/test/../iohub.c:83
    open-power#1 0x41759f in io_add_p8_cec_vpd hdata/test/../iohub.c:450
    open-power#2 0x417d35 in io_parse_fru hdata/test/../iohub.c:538
    open-power#3 0x41812a in io_parse hdata/test/../iohub.c:600
    open-power#4 0x425aa2 in parse_hdat hdata/test/../spira.c:1337
    open-power#5 0x43d9f8 in main hdata/test/hdata_to_dt.c:358
    open-power#6 0x7f1dcb868509 in __libc_start_main (/lib64/libc.so.6+0x20509)
    open-power#7 0x4019e9 in _start (/home/stewart/skiboot/hdata/test/hdata_to_dt+0x4019e9)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Aug 24, 2017
LeakSanitizer caught this with libflash/test/test-flash.c:

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7f72546ee850 in malloc (/lib64/libasan.so.4+0xde850)
    open-power#1 0x405ff0 in flash_init libflash/test/../libflash.c:830
    open-power#2 0x408632 in main libflash/test/test-flash.c:382
    open-power#3 0x7f7253540509 in __libc_start_main (/lib64/libc.so.6+0x20509)

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit to stewartsmith/skiboot that referenced this pull request Mar 23, 2018
This means that we no longer hit this bug if we fail to get valid pstates
from the OCC.

[console-pexpect]#echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
[   94.019971181,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   94.020098392,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   10.318805] Disabling lock debugging due to kernel taint
[   10.318808] Severe Machine check interrupt [Not recovered]
[   10.318812]   NIP [000000003003e434]: 0x3003e434
[   10.318813]   Initiator: CPU
[   10.318815]   Error type: Real address [Load/Store (foreign)]
[   10.318817] opal: Hardware platform error: Unrecoverable Machine Check exception
[   10.318821] CPU: 117 PID: 2745 Comm: sh Tainted: G   M             4.15.9-openpower1 open-power#3
[   10.318823] NIP:  000000003003e434 LR: 000000003003025c CTR: 0000000030030240
[   10.318825] REGS: c00000003fa7bd80 TRAP: 0200   Tainted: G   M              (4.15.9-openpower1)
[   10.318826] MSR:  9000000000201002 <SF,HV,ME,RI>  CR: 48002888  XER: 20040000
[   10.318831] CFAR: 0000000030030258 DAR: 394a00147d5a03a6 DSISR: 00000008 SOFTE: 1

Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit that referenced this pull request Mar 27, 2018
This means that we no longer hit this bug if we fail to get valid pstates
from the OCC.

[console-pexpect]#echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
[   94.019971181,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   94.020098392,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   10.318805] Disabling lock debugging due to kernel taint
[   10.318808] Severe Machine check interrupt [Not recovered]
[   10.318812]   NIP [000000003003e434]: 0x3003e434
[   10.318813]   Initiator: CPU
[   10.318815]   Error type: Real address [Load/Store (foreign)]
[   10.318817] opal: Hardware platform error: Unrecoverable Machine Check exception
[   10.318821] CPU: 117 PID: 2745 Comm: sh Tainted: G   M             4.15.9-openpower1 #3
[   10.318823] NIP:  000000003003e434 LR: 000000003003025c CTR: 0000000030030240
[   10.318825] REGS: c00000003fa7bd80 TRAP: 0200   Tainted: G   M              (4.15.9-openpower1)
[   10.318826] MSR:  9000000000201002 <SF,HV,ME,RI>  CR: 48002888  XER: 20040000
[   10.318831] CFAR: 0000000030030258 DAR: 394a00147d5a03a6 DSISR: 00000008 SOFTE: 1

Signed-off-by: Stewart Smith <[email protected]>
[Additional changes from Shilpa]
Reviewed-by: Shilpasri G Bhat <[email protected]>
Tested-by: Shilpasri G Bhat <[email protected]>
Signed-off-by: Stewart Smith <[email protected]>
ghost pushed a commit that referenced this pull request Mar 27, 2018
This means that we no longer hit this bug if we fail to get valid pstates
from the OCC.

[console-pexpect]#echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
echo 1 > //sys/firmware/opal/sensor_groups//occ-csm0/clear
[   94.019971181,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   94.020098392,5] CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=083d cpu @0x33cf4000 -> pir=083d token=8
[   10.318805] Disabling lock debugging due to kernel taint
[   10.318808] Severe Machine check interrupt [Not recovered]
[   10.318812]   NIP [000000003003e434]: 0x3003e434
[   10.318813]   Initiator: CPU
[   10.318815]   Error type: Real address [Load/Store (foreign)]
[   10.318817] opal: Hardware platform error: Unrecoverable Machine Check exception
[   10.318821] CPU: 117 PID: 2745 Comm: sh Tainted: G   M             4.15.9-openpower1 #3
[   10.318823] NIP:  000000003003e434 LR: 000000003003025c CTR: 0000000030030240
[   10.318825] REGS: c00000003fa7bd80 TRAP: 0200   Tainted: G   M              (4.15.9-openpower1)
[   10.318826] MSR:  9000000000201002 <SF,HV,ME,RI>  CR: 48002888  XER: 20040000
[   10.318831] CFAR: 0000000030030258 DAR: 394a00147d5a03a6 DSISR: 00000008 SOFTE: 1

Signed-off-by: Stewart Smith <[email protected]>
[Additional changes from Shilpa]
Reviewed-by: Shilpasri G Bhat <[email protected]>
Tested-by: Shilpasri G Bhat <[email protected]>
Signed-off-by: Stewart Smith <[email protected]>
@ghost ghost mentioned this pull request Sep 3, 2018
amboar added a commit to amboar/skiboot that referenced this pull request Oct 9, 2019
Resolves:

=================================================================
==31900==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 160 byte(s) in 1 object(s) allocated from:
    #0 0x4c6cb3 in malloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3
    open-power#1 0x4f668d in pool_init /home/andrew/src/open-power/skiboot/core/test/../pool.c:54:14
    open-power#2 0x4f6a96 in main /home/andrew/src/open-power/skiboot/core/test/run-pool.c:27:2
    open-power#3 0x7f333c888b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: 160 byte(s) leaked in 1 allocation(s).

Signed-off-by: Andrew Jeffery <[email protected]>
amboar added a commit to amboar/skiboot that referenced this pull request Oct 9, 2019
Rearrange the internal implementation of strdup and its inclusion in
run-mem_region_reservations to avoid invoking the internal
implementation in the wrong contexts:

==9810==ERROR: AddressSanitizer: heap-use-after-free on address 0x629000000218 at pc 0x00000052eb1a bp 0x7ffc31aebe70 sp 0x7ffc31aebe68
READ of size 8 at 0x629000000218 thread T0
    #0 0x52eb19 in list_check_node /home/andrew/src/open-power/skiboot/core/test/../../ccan/list/list.c:28:10
    open-power#1 0x52eb88 in list_check /home/andrew/src/open-power/skiboot/core/test/../../ccan/list/list.c:40:7
    open-power#2 0x4f9a74 in __mem_alloc /home/andrew/src/open-power/skiboot/core/test/../mem_region.c:427:2
    open-power#3 0x4f8c14 in mem_alloc /home/andrew/src/open-power/skiboot/core/test/../mem_region.c:488:6
    open-power#4 0x5138a0 in __memalign /home/andrew/src/open-power/skiboot/core/test/../malloc.c:21:6
    open-power#5 0x50d2cb in __malloc /home/andrew/src/open-power/skiboot/core/test/../malloc.c:29:9
    open-power#6 0x513f4d in strdup /home/andrew/src/open-power/skiboot/core/test/../../libc/string/strdup.c:23:8
    open-power#7 0x52ee1a in llvm_gcda_start_file (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x52ee1a)
    open-power#8 0x529422 in __llvm_gcov_writeout (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x529422)
    open-power#9 0x530419 in llvm_writeout_files (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x530419)
    open-power#10 0x7f191cf2e2ab in __run_exit_handlers /build/glibc-KRRWSm/glibc-2.29/stdlib/exit.c:108:8
    open-power#11 0x7f191cf2e3d9 in exit /build/glibc-KRRWSm/glibc-2.29/stdlib/exit.c:139:3
    open-power#12 0x7f191cf0db71 in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:342:3
    open-power#13 0x41b3d9 in _start (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x41b3d9)

0x629000000218 is located 24 bytes inside of 16384-byte region [0x629000000200,0x629000004200)
freed by thread T0 here:
    #0 0x4c6a52 in __interceptor_free /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:124:3
    open-power#1 0x526186 in real_free /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:22:9
    open-power#2 0x52380c in main /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:225:2
    open-power#3 0x7f191cf0db6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

previously allocated by thread T0 here:
    #0 0x4c6dd3 in malloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3
    open-power#1 0x523896 in real_malloc /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:17:9
    open-power#2 0x523321 in main /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:185:29
    open-power#3 0x7f191cf0db6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Signed-off-by: Andrew Jeffery <[email protected]>
amboar added a commit to amboar/skiboot that referenced this pull request Oct 9, 2019
Resolves:

==26938==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20971520 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd63b in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:324:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 2621440 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd601 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:314:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 81920 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd5d1 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:307:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 81920 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd593 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:294:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: 23756800 byte(s) leaked in 4 allocation(s).

Signed-off-by: Andrew Jeffery <[email protected]>
amboar added a commit to amboar/skiboot that referenced this pull request Oct 10, 2019
Resolves:

=================================================================
==31900==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 160 byte(s) in 1 object(s) allocated from:
    #0 0x4c6cb3 in malloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3
    open-power#1 0x4f668d in pool_init /home/andrew/src/open-power/skiboot/core/test/../pool.c:54:14
    open-power#2 0x4f6a96 in main /home/andrew/src/open-power/skiboot/core/test/run-pool.c:27:2
    open-power#3 0x7f333c888b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: 160 byte(s) leaked in 1 allocation(s).

Signed-off-by: Andrew Jeffery <[email protected]>
amboar added a commit to amboar/skiboot that referenced this pull request Oct 10, 2019
Rearrange the internal implementation of strdup and its inclusion in
run-mem_region_reservations to avoid invoking the internal
implementation in the wrong contexts:

==9810==ERROR: AddressSanitizer: heap-use-after-free on address 0x629000000218 at pc 0x00000052eb1a bp 0x7ffc31aebe70 sp 0x7ffc31aebe68
READ of size 8 at 0x629000000218 thread T0
    #0 0x52eb19 in list_check_node /home/andrew/src/open-power/skiboot/core/test/../../ccan/list/list.c:28:10
    open-power#1 0x52eb88 in list_check /home/andrew/src/open-power/skiboot/core/test/../../ccan/list/list.c:40:7
    open-power#2 0x4f9a74 in __mem_alloc /home/andrew/src/open-power/skiboot/core/test/../mem_region.c:427:2
    open-power#3 0x4f8c14 in mem_alloc /home/andrew/src/open-power/skiboot/core/test/../mem_region.c:488:6
    open-power#4 0x5138a0 in __memalign /home/andrew/src/open-power/skiboot/core/test/../malloc.c:21:6
    open-power#5 0x50d2cb in __malloc /home/andrew/src/open-power/skiboot/core/test/../malloc.c:29:9
    open-power#6 0x513f4d in strdup /home/andrew/src/open-power/skiboot/core/test/../../libc/string/strdup.c:23:8
    open-power#7 0x52ee1a in llvm_gcda_start_file (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x52ee1a)
    open-power#8 0x529422 in __llvm_gcov_writeout (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x529422)
    open-power#9 0x530419 in llvm_writeout_files (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x530419)
    open-power#10 0x7f191cf2e2ab in __run_exit_handlers /build/glibc-KRRWSm/glibc-2.29/stdlib/exit.c:108:8
    open-power#11 0x7f191cf2e3d9 in exit /build/glibc-KRRWSm/glibc-2.29/stdlib/exit.c:139:3
    open-power#12 0x7f191cf0db71 in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:342:3
    open-power#13 0x41b3d9 in _start (/home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations-gcov+0x41b3d9)

0x629000000218 is located 24 bytes inside of 16384-byte region [0x629000000200,0x629000004200)
freed by thread T0 here:
    #0 0x4c6a52 in __interceptor_free /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:124:3
    open-power#1 0x526186 in real_free /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:22:9
    open-power#2 0x52380c in main /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:225:2
    open-power#3 0x7f191cf0db6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

previously allocated by thread T0 here:
    #0 0x4c6dd3 in malloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3
    open-power#1 0x523896 in real_malloc /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:17:9
    open-power#2 0x523321 in main /home/andrew/src/open-power/skiboot/core/test/run-mem_region_reservations.c:185:29
    open-power#3 0x7f191cf0db6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Signed-off-by: Andrew Jeffery <[email protected]>
amboar added a commit to amboar/skiboot that referenced this pull request Oct 10, 2019
Resolves:

==26938==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20971520 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd63b in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:324:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 2621440 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd601 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:314:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 81920 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd5d1 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:307:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

Direct leak of 81920 byte(s) in 1 object(s) allocated from:
    #0 0x4c6eea in calloc /build/llvm-toolchain-8-F3l7P1/llvm-toolchain-8-8/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:155:3
    open-power#1 0x4fd949 in run_flash_test /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:85:9
    open-power#2 0x4fd593 in main /home/andrew/src/open-power/skiboot/libflash/test/test-mbox.c:294:7
    open-power#3 0x7fb0c5017b6a in __libc_start_main /build/glibc-KRRWSm/glibc-2.29/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: 23756800 byte(s) leaked in 4 allocation(s).

Signed-off-by: Andrew Jeffery <[email protected]>
ruscur pushed a commit to ruscur/skiboot that referenced this pull request Feb 28, 2020
Here is a proposal to collect OPAL call statistics, counts and duration,
and track areas we could possibly improve.

With a small Linux driver to dump the stats in debugfs, here is what
we get on a P9 after boot:

OPAL_CONSOLE_WRITE : #22318 0/0/47
OPAL_RTC_READ : open-power#9 0/4/15
OPAL_READ_NVRAM : #3468 0/0/6
OPAL_HANDLE_INTERRUPT : #4724 0/57/10026
OPAL_POLL_EVENTS : #508 2/141/10033
OPAL_PCI_CONFIG_READ_BYTE : #3623 0/0/4
OPAL_PCI_CONFIG_READ_HALF_WORD : #5579 0/0/8
OPAL_PCI_CONFIG_READ_WORD : #6156 0/0/7
OPAL_PCI_CONFIG_WRITE_BYTE : open-power#2 0/0/0
OPAL_PCI_CONFIG_WRITE_HALF_WORD : #1282 0/0/1
OPAL_PCI_CONFIG_WRITE_WORD : #1335 0/0/1
OPAL_PCI_EEH_FREEZE_STATUS : #11123 0/0/2
OPAL_CONSOLE_WRITE_BUFFER_SPACE : #139088 0/0/11
OPAL_PCI_EEH_FREEZE_CLEAR : open-power#148 1/2/8
OPAL_PCI_PHB_MMIO_ENABLE : open-power#22 0/0/0
OPAL_PCI_SET_PHB_MEM_WINDOW : open-power#22 0/0/1
OPAL_PCI_MAP_PE_MMIO_WINDOW : open-power#56 0/0/0
OPAL_PCI_SET_PE : open-power#44 279/284/293
OPAL_PCI_SET_PELTV : open-power#66 0/0/0
OPAL_PCI_SET_XIVE_PE : #1123 0/0/1
OPAL_GET_MSI_64 : #1120 0/0/0
OPAL_START_CPU : open-power#238 8/21/35
OPAL_QUERY_CPU_STATUS : #357 0/11/69
OPAL_PCI_MAP_PE_DMA_WINDOW : open-power#16 0/0/1
OPAL_PCI_MAP_PE_DMA_WINDOW_REAL : open-power#16 0/0/1
OPAL_PCI_RESET : open-power#35 0/471/851
OPAL62 : open-power#6 0/10/46
OPAL_XSCOM_READ : open-power#26 0/0/2
OPAL_XSCOM_WRITE : open-power#8 0/0/1
OPAL_REINIT_CPUS : open-power#4 348/8247/11061
OPAL_CHECK_TOKEN : #134112 0/0/0
OPAL_GET_MSG : open-power#30 0/0/1
OPAL87 : open-power#1 0/0/0
OPAL_PCI_SET_PHB_CAPI_MODE : open-power#2 0/60/121
OPAL_SLW_SET_REG : #1080 3/3/13
OPAL_IPMI_SEND : open-power#53 0/5/11
OPAL_IPMI_RECV : open-power#53 0/0/2
OPAL_I2C_REQUEST : open-power#20 6/10/19
OPAL_FLASH_READ : open-power#10 19/10452/58305
OPAL_PRD_MSG : open-power#1 0/3/3
OPAL_CONSOLE_FLUSH : #134079 0/0/12
OPAL_PCI_GET_PRESENCE_STATE : open-power#7 1/1/3
OPAL_PCI_GET_POWER_STATE : open-power#9 0/0/0
OPAL_PCI_TCE_KILL : open-power#20 1/8/133
OPAL_NMMU_SET_PTCR : open-power#3 253/255/257
OPAL_XIVE_RESET : open-power#3 0/114709/115403
OPAL_XIVE_GET_IRQ_INFO : #1427 0/0/6
OPAL_XIVE_SET_IRQ_CONFIG : #1113 0/125/2810
OPAL_XIVE_GET_QUEUE_INFO : open-power#240 0/0/2
OPAL_XIVE_SET_QUEUE_INFO : #360 0/60/1216
OPAL_XIVE_ALLOCATE_VP_BLOCK : open-power#2 0/59/60
OPAL_XIVE_GET_VP_INFO : open-power#240 0/0/0
OPAL_XIVE_SET_VP_INFO : #360 0/298/3080
OPAL_XIVE_ALLOCATE_IRQ : open-power#240 0/0/3
OPAL140 : open-power#119 0/253/1109
OPAL_IMC_COUNTERS_INIT : open-power#60 9/10/20
OPAL_IMC_COUNTERS_STOP : open-power#36 0/0/2
OPAL_PCI_GET_PBCQ_TUNNEL_BAR : open-power#1 2/2/2
OPAL_PCI_SET_PBCQ_TUNNEL_BAR : open-power#1 1/1/1
OPAL_NX_COPROC_INIT : open-power#2 3/4/5

Signed-off-by: Cédric Le Goater <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants