On Fri, 29 Jul 2022 14:37:32 -0500, Haitao Huang
<haitao.huang@xxxxxxxxxxxxxxx> wrote:
On Fri, 29 Jul 2022 14:14:15 -0500, Dhanraj, Vijay
<vijay.dhanraj@xxxxxxxxx> wrote:
Hi Dave,
Tried with the latest tip and I still observe the issue. I tried 2G, 4G
and 8G sized requests and as before, 2GB size requests works fine but
4GB and 8GB requests failed.
Commit I have applied my test patch:
commit 038ef9928e1acb37bbe808c23a421189f1fd96cb (origin/x86/sgx)
Merge: e0a5915f1cca e0dccc3b76fb
Author: Ingo Molnar <mingo@xxxxxxxxxx>
Date: Tue Jul 26 09:14:28 2022 +0200
Merge tag 'v5.19-rc8' into x86/sgx, to resolve conflicts
Kernel version:
Linux sdp 5.19.0-rc8-custom #1 SMP PREEMPT_DYNAMIC Fri Jul 29 10:28:25
PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
Using a kernel built at the same commit, I did the same test on another
machine with 4G EPC reported by the kernel log and reproduced the
failures only on 5th run for both 4G and 8G size requests (set by
edmm_size). The failure seems to stick for subsequent runs but I did not
run more than 7 times for each case so can't say definitely about that.
FYI I have ran more iterations, and there is no hysteresis. Failures are
random on this platform.
Also I was able to reproduce the same random failures on V4 patches:
https://github.com/rchatre/linux/commits/sgx/sgx2_submitted_v4_plus_rwx.
Another observation is that those failures are no reproduced when BIOS is
configured with 64G EPC on each socket.
Failures with v4 were not reproduced on Vijay's machine even with 30 runs.
Note my CPU has a different microcode version from Vijay's though both are
the same model:
processor : 127
vendor_id : GenuineIntel
cpu family : 6
model : 106
model name : Intel(R) Xeon(R) Platinum 8352Y CPU @ 2.20GHz
stepping : 6
microcode : 0xd000363
cpu MHz : 2200.000
cache size : 49152 KB
physical id : 1
siblings : 64
core id : 31
cpu cores : 32
apicid : 191
initial apicid : 191
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx
pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl
xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl
vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2
x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm
abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single intel_ppin ssbd
mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid
ept_ad fsgsbase tsc_adjust sgx bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a
avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt
avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc
cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd
dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi
umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg
tme avx512_vpopcntdq rdpid sgx_lc fsrm md_clear pconfig flush_l1d
arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only
ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid
unrestricted_guest vapic_reg vid ple shadow_vmcs pml ept_mode_based_exec
tsc_scaling
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs
bogomips : 4402.06
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 57 bits virtual
power management:
Thanks
Haitao
-----Original Message-----
From: Hansen, Dave <dave.hansen@xxxxxxxxx>
Sent: Friday, July 29, 2022 9:38 AM
To: Dhanraj, Vijay <vijay.dhanraj@xxxxxxxxx>; Chatre, Reinette
<reinette.chatre@xxxxxxxxx>; dave.hansen@xxxxxxxxxxxxxxx;
jarkko@xxxxxxxxxx; linux-sgx@xxxxxxxxxxxxxxx
Cc: Huang, Haitao <haitao.huang@xxxxxxxxx>
Subject: Re: Support SGX2 V5: Seg-fault with EACCEPT for large number
of
EPC pages
On 7/29/22 09:01, Dhanraj, Vijay wrote:
> Huang, Haitao and I created a simple patch to repro this issue using
the SGX
selftests and we do see the issue when using V5 (5.18.0-rc5) but cannot
repro the issue in V4 (5.18.0-rc2). Not sure if this is a driver issue
or kernel,
can you please check?
Thanks for the report.
Could you please try the code that's going to go to Linus shortly?
It's really
the only version that matters at this point?
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/sgx