linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: George Kennedy <george.kennedy@oracle.com>
Cc: harshit.m.mogalapalli@oracle.com, peterz@infradead.org,
	mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, tglx@linutronix.de, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	ravi.bangoria@amd.com
Subject: Re: [PATCH] perf/x86/amd: check event before enable to avoid GPF
Date: Tue, 4 Jun 2024 18:32:36 +0530	[thread overview]
Message-ID: <fe76301e-9835-4b7a-9da4-fceb372d9cbf@amd.com> (raw)
In-Reply-To: <57bcb95d-8a1c-4903-af8c-b4b08d1270c3@oracle.com>

>>>>> Syzkaller reported a GPF in amd_pmu_enable_all.
>>>> Can you please provide a bug report link? Also, any reproducer?
>>> The Syzkaller reproducer can be found in this link:
>>> https://lore.kernel.org/netdev/CAMt6jhyec7-TSFpr3F+_ikjpu39WV3jnCBBGwpzpBrPx55w20g@mail.gmail.com/T/#u
>> I'm _not_ able to reproduce the issue with this syzkaller reproducer. I ran
>> it for more than 12 hours. Here is my setup.
>>
>> - EYPC Zen3 Milan _host_
>> - Fedora 40
>> - v6.9 vanilla kernel with attached config
>> - Syzkaller command running as a root
>>    # ./syz-execprog -executor=./syz-executor -threaded=1 -repeat=0 -procs=8 2-repro.prog
>> - Also tried with C program generated using:
>>    # ./syz-prog2c -procs=8 -repeat=0 -threaded=1 -tmpdir=1 -segv=true -prog=2-repro.prog > 2-repro.c
> processor    : 0
> vendor_id    : AuthenticAMD
> cpu family    : 23
> model        : 1
> model name    : AMD EPYC 7551 32-Core Processor
> stepping    : 2
> microcode    : 0x800126e
> cpu MHz        : 2000.000
> cache size    : 512 KB
> physical id    : 0
> siblings    : 64
> core id        : 0
> cpu cores    : 32
> apicid        : 0
> initial apicid    : 0
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 13
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht sysca
> ll nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf rapl pni
>  pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_le
> gacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw
> _pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 nt_good clz
> ero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshol
> d avic v_vmsave_vmload vgif overflow_recov succor smca
> bugs        : div0 sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso
> bogomips    : 3992.29
> TLB size    : 2560 4K pages
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 48 bits physical, 48 bits virtual
> power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]
> 
> Try these repro steps instead:
> syz-prog2c -prog repro.prog -threaded -repeat 0 -procs 8 -slowdown 1 -sandbox none -sandbox_arg 0 -enable net_reset -enable net_dev -enable cgroups -tmpdir -enable binfmt_misc -enable close_fds -enable sysctl -segv >repro.c
> 
>>
>> Can you please provide your config and system detail in case you are able
>> to reproduce it.
> 
> See attached for repro C and config.
No luck with your reproducers as well :(. My kernel config is almost same as
yours:

$ ./scripts/diffconfig 2-config.repro .config
-CC_HAS_AUTO_VAR_INIT_PATTERN y
-CC_HAS_AUTO_VAR_INIT_ZERO y
-CC_HAS_AUTO_VAR_INIT_ZERO_BARE y
-CC_HAS_KASAN_MEMINTRINSIC_PREFIX y
-INIT_STACK_ALL_PATTERN n
-INIT_STACK_ALL_ZERO y
-TOOLS_SUPPORT_RELR y
 AS_VERSION 24000 -> 23502
 CC_VERSION_TEXT "gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-43..0.1)" -> "gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)"
 GCC_VERSION 130101 -> 110401
 INIT_STACK_NONE n -> y
 LD_VERSION 24000 -> 23502
 LOCALVERSION "" -> "-ravi"
 PAHOLE_VERSION 0 -> 125
+PAHOLE_HAS_LANG_EXCLUDE y
+PAHOLE_HAS_SPLIT_BTF y

And I'm trying on Zen1 test machine:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 1
model name      : AMD EPYC 7601 32-Core Processor
stepping        : 2
microcode       : 0x800126e
cpu MHz         : 2692.575
cache size      : 512 KB
physical id     : 0
siblings        : 64
core id         : 0
cpu cores       : 32
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips        : 4391.65
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]

  reply	other threads:[~2024-06-04 13:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29 13:50 [PATCH] perf/x86/amd: check event before enable to avoid GPF George Kennedy
2024-05-30  3:37 ` Ravi Bangoria
2024-05-30 18:30   ` George Kennedy
2024-05-30 20:26     ` George Kennedy
2024-06-04 13:16       ` Ravi Bangoria
2024-06-04 13:23         ` George Kennedy
2024-06-04 13:40           ` Ravi Bangoria
2024-06-04 14:26             ` George Kennedy
2024-06-07 19:13             ` George Kennedy
2024-06-10 10:51               ` Ravi Bangoria
2024-06-24 16:18                 ` George Kennedy
2024-07-01 14:15                   ` George Kennedy
2024-07-02  4:03                   ` Ravi Bangoria
2024-07-02 11:38                     ` George Kennedy
2024-09-24 17:13                     ` George Kennedy
2024-09-26  4:05                       ` Ravi Bangoria
2024-06-03  4:39     ` Ravi Bangoria
2024-06-03 13:30       ` George Kennedy
2024-06-04 13:02         ` Ravi Bangoria [this message]
2024-06-04 13:00     ` Ravi Bangoria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe76301e-9835-4b7a-9da4-fceb372d9cbf@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=george.kennedy@oracle.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).