Page MenuHomeFreeBSD

Basic signal tests: Can we deliver a signal?
ClosedPublic

Authored by imp on Nov 22 2021, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 4:47 PM
Unknown Object (File)
Wed, Dec 11, 3:02 AM
Unknown Object (File)
Mon, Dec 9, 7:34 AM
Unknown Object (File)
Sat, Nov 30, 12:59 AM
Unknown Object (File)
Fri, Nov 29, 10:00 PM
Unknown Object (File)
Thu, Nov 28, 2:15 AM
Unknown Object (File)
Nov 23 2024, 2:09 PM
Unknown Object (File)
Nov 20 2024, 10:46 PM
Subscribers
None

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

Nice

14

+volatile here and on the ARM ones

79

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
79

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
79

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
79

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

imp marked 2 inline comments as done.Nov 22 2021, 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
79

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
83

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.Nov 23 2021, 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
79

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.Nov 23 2021, 8:42 PM
This revision was automatically updated to reflect the committed changes.