tests: test various buffer sizes in misc-bdev-write test

Xen block driver now supports new featute called indirect descriptors.
This feature allows to put more data into each ring cell but it activates
for "long" reads and writes only - longer than 11 pages.

With this patch test by default runs 2 scenarious:
  * 1 page buffers
  * 32 pages buffers

Also introduced command line parameter to specify
size of buffers explicitly.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
tests: introduce write/read/verify test

Test misc-bdev-rw introduced.

The test writes buffers of various lengths to block device,
reads data back and verifies data read is the same as data written.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
blkfront: introduce functions for device features detection

This is a refactoring commit that isolated some xenstore access
logic to make it reusable

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
blkfront: isolate command data grant references aquisition

This is a refactoring commit to simplify future indirect descriptors code.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
blkfront: isolate commands allocation

This is a refactoring commit to simplify future indirect descriptors code.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
blkfront: introduce indirect descriptors support

Indirect descriptors for Xen PV disks is a newly
introduced protocol feature that increases
block devices performance in case of long transfers.

Detailed description:
http://blog.xen.org/index.php/2013/08/07/indirect-descriptors-for-xen-pv-disks/

Measurement results (RAM-backed storage):

Xen w/o indirect descriptors:

1046.251 Mb/s
1097.931 Mb/s
1149.672 Mb/s
1137.696 Mb/s
1135.481 Mb/s
1249.163 Mb/s
1115.417 Mb/s
1118.063 Mb/s
Wrote 11344.750 MB in 10.00 s = 1134.165 Mb/s

Xen w/ indirect descriptors:

bdev-write test offset limit: 250000000 byte(s)
1234.715 Mb/s
1360.013 Mb/s
1323.663 Mb/s
1336.916 Mb/s
1342.617 Mb/s
1332.882 Mb/s
1302.094 Mb/s
Wrote 13233.250 MB in 10.04 s = 1318.639 Mb/s

KVM:

bdev-write test offset limit: 250000000 byte(s)
674.729 Mb/s
698.736 Mb/s
627.677 Mb/s
630.209 Mb/s
742.977 Mb/s
759.205 Mb/s
681.476 Mb/s
655.717 Mb/s
713.231 Mb/s
688.478 Mb/s
Wrote 6872.750 MB in 10.00 s = 687.124 Mb/s

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
support vga cursor

Add cursor update callback to libtsm, update cursor position register on VGA device using the callback.
Fixes #220.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: Add script for building a Capstan image

This adds a script for creating Capstan compatible images that can be
uploaded to a S3 bucket for distribution.

To use it to build a base image, for example, type:

  $ ./scripts/build-capstan-img cloudius/osv-base empty "OSv base image"

which builds a Capstan image named "cloudius/osv-base" with "make
image=empty" and places QEMU and VirtualBox images under
"build/capstan/cloudius/osv-base" together with an index file.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: Add script for building OSv release

This adds a script for building a Capstan repository for an OSv release
with the following images:

  - OSv core (no API, no CLI)
  - Default (with API, CLI)
  - Cassandra virtual appliance (with API)
  - Tomcat virtual appliance (with API)
  - Iperf virtual appliance (with API)

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
scripts: Add script for uploading OSv release

This adds a script for uploading OSv release to Capstan S3 bucket using
"s3cmd sync".

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Update osv-apps submodule

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: consolidate code in map_file_page_mmap alloc/free
mmu: split mmu-defs.hh header

arch-mmu.hh depend on mmu.hh currently which make it impossible to
include in header that mmu.hh itself includes. mmu.hh is pretty heavy
header containing many definitions and code, so move bare definitions
into separate header file.
mmu: track mapping between ARC pages and ptep instead of virtual address

Currently we track mapping between ARC pages and virtual addresses which
require us to walk the page table to get to a pte pointer when invalidation
is required. Change that to track pointers to pte directly.
mmu: constify hw_ptep methods that do not change pte it points to

This allows those function to be called on const object.
mmu: map file private mappings with small pages too.

Private mapping are also done from ARC cache and have same problem as
shared mappings.
mmu: save flags passed during file mapping in a vma.

Currently flags are saved for anon_vma, but not for file_vma. Examining
those flags in gdb proved to be helpful. Remove _shared since it no
longer needed, the information is in the flags.
mmu: pass type of a page fault (r/w) to a page allocator

Page allocation may behave differently depending on a type of a fault.
Read fault may return ARC page, but write may do cow for instance.
mmu: return COW status from page allocators

Page allocator may return shared page that needs to be COWed during
write access. There is not way to notify page mapper that such page
should be mapped read only currently. This patch allows page allocator
to control that.
mmu: rename _map_offset into _foffset in map_file_page_mmap

It holds offset into file, not mapping. Also to be consistent with
map_file_page_read.