drivers/acpi: Document why AcpiOsUnmapMemory() is a no-op

Add the explanation by Avi Kivity to AcpiOsUnmapMemory() to explain why
it's a no-op.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Configure the bridge for spanning tree off

Spanning tree causes the bridge port to start in listening mode.
That causes dhcp packet to be ignored. Since we're not fearing of
layer2 loops, we can safely remove the spanning tree config.

Signed-off-by: Dor Laor <dor@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader.py: fix thread_context for stacks in high end

This fixes 'osv info threads' command.

when $rsp holds 0xffffc0003fdf6fc8, ulong() for gdb.Value representing
it returns 18446673706036981704. This is out of int range. This
causes that thread_context.__exit__() throws "Numeric constant too
large" exception from

  set $rbp = 18446673706036981704

The fix removes the additional conversion as it seems to be
unnecessary. The gdb.Value should format itself properly.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
nbd: Add small python nbd client for future usage in scripts/imgedit.py.

Signed-off-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
build: Build images as QCOW2 files.

Make use of the python nbd client.

Signed-off-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
elf: fix program::_module_index_list use-before-init

We create a memory_image and assign it to _core before *this is fully
initialized, triggering corruption in program::_module_index_list.

This fixes memory corruption issues seen with the upcoming demand paging
patches.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
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: 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>
mmu: Anonymous memory demand paging

Switch to demand paging for anonymous virtual memory.

  SPECjvm 2008 (higher is better)

  Baseline:

  Score on compiler.compiler: 347.06 ops/m
  Score on compiler.sunflow: 132.17 ops/m
  Score on compress: 107.59 ops/m
  Score on crypto.aes: 41.92 ops/m
  Score on crypto.rsa: 217.27 ops/m
  Score on crypto.signverify: 201.62 ops/m
  Score on derby: 184.81 ops/m
  Score on mpegaudio: 78.86 ops/m
  Score on scimark.fft.large: 35.91 ops/m
  Score on scimark.lu.large: 14.36 ops/m
  Score on scimark.sor.large: 26.16 ops/m
  Score on scimark.sparse.large: 37.64 ops/m
  Score on scimark.fft.small: 176.99 ops/m
  Score on scimark.lu.small: 222.76 ops/m
  Score on scimark.sor.small: 115.81 ops/m
  Score on scimark.sparse.small: 119.97 ops/m
  Score on scimark.monte_carlo: 141.17 ops/m
  Score on serial: 100.48 ops/m
  Score on sunflow: 79.54 ops/m
  Score on xml.transform: 217.30 ops/m
  Score on xml.validation: 349.88 ops/m

  Demand paging:

  Score on compiler.compiler: 338.57 ops/m
  Score on compiler.sunflow: 119.20 ops/m
  Score on compress: 120.18 ops/m
  Score on crypto.aes: 43.16 ops/m
  Score on crypto.rsa: 211.69 ops/m
  Score on crypto.signverify: 203.66 ops/m
  Score on derby: 181.10 ops/m
  Score on mpegaudio: 80.90 ops/m
  Score on scimark.fft.large: 34.15 ops/m
  Score on scimark.lu.large: 11.19 ops/m
  Score on scimark.sor.large: 22.99 ops/m
  Score on scimark.sparse.large: 36.62 ops/m
  Score on scimark.fft.small: 203.09 ops/m
  Score on scimark.lu.small: 236.72 ops/m
  Score on scimark.sor.small: 116.75 ops/m
  Score on scimark.sparse.small: 126.98 ops/m
  Score on scimark.monte_carlo: 152.86 ops/m
  Score on serial: 98.28 ops/m
  Score on sunflow: 78.93 ops/m
  Score on xml.transform: 216.34 ops/m
  Score on xml.validation: 381.52 ops/m

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>