diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2015-06-10 10:43:59 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2015-06-10 10:43:59 +0000 |
commit | 4ea6a9a28fd7ae3cc6e8697bc93f9ce5ea6b6262 (patch) | |
tree | 4be753ea914cbf9f2ee65a2a1cc53e6989224d5d /sys/amd64 | |
parent | 8bd0e175953787f1209a257c622415b6e93cf29c (diff) | |
download | src-4ea6a9a28fd7ae3cc6e8697bc93f9ce5ea6b6262.tar.gz src-4ea6a9a28fd7ae3cc6e8697bc93f9ce5ea6b6262.zip |
Generalised support for copy-on-write structures shared by threads.
Thread credentials are maintained as follows: each thread has a pointer to
creds and a reference on them. The pointer is compared with proc's creds on
userspace<->kernel boundary and updated if needed.
This patch introduces a counter which can be compared instead, so that more
structures can use this scheme without adding more comparisons on the boundary.
Notes
Notes:
svn path=/head/; revision=284214
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/trap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 08363756065b..fa74eb286a84 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -257,8 +257,8 @@ trap(struct trapframe *frame) td->td_pticks = 0; td->td_frame = frame; addr = frame->tf_rip; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); + if (td->td_cowgen != p->p_cowgen) + thread_cow_update(td); switch (type) { case T_PRIVINFLT: /* privileged instruction fault */ |