Commit Graph

256771 Commits

Author SHA1 Message Date
maxv f2cbc9d834 Improve the SVS initialization.
Declare x86_patch_window_open() and x86_patch_window_close(), and globalify
x86_hotpatch().

Introduce svs_enable() in x86/svs.c, that does the SVS hotpatching.

Change svs_init() to take a bool. This function gets called twice; early
when the system just booted (and nothing is initialized), lately when at
least pmap_kernel has been initialized.
2018-02-22 09:41:06 +00:00
maxv ebc1f703f9 Add a dynamic detection for SVS.
The SVS_* macros are now compiled as skip-noopt. When the system boots, if
the cpu is from Intel, they are hotpatched to their real content.
Typically:

		jmp	1f
		int3
		int3
		int3
		... int3 ...
	1:

gets hotpatched to:

		movq	SVS_UTLS+UTLS_KPDIRPA,%rax
		movq	%rax,%cr3
		movq	CPUVAR(KRSP0),%rsp

These two chunks of code being of the exact same size. We put int3 (0xCC)
to make sure we never execute there.

In the non-SVS (ie non-Intel) case, all it costs is one jump. Given that
the SVS_* macros are small, this jump will likely leave us in the same
icache line, so it's pretty fast.

The syscall entry point is special, because there we use a scratch uint64_t
not in curcpu but in the UTLS page, and it's difficult to hotpatch this
properly. So instead of hotpatching we declare the entry point as an ASM
macro, and define two functions: syscall and syscall_svs, the latter being
the one used in the SVS case.

While here 'syscall' is optimized not to contain an SVS_ENTER - this way
we don't even need to do a jump on the non-SVS case.

When adding pages in the user page tables, make sure we don't have PG_G,
now that it's dynamic.

A read-only sysctl is added, machdep.svs_enabled, that tells whether the
kernel uses SVS or not.

More changes to come, svs_init() is not very clean.
2018-02-22 08:56:51 +00:00
msaitoh c12c1020e1 - Apply ixgbe.c rev. 1.124 to ixv.c. Fix a bug that RX may stall on heavy load
on ixv(4) derived from FreeBSD's AIM (Auto Interrupt Moderation) bug.
 ITR_INTERVAL value must be larger than 4us.

- The bitfield of EITR register is different between 82598 and others.
 ixv.c had a bug that it accessed 82598's way even though only 82599 and
 newer support virtual function. Fix it using with new ixv_eitr_write()
 function.
2018-02-22 08:49:42 +00:00
maxv 411ee66e5e Revert all my latest changes, and restore this file back to how it was
in rev1.24. I wanted to replace the functions dynamically for SVS, but
that was a dumb idea, we'll just hotpatch instead.
2018-02-22 08:36:31 +00:00
pgoyette d831ae84a0 Remove extra "an"
Thanks to J. Lewis Muir
2018-02-22 08:33:43 +00:00
msaitoh c0048f42c5 Regen. 2018-02-22 07:53:13 +00:00
msaitoh f65a80924c Add some Xeon E5 (v1) and E5 v2 devices. 2018-02-22 07:52:46 +00:00
mrg 374a4ca79b move "define tcbus {}" into files.alpha. it isn't wanted for general
ports, and generates an unused symbol for pmax.  with this both alpha
and pmax kernel work with gcc 5 and 6.
2018-02-22 07:30:43 +00:00
mrg da58b5e34c re-port the patch from https://gcc.gnu.org/bugzilla/attachment.cgi?id=15492.
- local HOST_WIDE_INT_CONSTANT macro same as new HOST_WIDE_INT_C macro,
  so use it instead, and remove the local macro.
- re-port the genrecog.c change which was missed in early GCC-6 port.

this makes sh3 work again.
2018-02-22 07:24:19 +00:00
mrg 67c67975c6 bump image size for gcc 6 bloaty mc bloat face. 2018-02-22 07:21:10 +00:00
msaitoh 9d47bd6cf6 Regen. 2018-02-22 05:23:55 +00:00
msaitoh a2ba4bf8b8 s/C62x9/C62x/ 2018-02-22 05:23:29 +00:00
msaitoh 3639a6a58d Add C620 devices. 2018-02-22 05:09:56 +00:00
msaitoh 9993be85ad Regen. 2018-02-22 03:13:38 +00:00
msaitoh c6b09d4225 Fix C62x9 sSATA Controller (RAID) device ID. 2018-02-22 03:13:18 +00:00
msaitoh 7ec4fc9862 Regen. 2018-02-22 03:03:52 +00:00
msaitoh 4cd4349560 Add C620 devices. 2018-02-22 03:03:28 +00:00
sjg b4dd1ca28c Avoid calling sysconf for every file loaded.
At start of a meta build this can be measurable overhead.

Patch from bdrewery at freebsd.org
2018-02-22 01:59:28 +00:00
christos 9ec2100f76 notyet an unused variable. 2018-02-22 01:50:26 +00:00
pgoyette 0ef61efcca Add config option for tpm at acpi 2018-02-22 01:40:49 +00:00
christos 63b13d00d5 gcc-6 needs -nosse 2018-02-22 01:37:04 +00:00
jdolecek f82a61429e KERNEL_PID is > 0 on powerpc/ibm4xx, need to mask all bits <0,
KERNEL_PID> to avoid triggering KASSERT() checking allocated asid
is bigger than KERNEL_PID; adjust also TLBINFO_ASID_INITIAL_FREE()
accordingly

discussed with Nick
2018-02-21 21:53:54 +00:00
maxv 790020449d Style, no functional change. 2018-02-21 17:04:52 +00:00
maxv 2256f36f66 Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).
2018-02-21 16:55:53 +00:00
maxv 8084c6496d Argh, in my previous commit in this file I forgot to fix the IPv6
entry point; apply the same fix there.
2018-02-21 16:48:28 +00:00
maxv b9badffce8 Fix ipsec4_get_ulp(). We should do "goto done" instead of "return",
otherwise the port fields of spidx are uninitialized.

ok mlelstv@
2018-02-21 16:42:33 +00:00
maxv 8df55a522b Use inpcb_hdr to reduce the diff between:
ipsec4_hdrsiz      and ipsec6_hdrsiz
	ipsec4_in_reject   and ipsec6_in_reject
	ipsec4_checkpolicy and ipsec4_checkpolicy

The members of these couples are now identical, and could be merged,
giving only three functions instead of six...
2018-02-21 16:38:15 +00:00
maxv af69f63988 Rename:
ipsec_in_reject -> ipsec_sp_reject
	ipsec_hdrsiz    -> ipsec_sp_hdrsiz

localify the former, and do some cleanup while here.
2018-02-21 16:18:52 +00:00
maxv ff46a2a32a Extend these #ifdef notyet. The m_copydata's in these branches are wrong,
we are not guaranteed to have enough room for another struct ip, and we
may crash here. Triggerable remotely, but after authentication, by sending
an AH packet that has a one-byte-sized IPIP payload.
2018-02-21 16:08:55 +00:00
uwe ecb11c8936 Consistenly use "host byte order". 2018-02-21 14:11:09 +00:00
skrll e094350db7 Avoid UB (shift of negative number) 2018-02-21 10:42:16 +00:00
wiz c8f3c2c806 Fix endnetent prototype. Fix NULL. New sentence, new line. 2018-02-21 09:47:37 +00:00
msaitoh 0210e3e69f Regen. 2018-02-21 08:39:40 +00:00
msaitoh 6e0782f0b7 Add some Intel Ethernet devices. 2018-02-21 08:39:08 +00:00
pgoyette 0484fb2f3f On the off chance that someone tries to use the modular version of the
ld(4) driver, provide an ld.ioconf file which will declare the global ld_cd
2018-02-21 08:36:36 +00:00
msaitoh 89c3f304e6 Add some ServerEngines (Emulex) products from OpenBSD. 2018-02-21 07:49:47 +00:00
kamil 01e8caecb0 Improve the getnetent(3) man-page
Document return type of setnetent(3) and endnetent(3). Both "void".

Sponsored by <The NetBSD Foundation>
2018-02-21 03:13:50 +00:00
kamil c20547db43 Enable O_NOFOLLOW in the POSIX namespace
This open(2) flag first appeared in FreeBSD and was standarized by POSIX
in the 2008 standard.
2018-02-20 18:20:05 +00:00
uwe 9f4bd1d874 Markup "stdin". 2018-02-20 17:23:39 +00:00
uwe 250ec2c82f Make the list of STDBUF values and the list of mode values congruent
in formatting and spelling.
2018-02-20 17:21:11 +00:00
uwe e41e0b24d7 Use semantic markup. 2018-02-20 17:16:51 +00:00
wiz cea61a7fb4 Add missing end quote.
Avoid some punctuation markup.
2018-02-20 15:56:43 +00:00
ws 02a64c6983 Add description of how to attach ugen to only some of the
interfaces found in a device.
2018-02-20 15:50:02 +00:00
ws 20be9ccf4e Attach uftdi to each interface found in the device separately.
This allows for other drivers (e.g. ugen) to attach to some of
the other interfaces.

Allow ugen to attach only to some of the interfaces found in a device.
2018-02-20 15:48:37 +00:00
martin 031637411f Backout my over-eager backout - we need this for sparc64 building netbsd32
compat libs, but still lots of #ifdef's missing to make this ready for
usage by sparc.
2018-02-20 13:14:02 +00:00
martin 32bba72871 Switch sparc back to old openssl - needs more work and testing. 2018-02-20 12:49:40 +00:00
martin 9d80f6b600 Backout previous "regen" - the regen target in this directory is bogus,
there is no "sparcv9" nor any "vis" in the default CPU targets for
NetBSD/sparc.
2018-02-20 12:48:46 +00:00
wiz 907372ab78 Whitespace improvements. Remove unnecessary Tn. 2018-02-20 09:37:56 +00:00
wiz cb12e23020 Remove ineffective macros and arguments. 2018-02-20 09:36:26 +00:00
pgoyette aba5e60ef6 Update to include wbsio as a possible parent for a gpio device.
XXX Should we really list all the possible parents?  Or should we replace
XXX this entire list with a single entry for "gpio* at gpiobus?"
2018-02-20 09:07:18 +00:00