Commit Graph

689 Commits

Author SHA1 Message Date
pgoyette
0347dde6b5 Another module that needs WARNS=3 to allow signed-vs-unsigned compares 2019-02-20 00:55:03 +00:00
rin
90b9898718 For vax, GCC 6.5 and 7.4 cannot compile lfs_inode.c with
-DDIAGNOSTIC and -O2/-O1.
2019-02-17 14:04:31 +00:00
rin
919fe1ff1f Set WARNS=3 to appease sign-compare warnings for mips, mips64, and sparc. 2019-02-17 13:21:55 +00:00
rin
2bc4fb1fcb Bump default value of WARNS for modules from 3 to 5, and
explicitly set WARNS for modules that fail with WARNS=5.

Also, turn on -Wno-missing-noreturn for clang for some files.

At the moment, among ~ 360 modules,
- 2 (lua and zfs) need WARNS=0
- 1 (solaris) needs WARNS=1
- 136 need WARNS=3 (mostly due to sign-compare)
- 4 need WARNS=4
- others can be compiled with WARNS=5

Discussed on tech-kern.
2019-02-17 04:05:41 +00:00
rin
4708abfff3 Turn on DIAGNOSTIC by default for modules in HEAD.
Make us sure that it should be commented out for release branches in
a similar manner to kernel configuration files.

Discussed on tech-kern.
2019-02-17 03:57:31 +00:00
maxv
8567964145 Add Intel-VMX support in NVMM. This allows us to run hardware-accelerated
VMs on Intel CPUs. Overall this implementation is fast and reliable, I am
able to run NetBSD VMs with many VCPUs on a quad-core Intel i5.

NVMM-Intel applies several optimizations already present in NVMM-AMD, and
has a code structure similar to it. No change was needed in the NVMM MI
frontend, or in libnvmm.

Some differences exist against AMD:

 - On Intel the ASID space is big, so we don't fall back to a shared ASID
   when there are more VCPUs executing than available ASIDs in the host,
   contrary to AMD. There are enough ASIDs for the maximum number of VCPUs
   supported by NVMM.

 - On Intel there are two TLBs we need to take care of, one for the host
   (EPT) and one for the guest (VPID). Changes in EPT paging flush the
   host TLB, changes to the guest mode flush the guest TLB.

 - On Intel there is no easy way to set/fetch the VTPR, so we intercept
   reads/writes to CR8 and maintain a software TPR, that we give to the
   virtualizer as if it was the effective TPR in the guest.

 - On Intel, because of SVS, the host CR4 and LSTAR are not static, so
   we're forced to save them on each VMENTRY.

 - There is extra Intel weirdness we need to take care of, for example the
   reserved bits in CR0 and CR4 when accesses trap.

While this implementation is functional and can already run many OSes, we
likely have a problem on 32bit-PAE guests, because they require special
care on Intel CPUs, and currently we don't handle that correctly; such
guests may misbehave for now (without altering the host stability). I
expect to fix that soon.
2019-02-13 16:03:16 +00:00
rin
3b61790727 Add ure(4): RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device.
Ported from OpenBSD. Support for RX/TX checksum offload added by myself.
2019-02-06 11:55:05 +00:00
hannken
930703cbc3 Prepare the implementation of the ZFS control directory ".zfs".
- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
  remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
  nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
2019-02-05 09:54:36 +00:00
mrg
978a4e65e0 be sure to only apply zlib.c's -Wno-error=implicit-fallthrough to GCC 7.
push the setting into the rump and module version too.
2019-02-05 09:29:19 +00:00
mrg
c29615453d don't assume _LP64 == supports COMPAT_NETBSD32.
this is not true for alpha, ia64 and arm32 ports, and the first two
were not building because of it, and the latter would be missing
the oabi support (likely not a big deal, but still wrong.)

add a makefile fragment that tells you if it is supported and include
it where needed to define COMPAT_NETBSD32 when building the normal
kernel (ie, modules & rump.)


fixes alpha build, probably fixes ia64 build.


XXX: still leaves some netbsd32 code in rf_netbsdkintf.c, that should
     be moved into some hooks, but first the configuration setup
     needs to be moved into a common function the netbsd32 code can
     call into, vs living in the switch case itself.
2019-02-04 21:57:47 +00:00
pgoyette
64733abe1a Don't include puffs_compat in a kernel unless the filesystem is
selected along with COMPAT_50.  Also, don't include puffs_compat
in the main puffs filesystem module;  it is part of the compat_50
module.

Should address PR kern/53943
2019-02-04 12:08:03 +00:00
mrg
50bd97fc67 apply -Wno-error=implicit-fallthrough to via_dmablit.c. 2019-02-04 09:58:23 +00:00
mrg
dc91d75898 apply -Wno-error=implicit-fallthrough to ar5212_xmit.c and ar5416_xmit.c. 2019-02-04 08:36:43 +00:00
mrg
9f98590938 add -Wno-error=int-in-bool-context or -Wno-error=implicit-fallthrough
for various drm files that would be best ignored or upstream fixed.
(could fix savagedrm, no one upstream is that any more.)
2019-02-04 08:18:07 +00:00
mrg
1fcf7be45f - use -Wno-error=implicit-fallthrough with GCC7. 2019-02-04 04:05:15 +00:00
pgoyette
37e3aa6845 Remove some commented-out stuff accidentally left in the previous commit.
It's just comments, NFCI
2019-02-03 09:32:07 +00:00
pgoyette
0ca6ae7ca0 Don't include the raidframe compat code in the main raid module, the
compat code lives in their own compat_raid_xx modules, which will now
be autoloaded if needed.

While here, extract the compat_netbsd32_raid code into its own module,
too.

Welcome to 8.99.34
2019-02-03 08:02:24 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
alnsn
1ca7425140 Build bpfjit and sljit modules on aarch64. 2019-01-21 00:21:48 +00:00
kamil
1514387ab8 Add a new example kernel module: mapper
Basic implementation of mmap.

Submitted by Akul Pillai.
2019-01-17 20:47:42 +00:00
maxv
08fa964521 Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
2018-12-29 11:30:11 +00:00
maxv
43c9320743 Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
2018-12-19 13:57:44 +00:00
pgoyette
2754bc1371 Remove the rest of my local change that somehow snuck in to an
earlier commit.
2018-11-27 06:31:15 +00:00
msaitoh
1174b5ff5c Remove obsolete ksem entry to prevent build break. 2018-11-27 05:39:00 +00:00
pgoyette
a3cab4923b Include the compat_netbsd32* modules for sparc64
Their absence was noticed by martin@ when the recent libnv-related
build failure on amd64 did not affect sparc64!
2018-11-27 00:32:13 +00:00
mlelstv
61499a753e One more - we also need the libnv for compat_linux32 module 2018-11-26 15:02:11 +00:00
mlelstv
65b25e11fb compat modules now require an extra include path for libnv. 2018-11-26 08:48:43 +00:00
riastradh
d810a3da5f Include <bsd.own.mk> before using ACTIVE_CC. Fixes make errors. 2018-11-15 04:57:00 +00:00
maxv
f3a4baf748 Add NVMM - for NetBSD Virtual Machine Monitor -, a kernel driver that
provides support for hardware-accelerated virtualization on NetBSD.

It is made of an MI frontend, to which MD backends can be plugged. One
MD backend is implemented, x86-SVM, for x86 AMD CPUs.

We install

	/usr/include/dev/nvmm/nvmm.h
	/usr/include/dev/nvmm/nvmm_ioctl.h
	/usr/include/dev/nvmm/{arch}/nvmm_{arch}.h

And the kernel module. For now, the only architecture where we do that
is amd64 (arch=x86).

NVMM is not enabled by default in amd64-GENERIC, but is instead easily
modloadable.

Sent to tech-kern@ a month ago. Validated with kASan, and optimized
with tprof.
2018-11-07 07:43:07 +00:00
rmind
39013e66c1 NPF: Major rework -- migrate NPF to the libnv library.
- This conversion significantly simplifies the code and moves NPF to
  a binary serialisation format (replacing the XML-like format).
- Fix some memory/reference leaks and possibly use-after-free bugs.
- Bump NPF_VERSION as this change makes libnpf incompatible with the
  previous versions.  Also, different serialisation format means NPF
  connection/config saving and loading is not compatible with the
  previous versions either.

Thanks to christos@ for extra testing.
2018-09-29 14:41:35 +00:00
maxv
dfbe69edb9 Don't build the module sets for non-pae-32bit-pv. Noted by John D. Baker
on port-i386@, thanks.
2018-09-19 16:11:53 +00:00
riastradh
db5f393e0c Remove some superfluous vestigial `-I.'. 2018-08-28 03:48:38 +00:00
riastradh
d46aeca2b9 Rework PCI and AGP conditionalization.
- Push drm_pci_set_unique into driver callback.
- Eliminate drm_pci_set_unique_hook.
- Gather all drm_agp_* functions into struct drm_agp_hooks.
- Replace the nonsensical old atomic garbage by serious locking.
- Make drm_agpsupport.c its own module.
- Eliminate NDRMKMS_PCI.
- Use NAGP from "agp.h" only in drm_module.c for horrible hack.
  => See comment in file for rationale.
- Always define CONFIG_PCI=1 and CONFIG_AGP=1.
- Always go through the drm_agp_* function hooks.
- Ifdef out nouveau agp stuff that doesn't go through drm_agp_*
  for reasons that I'm too frustrated to figure out tonight.
- pci_iomap no longer automagically does agp_i810_borrow.
  => Use drm_agp_borrow instead.
2018-08-28 03:41:38 +00:00
riastradh
bee2274f01 Move the Linux PCI shim into its very own .c file.
The poor thing has deserved this for a very long time, even though it
is full of kludges.  Also I'm tired of recompiling everything every
time I touch it.
2018-08-27 14:16:38 +00:00
riastradh
2d27d4557c Make drmkms_pci.kmod build again. 2018-08-27 13:55:35 +00:00
riastradh
dce5760f64 Make i915drmkms.kmod build again. 2018-08-27 13:54:25 +00:00
riastradh
bc6c52c286 Make drmkms.kmod build again on amd64. 2018-08-27 13:53:42 +00:00
riastradh
923b04cbdb Add some components to drmkms_linux.kmod. 2018-08-27 13:52:58 +00:00
riastradh
1103e3aa20 Sort. 2018-08-27 13:45:20 +00:00
rin
559388397c Add mue(4), driver for Microchip LAN75xx/LAN78xx known as internal NIC of
Raspberry Pi 3 B+, from OpenBSD.

Tested on Raspberry Pi 3 B+ (LAN7800) and Z-TEK ZE582 (LAN7500).

* BUGS/TODO

- If the media type is set to something other than 1000baseT-FDX, data
  transmission becomes quite unstable. Also, ukphy(4) recognize 1000baseT as
  a supported media type, but it is not in fact.

- Catch up with changes made to usmsc(4) in nick-nhusb branch, i.e.,
  make the driver MP-safe.

- Support RX/VLAN/TX chekcsum offloading.
2018-08-25 20:12:21 +00:00
maxv
2ec2a169a3 Retire NDIS. It appears that it has never worked, after 13 years it was
still marked as "experimental", and nowadays it may be one more obstacle
to MPification of the network stack.

Discussed on tech-net@.
2018-08-25 07:48:56 +00:00
christos
e958e9fde5 remove NOGCCERROR; hides real issues. 2018-08-18 11:57:57 +00:00
maxv
ba9c330587 Merge the tprof_pmi and tprof_amdpmi modules into a single tprof_x86
module.
2018-07-24 09:47:35 +00:00
maxv
5030f131d5 Move
arch/x86/x86/tprof_pmi.c
	arch/x86/x86/tprof_amdpmi.c
into
	dev/tprof/tprof_x86_intel.c
	dev/tprof/tprof_x86_amd.c
2018-07-16 06:18:31 +00:00
maya
952ab4fc36 Remove viadrm(4), superseded by viadrmums.
Aside from viadrm using older drm code, it's also dysfunctional right now.
See PR port-i386/53364.
2018-07-10 17:01:42 +00:00
kamil
cd35dc3d84 Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build
Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
2018-06-29 11:33:46 +00:00
kamil
d2d2a14700 Replace HAVE_GCC with ACTIVE_CC == gcc checks
Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
2018-06-07 13:21:44 +00:00
kamil
bba5ce3052 Really disable unsupported $CC flag for LLVM
The build of kernel modules works now:

  ./build.sh -V MKLLVM=yes -V MKGCC=no -V HAVE_LLVM=yes modules

Sponsored by <The NetBSD Foundation>
2018-06-06 17:54:33 +00:00
jakllsch
8e3d4ca686 add virtio_pci to list of not-yet-enabled modules 2018-06-06 16:46:02 +00:00
jakllsch
09582ef971 fix up virtio module for current structure; add virtio_pci module 2018-06-06 16:11:36 +00:00