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

Hangs s390 x #5

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/fedora-s390x/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM --platform=linux/s390x multiarch/fedora:29-s390x

COPY entry.sh /entry.sh

RUN sh -c 'curl https://dl.google.com/go/go1.14.4.linux-s390x.tar.gz | tar xz -C /usr/local'
RUN ln -s /usr/local/go/bin/go /usr/local/bin/go

ENTRYPOINT ["sh", "/entry.sh"]
7 changes: 7 additions & 0 deletions .github/actions/fedora-s390x/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: 'fedora-s390x'
description: 'builds golang inside linux/s390x'

runs:
using: 'docker'
image: 'Dockerfile'
10 changes: 10 additions & 0 deletions .github/actions/fedora-s390x/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

sh -c "echo $*"
echo "Hello"
date
pwd
ls
uname -a
GODEBUG=asyncpreemptoff=1 go test -v ./math/...
date
18 changes: 8 additions & 10 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CIRCL
on:
push:
Expand All @@ -9,6 +10,7 @@ on:
jobs:
amd64_job:
name: Go-${{matrix.GOVER}}/amd64
if: 1==0
runs-on: ubuntu-18.04
strategy:
matrix:
Expand All @@ -33,28 +35,24 @@ jobs:
run: go build -v ./...
- name: Testing
run: go test -v ./...
exotic_job:
name: Go-${{matrix.CFG[2]}}/${{matrix.CFG[0]}}
s390x_job:
name: Go-1.14/s390x
runs-on: ubuntu-18.04
strategy:
matrix:
CFG: [ [arm64,arm64v8,1.14] ]
steps:
- uses: actions/checkout@v2
- name: Enabling Docker Experimental
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
echo $'{\n\t"experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: Pulling Images
run: |
docker pull -q multiarch/qemu-user-static
docker pull -q --platform linux/${{matrix.CFG[0]}} ${{matrix.CFG[1]}}/golang:${{matrix.CFG[2]}}
docker pull -q multiarch/fedora:29-s390x
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Testing
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` ${{matrix.CFG[1]}}/golang:${{matrix.CFG[2]}} go test -v ./...
uses: ./.github/actions/fedora-s390x
coverage_amd64_job:
needs: [ amd64_job ]
needs: [amd64_job]
if: github.event_name == 'push'
runs-on: ubuntu-18.04
name: amd64/coverage
Expand Down
9 changes: 3 additions & 6 deletions dh/csidh/fp511_amd64.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build amd64,!noasm
// +build amd64

package csidh

Expand All @@ -11,12 +11,9 @@ import (
var (
// Signals support for BMI2 (MULX)
hasBMI2 = cpu.X86.HasBMI2
// Signals support for ADX and BMI2
hasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX
_ = hasBMI2
)

var _ = hasBMI2

func mul512(r, m1 *fp, m2 uint64) { mul512Amd64(r, m1, m2) }
func cswap512(x, y *fp, choice uint8) { cswap512Amd64(x, y, choice) }
func mulRdc(r, x, y *fp) { mulRdcAmd64(r, x, y) }
Expand All @@ -36,7 +33,7 @@ func mulRdcAmd64(r, x, y *fp) {
var t fp
var c uint64

if hasADXandBMI2 {
if cpu.X86.HasBMI2 && cpu.X86.HasADX {
mulBmiAsm(r, x, y)
} else {
mulGeneric(r, x, y)
Expand Down
6 changes: 6 additions & 0 deletions dh/sidh/internal/p434/arith_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package p434

import "golang.org/x/sys/cpu"

// HasADXandBMI2 signals support for ADX and BMI2
var HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX
4 changes: 0 additions & 4 deletions dh/sidh/internal/p434/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package p434

import (
"github.com/cloudflare/circl/dh/sidh/internal/common"
"golang.org/x/sys/cpu"
)

const (
Expand All @@ -13,9 +12,6 @@ const (
)

var (
// HasADXandBMI2 signals support for ADX and BMI2
HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX

// P434 is a prime used by field Fp434
P434 = common.Fp{
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFDC1767AE2FFFFFF,
Expand Down
13 changes: 13 additions & 0 deletions dh/sidh/internal/p503/arith_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package p503

import "golang.org/x/sys/cpu"

// According to https://github.com/golang/go/issues/28230,
// variables referred from the assembly must be in the same package.
var (
// HasBMI2 signals support for MULX which is in BMI2
HasBMI2 = cpu.X86.HasBMI2

// HasADXandBMI2 signals support for ADX and BMI2
HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX
)
8 changes: 0 additions & 8 deletions dh/sidh/internal/p503/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package p503

import (
"github.com/cloudflare/circl/dh/sidh/internal/common"
"golang.org/x/sys/cpu"
)

const (
Expand All @@ -14,13 +13,6 @@ const (

// P503 is a prime used by field Fp503
var (
// According to https://github.com/golang/go/issues/28230,
// variables referred from the assembly must be in the same package.
// HasBMI2 signals support for MULX which is in BMI2
HasBMI2 = cpu.X86.HasBMI2
// HasADXandBMI2 signals support for ADX and BMI2
HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX

// P503 is a prime used by field Fp503
P503 = common.Fp{
0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xABFFFFFFFFFFFFFF,
Expand Down
10 changes: 10 additions & 0 deletions dh/sidh/internal/p751/arith_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package p751

import "golang.org/x/sys/cpu"

var (
// HasBMI2 signals support for MULX which is in BMI2
HasBMI2 = cpu.X86.HasBMI2
// HasADXandBMI2 signals support for ADX and BMI2
HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX
)
5 changes: 0 additions & 5 deletions dh/sidh/internal/p751/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package p751

import (
"github.com/cloudflare/circl/dh/sidh/internal/common"
"golang.org/x/sys/cpu"
)

const (
Expand All @@ -13,10 +12,6 @@ const (
)

var (
// HasBMI2 signals support for MULX which is in BMI2
HasBMI2 = cpu.X86.HasBMI2
// HasADXandBMI2 signals support for ADX and BMI2
HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX
// P751 is a prime used by field Fp751
P751 = common.Fp{
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
Expand Down