Commit Graph

139577 Commits

Author SHA1 Message Date
maxv
171346be06 Improve the detection. Future generations of Intel CPUs will have a bit to
say they are not affected by Meltdown.
2018-03-30 19:58:05 +00:00
maxv
14852905ec Retrieve cpuid.7:%edx. 2018-03-30 19:51:53 +00:00
maxv
daafbb3bdf Add RDCL_NO and IBRS_ALL. 2018-03-30 19:49:49 +00:00
mlelstv
ad6fc8f7f3 Reset fail counter when link goes down so that next session starts
with the correct retry count.
2018-03-30 13:29:19 +00:00
mlelstv
ae07208ded add prototypes, validate ifm_change and ifm_status vectors. NFC. 2018-03-30 13:21:24 +00:00
maxv
6ceebe6d8a Fix warning when compiling Xen; FLAT_RING3_CS64 is defined in a child of
xen.h, which is already included in genassym.cf. So don't redefine it.
2018-03-30 10:01:36 +00:00
maxv
b48fbacf8e Add #ifndef XEN, xen doesn't have speculation_barrier. 2018-03-30 09:53:08 +00:00
msaitoh
49e0cfde79 Add Some bit definitions of AMD Fn80000001 %edx:
- MMX
 - FXSR
2018-03-30 09:30:56 +00:00
msaitoh
7499490426 From the latest Intel SDM:
- Add Intel Fn0000_0006 %eax new bit 14-20 (HWP stuff).
- Intel Fn0000_0007 %ecx bit 22 is for both RDPID and IA32_TSC_AUX.
2018-03-30 09:28:37 +00:00
maxv
3ce1315224 Remove dead code. It was introduced in rev1 (25 years ago), and is
irrelevant today.
2018-03-30 08:57:32 +00:00
maxv
5fc9cf327f Style, use NULL for pointers, use KASSERT, and don't inline huge functions,
we want to debug them with DDB (and not just with GPROF).
2018-03-30 08:53:51 +00:00
ragge
2a3a708ea4 Allow allocation of PTE space to fail in pmap_enter if PMAP_CANFAIL is set.
This fixes the panic part of PR port-vax/28379.
2018-03-30 08:34:35 +00:00
maxv
479f3edb5a Fix the log. mtod never returns NULL, so 'ip' is always non-NULL, and the
'ip6' branch is never taken. As a result we log garbage on IPv6 packets.

Use ip_v instead.
2018-03-30 08:25:06 +00:00
mlelstv
c69d6c55e1 Increase UVM read ahead window limit a bit to match concurrency of reading
from the raw device.
2018-03-30 07:22:59 +00:00
maxv
bb11bbb48c Use consttime_memequal instead of memcmp, to prevent side channels. This
functions returns 1 when the buffers are equal, contrary to memcmp, hence
the !.
2018-03-30 07:11:40 +00:00
msaitoh
a947615e2f - Add missing IFM_NONE support. If a interface support linkdown,
"ifconfig ixgN media none" drpos link.  Not all interface can do link down.

 Tested:
 	82598 AT2 (T)
	92599 SF+(SFI) (X520-DA2)
	X540
	X550-T1
	X550EM_x (X10SDV-8C-TLN4F)
	X550EM_a (A2SDi-H-TP4F port 0, 1 (T))

 Doesn't work:
	X550EM_a (A2SDi-H-TP4F port 2, 3 (SFP+ (KR)))
	X550EM_a (MA10-ST0 port 2, 3 (SFP+ (SFI)))
	(Denverton SFP+ can't force link down because SFP+'s TX_DISABLE pin is
	pull down. Is there a way to shutdown SFP+ cage's power?)
 Not tested:
 	82598 fiber.

- Change some functions static.
2018-03-30 06:44:30 +00:00
knakahara
4922de1111 Don't write EIMC directly. It is required to manage with struct ix_queue status.
XXX pullup-8
2018-03-30 03:58:20 +00:00
knakahara
a5b1a86c88 Fix the problem between eitr and link_speed.
In ixgbe_msix_que(), que->eitr_setting is limited to IXGBE_MIN_RSC_EITR_10G1G
when link_speed is 1Gbps or 10Gbps. However, que->eitr_setting is set to EITR
register in the *next* Tx/Rx interrupt. If link_speed changes from 100Mbps to
1Gbps ro 10Gbps, que->eitr_setting which is not limited can be set to EITR
register, that is, the problem fixed by ixgbe.c:r1.124 can occur in this case.

To fix this case, que->eitr_setting should be clear when link_speed is changed
or link state is changed.

Furthermore, expand the variants used for AIM (txr->bytes, txr->packets,
rxr->bytes and rxr->packets) from u32 to u64 to avoid wraparound which causes
que->eitr_setting calculation mistake.

XXX pullup-8
2018-03-30 03:56:38 +00:00
rmind
7d42705336 tcp_urp_drop: fix a bug introduced in 1.390 rev (hi maxv@). 2018-03-29 21:40:53 +00:00
macallan
8a5c12e7de audio works now, so enable it 2018-03-29 19:11:17 +00:00
maxv
c2ea766996 Remove TCPREASS_DEBUG. It was introduced 20 years ago when the reassembler
was being developed, but it's irrelevant today. Makes the code clearer.
2018-03-29 18:54:48 +00:00
macallan
6bde8e4865 explicitly enable the i2s part in the keylargo FCR
now this works on my PCI-X G5
2018-03-29 18:34:32 +00:00
maxv
8e8bd5fe5f Reorder/Fix comments to clarify. 2018-03-29 17:46:17 +00:00
maxv
0ec7f434fe Remove two more 'else' branches. 2018-03-29 17:12:36 +00:00
maxv
7e2cb8fdd7 Fix memory leak, we may reallocate 'tcp_saveti' after 'findpcb'. It's not
a tragic bug, because it happens only on sockets with debug enabled.
2018-03-29 17:09:00 +00:00
maxv
6ad7e2c6b1 Remove 'else', makes it clearer that we leave. 2018-03-29 17:01:46 +00:00
maxv
1aae7eafe6 Clarify with KASSERT. 2018-03-29 16:59:38 +00:00
maxv
749f228d42 Simplify the computation:
m->m_pkthdr.len -  sizeof(struct tcphdr) - optlen - hlen
	= m->m_pkthdr.len - (sizeof(struct tcphdr) + optlen + hlen)
	= m->m_pkthdr.len - [tcp_len]
	= toff
2018-03-29 16:54:59 +00:00
macallan
fc8c11bf5c fix build for 32bit non-bridge SMP kernels 2018-03-29 16:19:46 +00:00
ragge
054c324758 Use same major for rx floppies for both b and c devices.
Works around a bug in the mscp disk driver, and solves PR port-vax/26138.
2018-03-29 15:45:15 +00:00
joerg
2d65afd272 Move the complex logic for dynamically writing branches from ld.elf_so
into a header for reuse in crt0.o for static ifunc support. Change the
existing logic for sparc64 to use the Bicc variant of ba,a as it allows
+-8MB displacement compared to the BPcc variant's +-1MB. Teach the sparc
variant the same trick for using ba,a and not sethi+jmp when possible.
2018-03-29 13:23:39 +00:00
maxv
4ff27f257a Misc changes; no real functional change. 2018-03-29 08:11:41 +00:00
maxv
6ad323e9d0 Remove #ifdef INET. Same as tcp_input.c. Makes the code easier to
understand.

Also make tcp6_mtudisc() static in tcp_subr.c.
2018-03-29 07:46:43 +00:00
maxv
02c2018939 Use EOPNOTSUPP instead of EINVAL. 2018-03-29 07:24:26 +00:00
maxv
0da997cbd7 Allow IBRS to be disabled dynamically. 2018-03-29 07:21:24 +00:00
maxv
8eea26c04b Fix sysctl type, should be bool. 2018-03-29 07:15:12 +00:00
macallan
b285859f53 deal with PowerMac7,* mac-io/i2s/sound reg properties
now we map the right registers on G5 and get DMA interrupts. Still no sound
but - well - progress
2018-03-29 06:56:54 +00:00
macallan
037a72025f don't map more PCI space than needed, avoid overlap with snapper so this has
a chance of working on G5
2018-03-29 06:28:12 +00:00
maxv
22cad5de7b The call to svs_lwp_switch can clobber %rdi/%rsi, so restore them before
calling speculation_barrier.
2018-03-28 19:56:40 +00:00
maxv
25792f64b1 oldlwp can be NULL, so ensure it isn't. 2018-03-28 19:50:57 +00:00
maxv
aa88658bce Add 'break', otherwise we're not gonna go very far. While here use a less
error-prone syntax.
2018-03-28 19:47:54 +00:00
maya
94f4c3acd8 Leave TS and RE alone for the benefit of emips, which failed
to boot even earlier after locore.S:1.211.

Do this unconditionally to avoid introducing more ifdefs.
Also tested on ci20 and erlite.
2018-03-28 17:56:52 +00:00
maxv
0223f0c872 Add the IBRS mitigation for SpectreV2 on amd64.
Different operations are performed during context transitions:

	user->kernel: IBRS <- 1
	kernel->user: IBRS <- 0

And during context switches:

	user->user:   IBPB <- 0
	kernel->user: IBPB <- 0
	[user->kernel:IBPB <- 0 this one may not be needed]

We use two macros, IBRS_ENTER and IBRS_LEAVE, to set the IBRS bit. The
thing is hotpatched for better performance, like SVS.

The idea is that IBRS is a "privileged" bit, which is set to 1 in kernel
mode and 0 in user mode. To protect the branch predictor between user
processes (which are of the same privilege), we use the IBPB barrier.

The Intel manual also talks about (MWAIT/HLT)+HyperThreading, and says
that when using either of the two instructions IBRS must be disabled for
better performance on the core. I'm not totally sure about this part, so
I'm not adding it now.

IBRS is available only when the Intel microcode update is applied. The
mitigation must be enabled manually with machdep.spectreV2.mitigated.

Tested by msaitoh a week ago (but I adapted a few things since). Probably
more changes to come.
2018-03-28 16:02:49 +00:00
macallan
b1146198e9 be less spammy on i2c errors 2018-03-28 15:34:29 +00:00
macallan
805ab46b90 set WSSCREEN_RESIZE 2018-03-28 15:33:44 +00:00
maxv
a8a39a2c27 Move the SpectreV2 mitigation code into a dedicated spectre.c file. The
content of the file is taken from the end of cpu.c, and is copied as-is.
2018-03-28 14:56:59 +00:00
maxv
4cd157e529 Several changes in syn_cache_respond:
* Replace idiotic diagnostic check by KASSERT. max_linkhdr+tlen<=MCLBYTES
   is a widespread assumption.

 * Improve initialization of 'tp'.

 * Put panics in dead branches.

 * Merge two switches.
2018-03-28 14:43:55 +00:00
maxv
9af44f3aed Remove unused variable. 2018-03-28 14:30:42 +00:00
maxv
e6c01db74a Remove two unused args from syn_cache_get(). 2018-03-28 14:22:16 +00:00
maxv
0ab063bc85 Dedup: introduce tcp_urp_drop() and use it. 2018-03-28 14:16:59 +00:00