if !t.compileOnly && !t.short {
t.registerTest("GODEBUG=gcstoptheworld=2 archive/zip",
&goTest{
- variant: "runtime:gcstoptheworld2",
+ variant: "gcstoptheworld2",
timeout: 300 * time.Second,
short: true,
env: []string{"GODEBUG=gcstoptheworld=2"},
})
t.registerTest("GODEBUG=gccheckmark=1 runtime",
&goTest{
- variant: "runtime:gccheckmark",
+ variant: "gccheckmark",
timeout: 300 * time.Second,
short: true,
env: []string{"GODEBUG=gccheckmark=1"},
})
}
+ // Spectre mitigation smoke test.
+ if goos == "linux" && goarch == "amd64" {
+ // Pick a bunch of packages known to have some assembly.
+ pkgs := []string{"internal/runtime/...", "reflect", "crypto/..."}
+ if !t.short {
+ pkgs = append(pkgs, "runtime")
+ }
+ t.registerTest("spectre",
+ &goTest{
+ variant: "spectre",
+ short: true,
+ env: []string{"GOFLAGS=-gcflags=all=-spectre=all -asmflags=all=-spectre=all"},
+ pkgs: pkgs,
+ })
+ }
+
// morestack tests. We only run these in long-test mode
// (with GO_TEST_SHORT=0) because the runtime test is
// already quite long and mayMoreStackMove makes it about
// Call the expander for this size class
LEAQ ·gcExpandersAVX512(SB), BX
- CALL (BX)(CX*8)
+ MOVQ (BX)(CX*8), DX // Move to register first so -spectre works
+ CALL DX
MOVQ unpacked+16(FP), DI // Expanded output bitmap pointer
VMOVDQU64 Z1, 0(DI)
MOVQ objMarks+16(FP), AX
MOVQ sizeClass+24(FP), CX
LEAQ ·gcExpandersAVX512(SB), BX
- CALL (BX)(CX*8)
+ MOVQ (BX)(CX*8), DX // Move to register first so -spectre works
+ CALL DX
// Z3+Z4 = Load the pointer mask
MOVQ ptrMask+32(FP), AX