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

Add Big Endian CI target #293

Merged
merged 2 commits into from Mar 6, 2024
Merged

Add Big Endian CI target #293

merged 2 commits into from Mar 6, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Mar 5, 2024

No description provided.

@saghul
Copy link
Contributor Author

saghul commented Mar 5, 2024

Hum, this looks sus:

Architecture:                       s390x
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      48 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             4
On-line CPU(s) list:                0-3
Vendor ID:                          AuthenticAMD
Model name:                         AMD EPYC 7763 64-Core Processor
CPU family:                         25
Model:                              1
Thread(s) per core:                 2
Core(s) per socket:                 2
Socket(s):                          1
Stepping:                           1
BogoMIPS:                           4890.86
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 tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
Virtualization:                     AMD-V
L1d cache:                          64 KiB (2 instances)
L1i cache:                          64 KiB (2 instances)
L2 cache:                           1 MiB (2 instances)
L3 cache:                           32 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-3
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET, no microcode
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

@chqrlie
Copy link
Collaborator

chqrlie commented Mar 5, 2024

Byte Order: Little Endian

Suspect indeed. Looks like an emulation problem, vendor shows as AMD...

How about mips-unknown-linux-gnu or m68k-unknown-linux-gnu

@bnoordhuis
Copy link
Contributor

Those CPU flags are also x86, not Z (ex-IBM'er reporting in.)

I don't see what invokes qemu. Maybe that's the problem?

@saghul
Copy link
Contributor Author

saghul commented Mar 5, 2024

I think the problem is Docker. Since it runs the host kernel, and lscpu reads /sys/kernel/cpu_byteorder in order to determine it, it seems to get it wrong https://github.com/util-linux/util-linux/blob/master/include/pathnames.h#L123C34-L123C59

Screen Shot 2024-03-05 at 11 34 17

So AFAIS it actually is BE, but lscpu is wrong in this case?

@saghul
Copy link
Contributor Author

saghul commented Mar 5, 2024

Ok, I think I got it now.

The way qemu is used within Docker it uses binfmt to register a qemu-user-static for each arch to run.

So it does run in Big Endian mode.

Perhaps I could add the enddianness to the -qd output? We already output the arch for example.

@bnoordhuis
Copy link
Contributor

Perhaps I could add the enddianness to the -qd output? We already output the arch for example.

👍

@saghul
Copy link
Contributor Author

saghul commented Mar 6, 2024

Updated, PTAL. qjs -qd output on s390x:

QuickJS-ng memory usage -- 0.4.0dev version, 64-bit, Big Endian, malloc limit: -1
  528 + 0   JSRuntime
  504 + 0   JSContext
   72 + 0   JSObject
   24 + 0   JSString
  144 + 0   JSFunctionBytecode
JSObject classes
     54   1 Object
      1   2 Array
      1   4 Number
      1   5 String
      1   6 Boolean
    100  12 Function
NAME                    COUNT     SIZE
memory allocated          968    84148  (86.9 per block)
memory used               968    75573  (8 overhead, 8.9 average slack)
atoms                     583    27445  (47.1 per atom)
objects                   158    11376  (72.0 per object)
  properties              842    15104  (5.3 per object)
  shapes                   58    12960  (223.4 per shape)
C functions               100
arrays                      1
  fast arrays               1
  elements                  0        0  (0.0 per fast array)
Instantiation times (ms): 2.697 = 0.191+2.048+0.001+0.457

@saghul saghul merged commit 4d052a7 into master Mar 6, 2024
36 checks passed
@saghul saghul deleted the saghul-patch-3 branch March 6, 2024 10:21
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.

None yet

3 participants