Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(39)

Issue 34640045: runtime: do not use memmove in the Plan 9 signal handler (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by ality
Modified:
10 years, 5 months ago
Reviewers:
rsc
CC:
rsc, golang-dev
Visibility:
Public.

Description

runtime: do not use memmove in the Plan 9 signal handler Fixes a regression introduced in revision 4cb93e2900d0. That revision changed runtime·memmove to use SSE MOVOU instructions for sizes between 17 and 256 bytes. We were using memmove to save a copy of the note string during the note handler. The Plan 9 kernel does not allow the use of floating point in note handlers (which includes MOVOU since it touches the XMM registers). Arguably, runtime·memmove should not be using MOVOU when GO386=387 but that wouldn't help us on amd64. It's very important that we guard against any future changes so we use a simple copy loop instead. This change is extracted from CL 9796043 (since that CL is still being ironed out).

Patch Set 1 #

Patch Set 2 : diff -r bddf2a72f5e1 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 7326da92ff4d https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -12 lines) Patch
M src/pkg/runtime/os_plan9_386.c View 1 1 chunk +12 lines, -6 lines 0 comments Download
M src/pkg/runtime/os_plan9_amd64.c View 1 1 chunk +12 lines, -6 lines 0 comments Download

Messages

Total messages: 3
rsc
LGTM
10 years, 5 months ago (2013-12-09 23:40:27 UTC) #1
rsc
LGTM
10 years, 5 months ago (2013-12-09 23:40:27 UTC) #2
rsc
10 years, 5 months ago (2013-12-09 23:41:52 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=c840aa69ab55 ***

runtime: do not use memmove in the Plan 9 signal handler

Fixes a regression introduced in revision 4cb93e2900d0.

That revision changed runtime·memmove to use SSE MOVOU
instructions for sizes between 17 and 256 bytes. We were
using memmove to save a copy of the note string during
the note handler. The Plan 9 kernel does not allow the
use of floating point in note handlers (which includes
MOVOU since it touches the XMM registers).

Arguably, runtime·memmove should not be using MOVOU when
GO386=387 but that wouldn't help us on amd64. It's very
important that we guard against any future changes so we
use a simple copy loop instead.

This change is extracted from CL 9796043 (since that CL
is still being ironed out).

R=rsc
CC=golang-dev
https://codereview.appspot.com/34640045

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b