diff --git a/pkg/goid/BUILD b/pkg/goid/BUILD index 741cd1ae55..9debbddd18 100644 --- a/pkg/goid/BUILD +++ b/pkg/goid/BUILD @@ -13,6 +13,8 @@ go_library( "goid_122_arm64.s", "goid_123_amd64.s", "goid_123_arm64.s", + "goid_125_amd64.s", + "goid_125_arm64.s", ], stateify = False, visibility = ["//visibility:public"], diff --git a/pkg/goid/goid_123_amd64.s b/pkg/goid/goid_123_amd64.s index 9f53a4e971..21c61a7f6c 100644 --- a/pkg/goid/goid_123_amd64.s +++ b/pkg/goid/goid_123_amd64.s @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build go1.23 +//go:build go1.23 && !go1.25 #include "textflag.h" diff --git a/pkg/goid/goid_123_arm64.s b/pkg/goid/goid_123_arm64.s index 08d70578bf..c5ea2453a3 100644 --- a/pkg/goid/goid_123_arm64.s +++ b/pkg/goid/goid_123_arm64.s @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build go1.23 +//go:build go1.23 && !go1.25 #include "textflag.h" diff --git a/pkg/goid/goid_125_amd64.s b/pkg/goid/goid_125_amd64.s new file mode 100644 index 0000000000..796459dca6 --- /dev/null +++ b/pkg/goid/goid_125_amd64.s @@ -0,0 +1,26 @@ +// Copyright 2020 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build go1.25 + +#include "textflag.h" + +#define GOID_OFFSET 152 // +checkoffset runtime g.goid + +// func goid() int64 +TEXT ·goid(SB),NOSPLIT|NOFRAME,$0-8 + MOVQ (TLS), R14 + MOVQ GOID_OFFSET(R14), R14 + MOVQ R14, ret+0(FP) + RET diff --git a/pkg/goid/goid_125_arm64.s b/pkg/goid/goid_125_arm64.s new file mode 100644 index 0000000000..e6879a1181 --- /dev/null +++ b/pkg/goid/goid_125_arm64.s @@ -0,0 +1,26 @@ +// Copyright 2020 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build go1.25 + +#include "textflag.h" + +#define GOID_OFFSET 152 // +checkoffset runtime g.goid + +// func goid() int64 +TEXT ·goid(SB),NOSPLIT,$0-8 + MOVD g, R0 // g + MOVD GOID_OFFSET(R0), R0 + MOVD R0, ret+0(FP) + RET diff --git a/pkg/hosttid/BUILD b/pkg/hosttid/BUILD index f662c518c6..9a2d891e2c 100644 --- a/pkg/hosttid/BUILD +++ b/pkg/hosttid/BUILD @@ -9,8 +9,10 @@ go_library( name = "hosttid", srcs = [ "hosttid.go", - "hosttid_amd64.s", - "hosttid_arm64.s", + "hosttid_124_amd64.s", + "hosttid_124_arm64.s", + "hosttid_125_amd64.s", + "hosttid_125_arm64.s", ], visibility = ["//visibility:public"], ) diff --git a/pkg/hosttid/hosttid_amd64.s b/pkg/hosttid/hosttid_124_amd64.s similarity index 96% rename from pkg/hosttid/hosttid_amd64.s rename to pkg/hosttid/hosttid_124_amd64.s index d6e2c09c87..3047ce0ac8 100644 --- a/pkg/hosttid/hosttid_amd64.s +++ b/pkg/hosttid/hosttid_124_amd64.s @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build amd64 -// +build amd64 +//go:build !go1.25 #include "textflag.h" diff --git a/pkg/hosttid/hosttid_arm64.s b/pkg/hosttid/hosttid_124_arm64.s similarity index 96% rename from pkg/hosttid/hosttid_arm64.s rename to pkg/hosttid/hosttid_124_arm64.s index b2292e352e..9dd10110c3 100644 --- a/pkg/hosttid/hosttid_arm64.s +++ b/pkg/hosttid/hosttid_124_arm64.s @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build arm64 -// +build arm64 +//go:build !go1.25 #include "textflag.h" diff --git a/pkg/hosttid/hosttid_125_amd64.s b/pkg/hosttid/hosttid_125_amd64.s new file mode 100644 index 0000000000..37c915aaa9 --- /dev/null +++ b/pkg/hosttid/hosttid_125_amd64.s @@ -0,0 +1,29 @@ +// Copyright 2018 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build go1.25 + +#include "textflag.h" + +#define M_OFFSET 48 // +checkoffset runtime g.m +#define PROCID_OFFSET 64 // +checkoffset runtime m.procid + +TEXT ·Current(SB),NOSPLIT|NOFRAME,$0-8 + // procid is in getg().m.procid. + MOVQ TLS, AX + MOVQ 0(AX)(TLS*1), AX + MOVQ M_OFFSET(AX), AX // gp.m + MOVQ PROCID_OFFSET(AX), AX // mp.procid + MOVQ AX, ret+0(FP) + RET diff --git a/pkg/hosttid/hosttid_125_arm64.s b/pkg/hosttid/hosttid_125_arm64.s new file mode 100644 index 0000000000..e450ad01c8 --- /dev/null +++ b/pkg/hosttid/hosttid_125_arm64.s @@ -0,0 +1,28 @@ +// Copyright 2018 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build go1.25 + +#include "textflag.h" + +#define M_OFFSET 48 // +checkoffset runtime g.m +#define PROCID_OFFSET 64 // +checkoffset runtime m.procid + +TEXT ·Current(SB),NOSPLIT,$0-8 + // procid is in getg().m.procid. + MOVD g, R0 // g + MOVD M_OFFSET(R0), R0 // gp.m + MOVD PROCID_OFFSET(R0), R0 // mp.procid + MOVD R0, ret+0(FP) + RET