tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposed change to makesyscalls.sh



On Mon, 6 Aug 2018, Robert Elz wrote:

   Date:        Mon, 6 Aug 2018 05:07:03 +0800 (+08)
   From:        Paul Goyette <paul%whooppee.com@localhost>
   Message-ID:  <Pine.NEB.4.64.1808060459190.6292%speedy.whooppee.com@localhost>

 | Or we could just leave things alone, and tolerate the "hack" that is
 | currently being used.

Or there could just be a new 1 bit/syscall const data struct that says whether
the original (as compiled originally) syscall entry was sys_nomodule or
something different.   If the bit is set, put sys_nomodule back, otherwise
sys_nosys (those are the only possible values, right).

Yes, those are the only two values, as far as I can see.  I can't
imagine anything else making sense.

I looked into using bitstring(3) operations, but since that stuff "lives
in" /usr/include/bitstring.h it wasn't clear if using it in kernel code
would be appropriate.


makesyscalls.sh could easily make this new big vector, which would only be
used as part of unloading a syscall module, so need not be particularly
effecient (avoid big/little endian issues by making it an array of u_char if
that matters, for example).

My initial pass at this was to maintain the bit vector at run-time
rather than having makesyscalls.sh calculate the value.  The cost to
set the bits in syscall_establish() is not very large.

The only drawback here is to add a new entry to struct emul to point
at the bit vector, and to initialize it in every place that the
entrypoint array is initialized.  Not a big deal, but just a little
bit intrusive.

FWIW, what would you suggest as the name of a new struct emul member
(in sys/proc.h)?

	struct emul {
		...
		struct sysent	*e_sysent;	/* System call array */
		bitstr_t	*e_???	;	/* nomodule/nosys flag for
						 * syscall_disestablish() */
		...
	};


I'm beginning to think that this change really isn't worthwhile.  By
simply allowing syscall_establish() to modify both types of entry, we
accomplish the desired goal, with only the minor impact of unneeded
searches of the autoload list, IFF the syscall has been disestablished
AND subsequently invoked.  That invocation would fail anyway, so the
small amount of extra work for the search should not be significant.



+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index