net: Use Jubmo packets zone for m_defrag() allocations

This patch fixes part of TCP instability/low throughput problems on Xen.

On transmit networking stack passes to Xen netfront driver a list of mbufs
of up to PAGE_SIZE (4096) bytes each.
In case the list consists of more than MAX_TX_REQ_FRAGS (18) fragments
driver tries to defragment it with m_defrag().

m_defrag() in turn tries to build list of buffers of up to MCLBYTES
(2048) bytes each. This leads to even longer chain and packet being dropped.
As a result around 1% of TCP segments are lost and intensive TCP
retransmissions and slowdowns occur.

This patch makes m_defrag() use Jumbo packets zone for allocation, i.e.
PAGE_SIZE per mbuf.

This patch is pretty similar to what Glauber done on RX path before.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
net: maximum IP datagram size decreased by ETH header length

FreeBSD networking code limits IP datagram size by IP_MAXPACKET
which is exactly 64K. This calculation doesn't take into account
Ethernet header length and may generate Ethernet packet longer than 64K.

Such a packet cannot be processed properly by some devices (Xen netback)
and being dropped.

This patch fixes this corner case for all supported IP protocols.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Automate releasing to Artifactory

This adds a script for releasing OSv QCOW2 images to Artifactory.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Fix make mode=debug build

When building with -O0 we get:

 bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.o: In
 function `zfs_ioc_destroy_snaps_nvl':
 (...)/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:3265:
 undefined reference to `zvol_remove_minor'

Looks like the problem is that the missing symbol,
`zvol_remove_minor', referenced from zfs_ioctl.o is not in the zvol.o
because it's not defined, because it is inside '#ifdef NOTYET' block
(which is off). It works in the normal build because when compiled
with -O2 (and even with -O1), the reference to zvol_remove_minor in
zfs_ioctl.c is optimized away.

This patch puts the block using zvol_remove_minor also inside '#ifdef
NOTYET' to be consistent.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Fix linker error in make mode=debug

This is a workaround for linker error when compiling with -O0

  `.text._Z9safe_loadIcEbPKT_RS0_' referenced in section `.text.fixup'
  of core/mmu.o: defined in discarded section
  `.text._Z9safe_loadIcEbPKT_RS0_[_Z9safe_loadIcEbPKT_RS0_]' of
  core/mmu.o

The safe_load() template is used in both runtime.cc and core/mmu.cc
but the linker keeps it only in one section discarding the other.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
x64: Fix missing newline in dump_registers()

The debug() format string is missing a newline. Fix that up.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
debug: Add format specifiers to debug_ll()

Needed to make dump_registers() safe to call from fault handler.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Make dump_register() fault-handler safe

The debug() call can deadlock because it's using boost format. Switch to
debug_ll().

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Fix broken example in README

After commit 9bb558386dc295e23f2043d7f2c36571db0ca982, the name our jars
now contains the version number 1.0.0 instead of 1.0. The default command
line was changed accordingly (in build.mk), but we forgot to likewise
update the example in the README. This trivial patch fixes the example.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
loader: version numbering

This patch adds version numbering to the loader. We use "git tag" for
generating an unique version number with a little bit of shell script
magic to make sure version number is always up-to-date.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: VMA permission flags

Add permission flags to VMAs. They will be used by mprotect() and the
page fault handler.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Fix stack alignment in fault handlers

Make sure stack pointer is 16-byte aligned in fault handler as required
by x86-64 ABI. This is needed for the page fault handler to be able to
use stack for FPU state save/restore.

Spotted by Nadav.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: Anonymous memory demand paging

Switch to demand paging for anonymous virtual memory.

  SPECjvm 2008 (higher is better):

                          ops/m
  benchmark               master  paging  +/- %

  compiler.compiler       347.06  356.94   +2.8
  compiler.sunflow        132.17  134.12   +1.5
  compress                107.59  123.26  +14.6
  crypto.aes               41.92   42.14   +0.5
  crypto.rsa              217.27  218.34   +0.5
  crypto.signverify       201.62  184.31   -8.6
  derby                   184.81  185.52   +0.4
  mpegaudio                78.86   80.40   +2.0
  scimark.fft.large        35.91   35.78   -0.4
  scimark.lu.large         14.36   16.74  +16.6
  scimark.sor.large        26.16   25.98   -0.7
  scimark.sparse.large     37.64   38.61   +2.6
  scimark.fft.small       176.99  207.07  +17.0
  scimark.lu.small        222.76  244.56   +9.8
  scimark.sor.small       115.81  116.77   +0.8
  scimark.sparse.small    119.97  125.31   +4.5
  scimark.monte_carlo     141.17  139.64   -1.1
  serial                  100.48   97.20   -3.3
  sunflow                  79.54   84.55   +6.3
  xml.transform           217.30  217.59   +0.1
  xml.validation          349.88  348.65   -0.4

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-mmap.so: mincore() tests for demand paging

As suggested by Nadav, add tests for mincore() interraction with demand
paging.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>