Page MenuHomeFreeBSD

Basic signal tests: Can we deliver a signal?
ClosedPublic

Authored by imp on Mon, Nov 22, 4:34 PM.

Details

Summary

Basic signal tests that tests can we deliver a signal via raise() and
can we deliver one via SIGALARM asynchronously.

In addition, tests whether or not on ARM T32 (Thumb) code can interrupt
A32 (normal) and vice versa.

While this test is aimed at ensuring basic qemu signals are working,
it's good to have in the base.

Sponsored by: Netflix

Test Plan

Tested on x86 and passes.
Haven't tested the armv7 stuff yet.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

imp requested review of this revision.Mon, Nov 22, 4:34 PM
imp created this revision.
tests/sys/kern/basic_signal.c
4

Nice

13

+volatile here and on the ARM ones

78

I think this and the below will need alternative GCC versions; the GCC documentation seems to indicate that arch= is specifically for -march options, and the GCC equivalents to this specifically are just target("arm") and target("thumb").

I wonder if these are worth macros in cdefs.h, but I really can't come up with a good name for those... __thumb is maybe not terrible, but __arm probably is. __a32 and __t32 maybe, but that feels a bit obscure.

tests/sys/kern/basic_signal.c
78

I think clang now support the GNU syntax, so maybe using it would be enough ?

https://reviews.llvm.org/D33721

tests/sys/kern/basic_signal.c
78

They build and appear to work on both. I'm not sure I want to invent something for FreeBSD for an architecture that may be the long glide path after peaking that currently only has use in a test.

imp edited the test plan for this revision. (Show Details)

+ volatile.

tests/sys/kern/basic_signal.c
78

Hmmm, there may be a clang issue... Rebuilding to make sure.

imp marked 2 inline comments as done.Mon, Nov 22, 11:31 PM

Updated with the 'marker' things. Didn't see that we had this in the rest of the tree, so I thought I'd limit them to this file...

tests/sys/kern/basic_signal.c
78

As you see, I needed to update since the above code review doesn't seem to be in the clang tree yet. Or at least the latest tree needs them...

... The only other place that we'd need them is when we do T32 / A32 thread tests...

tests/sys/kern/basic_signal.c
82

Shouldn't that be just target("arm") and target("thumb") for gcc ? :)

Turns out cognet was right. target("arm") not target("arch=arm") is the
form. And it seems to work for both clang and arm.

better comments. remind the reader that thumb function addresses have the low
bit set.

imp marked 2 inline comments as done.Tue, Nov 23, 8:40 PM

I'm going to go ahead and commit this: it passes in my env for amd64, aarch64 and armv7 (running in a chroot on aarch64).

tests/sys/kern/basic_signal.c
78

My last comment is wrong: this code was wrong in arch=arm. target(arm) and target(thumb) just work for both gcc and clang.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Nov 23, 8:42 PM
This revision was automatically updated to reflect the committed changes.