Commit Graph

245953 Commits

Author SHA1 Message Date
martin
ed3eda7194 Add NODEBUGLIB here as well (sync with binutils directory) 2016-11-04 13:29:38 +00:00
kamil
e70724aaaf The problem with WIFCONTINUED() and WIFSTOPPED() in traceme4 is resolved
Fixed by Christos Zoulas in:
cvs rdiff -u -r1.260 -r1.261 src/sys/kern/kern_exit.c
http://mail-index.netbsd.org/source-changes/2016/11/03/msg078852.html

This has been verified to work on NetBSD releng machines.

Closes PR kern/51596

Sponsored by <The NetBSD Foundation>.
2016-11-04 09:08:11 +00:00
skrll
958325a389 Cmoment formatting. No functional change. 2016-11-04 08:24:36 +00:00
macallan
7a874cfdc6 add plumbing to support bus_space_mmap() with:
- write combining allowed via BUS_SPACE_MAP_PREFETCHABLE
- byte order translation via BUS_SPACE_MAP_LITTLE
2016-11-04 05:41:01 +00:00
joerg
374e459041 Tail calls can use the PLT without a nop after the branch. Since the
callee won't return to the next instruction anyway, it wouldn't work
anyway.
2016-11-04 00:19:32 +00:00
pgoyette
d671bf9bca Move if_43.c out of Makefile.sysio and into the main Makefile.
The former location gets included in both libcompat and the compat
module, leading to redefined symbols when the module is loaded.  By
moving it to the main Makefile, it gets included only in libcompat.

XXX This still isn't an ideal solution, but it will suffice until
XXX PR kern/51598 is addressed.
2016-11-03 22:23:03 +00:00
joerg
e887dd50b2 Mark the new SPARCv9-in-32bit-mode modules as needing V9. 2016-11-03 22:18:29 +00:00
kamil
f26cf4cb48 Prefer modern simple past tense and past participle of catch
The "catched" form is obsolete and nonstandard, prefer "caught".
2016-11-03 22:08:30 +00:00
christos
7bfe2974a7 Fix wrong WIFCONTINUED() status. 2016-11-03 20:58:25 +00:00
kamil
a46fa40c88 Add FORKEE_ASSERTX()/FORKEE_ASSERT() for forkee; simplify code
A child process cannot call atf functions and expect them to magically
work like in the parent.
The printf(3) messaging from a child will not work out of the box as well
without estabilishing a communication protocol with its parent. To not
overcomplicate the tests - do not log from a child and use err(3)/errx(3)
wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.

Simplify and cleanup code of the tests.

Sponsored by <The NetBSD Foundation>.
2016-11-03 20:24:18 +00:00
kamil
7e50848df6 Simplify code, prefer strerror(3) over sys_errlist(3)
No functional change intended.

strerror(3) change requested by <kre>.
Sponsored by <The NetBSD Foundation>.
2016-11-03 18:54:16 +00:00
kamil
8fa3e407e9 Mark ptraceme4 as expected failure, assume that Linux&FreeBSD are correct
Raising SIGCONT from a ptrace(2)d child should be catched with waidpid(2)
as WIFCONTINUED() false and WIFSTOPPED() true; not both true as it does not
make much sense.

PR kern/51596

Change requested by <kre>
Checked by <christos>

Sponsored by <The NetBSD Foundation>
2016-11-03 18:25:54 +00:00
pgoyette
9f1344db25 Hmmm, if we omit if_43.c from the SRCS list, then we break the i386
build for one of the XEN kernels.

Adding it back to the list.  At least the build will be successful.

XXX This is probably not the end of this saga, as we still have the
XXX redefined-symbol issue when loading the compat module on amd64.
XXX But for now, a working build for the vast majority of users
XXX (including our automated test suites) is more important than a
XXX successfully-loadable compat module.
2016-11-03 11:32:15 +00:00
kamil
9a8dc0b4a1 Add new test traceme4 in t_ptrace
This test verifies calling raise(2) with the SIGCONT argument in the child.
The parent is notified with it and asserts that WIFCONTINUED() and
WIFSTOPPED() are both set.

XXX: This behavior is surprising. Linux for the same code-path returns false
for WIFCONTINUED() and true for WIFSTOPPED().

Include <stdlib.h> for EXIT_FAILURE.

This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
test in the ptraceme category.

Sponsored by <The NetBSD Foundation>.

For future reference and convenience, an out-of-ATF test is as follows:
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#define ATF_REQUIRE(a) assert(a)

#if defined(linux)
#define WALLSIG __WALL
#define sys_signame sys_siglist
#endif

int main(int argc, char **argv)
{
        int status;
        const int exitval = 5;
        const int sigval = SIGSTOP, sigsent = SIGCONT;
        pid_t child, wpid;

        printf("1: Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
                /* printf(3) messages from a child aren't intercepted by ATF */
                /* "2: Child process PID=%d\n", getpid() */

                /* "2: Before calling ptrace(PT_TRACE_ME, ...)\n" */
                if (ptrace(PT_TRACE_ME, 0, NULL, 0) == -1) {
                        /* XXX: Is it safe to use ATF functions in a child? */
                        err(EXIT_FAILURE, "2: ptrace(2) call failed with "
                            "status %s", sys_errlist[errno]);
                }

                /* "2: Before raising SIGSTOP\n" */
                raise(sigval);

                /* "2: Before raising SIGCONT\n" */
                raise(sigsent);

                /* "2: Before calling _exit(%d)\n", exitval */
                _exit(exitval);
        } else {
                printf("1: Parent process PID=%d, child's PID=%d\n", getpid(),
                    child);

                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating child's PID (expected %d, got %d)\n",
                    child, wpid);
                ATF_REQUIRE(child == wpid);

                printf("1: Ensuring that the child has not been exited\n");
                ATF_REQUIRE(!WIFEXITED(status));

                printf("1: Ensuring that the child has not been continued\n");
                ATF_REQUIRE(!WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has been stopped\n");
                ATF_REQUIRE(WIFSTOPPED(status));
                printf("1: Verifying that he child has been stopped with the"
                    " %s signal (received %s)\n", sys_signame[sigval],
                    sys_signame[WSTOPSIG(status)]);
                ATF_REQUIRE(WSTOPSIG(status) == sigval);

                printf("1: Before resuming the child process where it left "
                    "off and without signal to be sent\n");
                ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0)
                    != -1);

                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, WALLSIG);

                printf("1: Validating that child's PID is still there\n");
                ATF_REQUIRE(wpid == child);

                printf("1: Ensuring that the child has not been exited\n");
                ATF_REQUIRE(!WIFEXITED(status));

                printf("1: Ensuring that the child has been continued\n");
                ATF_REQUIRE(WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has not been stopped\n");
                ATF_REQUIRE(WIFSTOPPED(status));

                printf("1: Before resuming the child process where it left "
                    "off and without signal to be sent\n");
                ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating that child's PID is still there\n");
                ATF_REQUIRE(wpid == child);

                printf("1: Ensuring that the child has been exited\n");
                ATF_REQUIRE(WIFEXITED(status));

                printf("1: Ensuring that the child has not been continued\n");
                ATF_REQUIRE(!WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has not been stopped\n");
                ATF_REQUIRE(!WIFSTOPPED(status));

                printf("1: Verifying that he child has exited with the "
                    "%d status (received %d)\n", exitval, WEXITSTATUS(status));
                ATF_REQUIRE(WEXITSTATUS(status) == exitval);

                printf("1: Before calling waitpid() for the exited child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating that child's PID no longer exists\n");
                ATF_REQUIRE(wpid == -1);

                printf("1: Validating that errno is set to %s (got %s)\n",
                    sys_errlist[ECHILD], sys_errlist[errno]);
                ATF_REQUIRE(errno == ECHILD);
	}
}
2016-11-03 11:20:45 +00:00
hannken
30572e03fd Add a function to print the fields of a vnode including its implementation
and use it from vprint() and vfs_vnode_print().

Move vstate_name() to vfs_subr.c.
2016-11-03 11:04:21 +00:00
hannken
175d720a94 Split sys/vnode.h into sys/vnode.h and sys/vnode_impl.h
- Move _VFS_VNODE_PRIVATE protected operations into vnode_impl.h.
- Move struct vnode_impl definition and operations into vnode_impl.h.
- Include vnode_impl.h where we include vnode.h with _VFS_VNODE_PRIVATE defined.
- Get rid of _VFS_VNODE_PRIVATE.
2016-11-03 11:03:31 +00:00
hannken
4f55676a14 Prepare the split of sys/vnode.h into sys/vnode.h and sys/vnode_impl.h
- Rename struct vcache_node to vnode_impl, start its fields with vi_.
- Rename enum vcache_state to vnode_state, start its elements with VS_.
- Rename macros VN_TO_VP and VP_TO_VN to VIMPL_TO_VNODE and VNODE_TO_VIMPL.
- Add typedef struct vnode_impl vnode_impl_t.
2016-11-03 11:02:09 +00:00
kre
6f49e7d891 This script needed some updates for an earlier tzdata upgrade
(one which used a different key for the signature of the data file...)
Allow either key to work.   Also update the name of the sets list
file to match modern reality (only affects instructions issued to user.)

I skipped committing these changes until it had been used a few times
to verify that it actually works properly...   it seems to.
2016-11-03 10:11:05 +00:00
kre
a9e931a44a I should learn to read a calendar, and not just cut&paste... 2016-11-03 10:04:36 +00:00
kre
ce6897c67c New zoneinfo file for Asia/Famagusta (north Cyprus) from tzdata2016i 2016-11-03 10:00:11 +00:00
kre
aaa2e0eafa Note upgrade of tzdata to 2016i 2016-11-03 09:57:18 +00:00
kre
6bcfafb89f Merge tzdata2016i 2016-11-03 09:53:13 +00:00
kre
6dd37d0381 Import tzdata2016i from ftp://ftp.iana.org/tz/releases/tzdata2016i.tar.gz
Summary of changes in tzdata2016i (2016-11-01 23:19:52 -0700):

  Cyprus split into two time zones on 2016-10-30 (new zone is
  Asia/Famagusta and is UTC+3 year round).  Tonga reintroduces
  summer time on 2016-11-06 (assumed for now to be aligned with Fiji).
  This year's summer time switch (from +08 to +11) for Antarctica/Casey
  occurred 2016-10-22.

  Also (minor) adjustments to some historic data for Italy (most
  recent applies to time of day of switch out of summer time in period
  1967-1970 & 1972-1974, other changes relate to 1910's and 1940's.)
2016-11-03 09:52:33 +00:00
kamil
0c55761e36 Add new test traceme3 in t_ptrace
This test is modeled after traceme1 and traceme2 with the goal to test if
the child was terminated with a received signal passed with PT_CONTINUE.

Currently the three traceme tests verifies three possible status values from
waitpid(2) called by the parent:
 - WIFEXITED(status),
 - WIFSIGNALED(status),
 - WIFSTOPPED(status)
with associated macros:
 - WEXITSTATUS(status),
 - WTERMSIG(status),
 - WCOREDUMP(status),
 - WSTOPSIG(status).

In traceme3 has been assumed that Ctrl-C (SIGINT) does not emit core(5).

Sponsored by <The NetBSD Foundation>.
2016-11-03 08:48:53 +00:00
pgoyette
2cc02dd108 Really comment out if_43.c this time. (I need sleep and/or caffeine.) 2016-11-03 06:54:08 +00:00
pgoyette
67c9692b56 Use proper characgter to introduce comments! 2016-11-03 06:28:04 +00:00
pgoyette
f54cbfd20b if_43.o gets included from libcompat automatically, due to two calls
to compat_cvtcmd() in if.c.  Ideally, if.c would be modified to have
a pointer to a no-op compat_cvtcmd() and that pointer would get
replaced by compat_modcmd(MODULE_CMD_INIT, ...) code.  But for now,
just don't include it in the compat module at all.
2016-11-03 06:22:29 +00:00
riastradh
2903f566e2 Reorganize SRCS lists for libcompat, compat.kmod, sysv_ipc.kmod.
- Share lists between the libcompat and module makefiles.
- Include some omitted entries in compat.kmod:
  . if_43.c
  . kern_sa_60.c
  . kern_time_30.c
  . rndpseudo_50.c
  . rtsock_14.c
  . rtsock_50.c
  . rtsock_70.c
  . uipc_syscalls_40.c
  . uipc_syscalls_50.c
- Exclude a (harmless) spurious entry in sysv_ipc.kmod on LP64 systems:
  . kern_ipc_10.c

Should fix broken ifconfig on modular current kernels.

ok pgoyette
2016-11-03 04:26:58 +00:00
pgoyette
18cd37a864 Remove ptrace_do{,fp}regs - they are a duplicate of process_* routines
which are still in sys_ptrace_common.c.
2016-11-03 03:57:05 +00:00
pgoyette
15de9b6038 Module procfs needs ptrace_common for process_do{,fp}regs 2016-11-03 03:53:32 +00:00
riastradh
00d7b5f1e4 Sprinkle #ifdef _KERNEL_OPT. 2016-11-03 03:37:06 +00:00
christos
f47de02583 More detailed error messages for text relocations on ppc code. Tested by joerg@ 2016-11-03 01:22:59 +00:00
riastradh
ce8d993853 Avoid zero-size uao.
Apparently some GEM/TTM objects can be zero-size, as discovered by
Stefan Hertenberger:
https://mail-index.netbsd.org/current-users/2016/08/02/msg029891.html
2016-11-03 00:10:49 +00:00
kamil
830850eb4c Add new test-case "traceme2" in t_ptrace
This test is a clone of traceme2 with ptrace(2) calling PT_CONTINUE
with signal to be passed to the child: SIGINT. traceme1 sends no signals.

Sponsored by <The NetBSD Foundation>.
2016-11-02 22:18:04 +00:00
flxd
196134d5e3 Note tcu(4). 2016-11-02 17:19:53 +00:00
joerg
1d7b126130 Logical negation binds stronger than bitwise and, which doesn't seem to
be intended here.
2016-11-02 13:15:53 +00:00
kamil
46910e0e26 Add new test t_ptrace with traceme1
This test is a placeholder for further checks of the native ptrace(2)
function calls.

XXX: Is it safe to call ATF functions from a child? FreeBSD seems to
     construct dedicated asserts for them.

XXX: printf(3) calls from a child are not intercepted by atf-run(1)

Sponsored by <The NetBSD Foundation>.
2016-11-02 12:51:22 +00:00
ryo
cc1c85bff6 fix column alignment of "intrctl list [-c]" 2016-11-02 11:03:33 +00:00
msaitoh
927c094fa1 - Fix workaround which did dummy read BM_WUC register. This code was changed to
drop BM_WUC_HOST_WU_BIT of BM_PROT_GEN_CFG register in FreeBSD r228386. The
  code was added rev. 1.149, but the location was not the best.
  Now I219 doesn't hang quickly after "ifconfig up".
- wm_gmii_hv_{read/write}reg*(): USE PHY address 1 for some special registers.
- Add check code for an 82578 workaround. Not completed yet(check only).
- wm_release_hw_control(): Remove extra line. No any effect.
2016-11-02 10:14:04 +00:00
msaitoh
31ec994666 Set mii_mpd_{oui,model,rev}. 2016-11-02 10:11:32 +00:00
msaitoh
8fd2b67f97 Set mii_mpd_{oui,model,rev}. 2016-11-02 07:01:54 +00:00
ozaki-r
ede76fae4b Add missing pserialize_read_exit 2016-11-02 03:43:27 +00:00
pgoyette
bf821edee1 Typo - "a requests" --> "a request" 2016-11-02 03:21:38 +00:00
jnemeth
26440e41e3 Correct misplaced break; from FreeBSD.
Approved By: christos
2016-11-02 03:15:07 +00:00
pgoyette
dab9e94e16 Missed these, too, during the regen. No functional changes, just
committing to keep the "generated from" comments in sync.
2016-11-02 03:14:19 +00:00
pgoyette
d9c2f2d6ab Belatedly bump the kernel version for recent modularization changes for
ptrace(2).
2016-11-02 03:06:19 +00:00
christos
5651a1bdca update bind 2016-11-02 00:40:27 +00:00
pgoyette
d2c5fd3368 Protect against buffer overflow. 2016-11-02 00:39:56 +00:00
pgoyette
d365923e93 Forgot these two generated files... 2016-11-02 00:32:59 +00:00
pgoyette
032607b8f0 Regenerate files for modularization of ptrace(2) 2016-11-02 00:14:11 +00:00