]> Git Repo - qemu.git/log
qemu.git
9 years agotarget-tricore: add CMPSWP instructions of the v1.6.1 ISA
Bastian Koppelmann [Wed, 6 May 2015 18:47:39 +0000 (20:47 +0200)]
target-tricore: add CMPSWP instructions of the v1.6.1 ISA

Those instruction were introduced in the new Aurix platform.

Signed-off-by: Bastian Koppelmann <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
9 years agotarget-tricore: Add SRC_MOV_E instruction of the v1.6 ISA
Bastian Koppelmann [Wed, 6 May 2015 18:22:45 +0000 (20:22 +0200)]
target-tricore: Add SRC_MOV_E instruction of the v1.6 ISA

Signed-off-by: Bastian Koppelmann <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
9 years agotarget-tricore: introduce ISA v1.6.1 feature
Bastian Koppelmann [Wed, 6 May 2015 18:18:41 +0000 (20:18 +0200)]
target-tricore: introduce ISA v1.6.1 feature

The aurix platform contains of several different cpu models and uses
the 1.6.1 ISA. This patch changes the generic aurix model to the more
specific tc27x cpu model and sets specific features.

Signed-off-by: Bastian Koppelmann <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
9 years agotarget-tricore: Add ISA v1.3.1 cpu and fix tc1796 to using v1.3
Bastian Koppelmann [Sun, 22 Mar 2015 12:49:12 +0000 (12:49 +0000)]
target-tricore: Add ISA v1.3.1 cpu and fix tc1796 to using v1.3

Signed-off-by: Bastian Koppelmann <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Fri, 22 May 2015 12:25:40 +0000 (13:25 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Fri May 22 10:00:53 2015 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"

* remotes/stefanha/tags/block-pull-request: (38 commits)
  block: get_block_status: use "else" when testing the opposite condition
  qemu-iotests: Test unaligned sub-block zero write
  block: Fix NULL deference for unaligned write if qiov is NULL
  Revert "block: Fix unaligned zero write"
  block: align bounce buffers to page
  block: minimal bounce buffer alignment
  block: return EPERM on writes or discards to read-only devices
  configure: Add workaround for ccache and clang
  configure: silence glib unknown attribute __alloc_size__
  configure: factor out supported flag check
  configure: handle clang -nopie argument warning
  block/parallels: improve image writing performance further
  block/parallels: optimize linear image expansion
  block/parallels: add prealloc-mode and prealloc-size open paramemets
  block/parallels: delay writing to BAT till bdrv_co_flush_to_os
  block/parallels: create bat_entry_off helper
  block/parallels: improve image reading performance
  iotests, parallels: check for incorrectly closed image in tests
  block/parallels: implement incorrect close detection
  block/parallels: implement parallels_check method of block driver
  ...

Signed-off-by: Peter Maydell <[email protected]>
9 years agoRevert "target-alpha: Add vector implementation for CMPBGE"
Peter Maydell [Fri, 22 May 2015 11:30:13 +0000 (12:30 +0100)]
Revert "target-alpha: Add vector implementation for CMPBGE"

This reverts commit 32ad48abd74a997220b841e4e913edeb267aa362.

Unfortunately the SSE2 code here fails to compile on some versions
of gcc:
 target-alpha/int_helper.c:77:24: error: invalid operands to binary >=
 (have '__vector(16) unsigned char' and '__vector(16) unsigned char')

Signed-off-by: Peter Maydell <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-axp-20150521' into staging
Peter Maydell [Fri, 22 May 2015 09:06:33 +0000 (10:06 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20150521' into staging

Rewrite fp exceptions

# gpg: Signature made Thu May 21 18:35:52 2015 BST using RSA key ID 4DD0279B
# gpg: Good signature from "Richard Henderson <[email protected]>"
# gpg:                 aka "Richard Henderson <[email protected]>"
# gpg:                 aka "Richard Henderson <[email protected]>"

* remotes/rth/tags/pull-axp-20150521:
  target-alpha: Add vector implementation for CMPBGE
  target-alpha: Rewrite helper_zapnot
  target-alpha: Raise IOV from CVTQL
  target-alpha: Suppress underflow from CVTTQ if DNZ
  target-alpha: Raise EXC_M_INV properly for fp inputs
  target-alpha: Disallow literal operand to 1C.30 to 1C.37
  target-alpha: Implement WH64EN
  target-alpha: Fix integer overflow checking insns
  target-alpha: Fix cvttq vs inf
  target-alpha: Fix cvttq vs large integers
  target-alpha: Raise IOV from CVTTQ
  target-alpha: Set EXC_M_SWC for exceptions from /S insns
  target-alpha: Set fpcr_exc_status even for disabled exceptions
  target-alpha: Tidy FPCR representation
  target-alpha: Set PC correctly for floating-point exceptions
  target-alpha: Forget installed round mode after MT_FPCR
  target-alpha: Rename floating-point subroutines
  target-alpha: Move VAX helpers to a new file

Signed-off-by: Peter Maydell <[email protected]>
9 years agoblock: get_block_status: use "else" when testing the opposite condition
Paolo Bonzini [Thu, 14 May 2015 10:35:02 +0000 (12:35 +0200)]
block: get_block_status: use "else" when testing the opposite condition

A bit of Boolean algebra (and common sense) tells us that the
second "if" here is looking for blocks that are not allocated.
This is the opposite of the "if" that sets BDRV_BLOCK_ALLOCATED,
and thus it can use an "else".

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-id: 1431599702[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoqemu-iotests: Test unaligned sub-block zero write
Fam Zheng [Wed, 13 May 2015 13:12:01 +0000 (13:12 +0000)]
qemu-iotests: Test unaligned sub-block zero write

Test zero write in byte range 512~1024 for 4k alignment.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-id: 1431522721[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock: Fix NULL deference for unaligned write if qiov is NULL
Fam Zheng [Wed, 13 May 2015 13:12:00 +0000 (13:12 +0000)]
block: Fix NULL deference for unaligned write if qiov is NULL

For zero write, callers pass in NULL qiov (qemu-io "write -z" or
scsi-disk "write same").

Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case
for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler
fix would be in bdrv_co_do_pwritev which is the NULL dereference point
and covers both cases.

So don't access it in bdrv_co_do_pwritev in this case, use three aligned
writes.

[Initialize ret to 0 in bdrv_co_do_zero_pwritev() to avoid uninitialized
variable warning with gcc 4.9.2.
--Stefan]

Signed-off-by: Fam Zheng <[email protected]>
Message-id: 1431522721[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoRevert "block: Fix unaligned zero write"
Fam Zheng [Wed, 13 May 2015 13:11:59 +0000 (13:11 +0000)]
Revert "block: Fix unaligned zero write"

This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05.

The core write code already handles the case, so remove this
duplication.

Because commit 61007b316 moved the touched code from block.c to
block/io.c, the change is manually reverted.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-id: 1431522721[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock: align bounce buffers to page
Denis V. Lunev [Tue, 12 May 2015 14:30:56 +0000 (17:30 +0300)]
block: align bounce buffers to page

The following sequence
    int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644);
    for (i = 0; i < 100000; i++)
            write(fd, buf, 4096);
performs 5% better if buf is aligned to 4096 bytes.

The difference is quite reliable.

On the other hand we do not want at the moment to enforce bounce
buffering if guest request is aligned to 512 bytes.

The patch changes default bounce buffer optimal alignment to
MAX(page size, 4k). 4k is chosen as maximal known sector size on real
HDD.

The justification of the performance improve is quite interesting.
From the kernel point of view each request to the disk was split
by two. This could be seen by blktrace like this:
  9,0   11  1     0.000000000 11151  Q  WS 312737792 + 1023 [qemu-img]
  9,0   11  2     0.000007938 11151  Q  WS 312738815 + 8 [qemu-img]
  9,0   11  3     0.000030735 11151  Q  WS 312738823 + 1016 [qemu-img]
  9,0   11  4     0.000032482 11151  Q  WS 312739839 + 8 [qemu-img]
  9,0   11  5     0.000041379 11151  Q  WS 312739847 + 1016 [qemu-img]
  9,0   11  6     0.000042818 11151  Q  WS 312740863 + 8 [qemu-img]
  9,0   11  7     0.000051236 11151  Q  WS 312740871 + 1017 [qemu-img]
  9,0    5  1     0.169071519 11151  Q  WS 312741888 + 1023 [qemu-img]
After the patch the pattern becomes normal:
  9,0    6  1     0.000000000 12422  Q  WS 314834944 + 1024 [qemu-img]
  9,0    6  2     0.000038527 12422  Q  WS 314835968 + 1024 [qemu-img]
  9,0    6  3     0.000072849 12422  Q  WS 314836992 + 1024 [qemu-img]
  9,0    6  4     0.000106276 12422  Q  WS 314838016 + 1024 [qemu-img]
and the amount of requests sent to disk (could be calculated counting
number of lines in the output of blktrace) is reduced about 2 times.

Both qemu-img and qemu-io are affected while qemu-kvm is not. The guest
does his job well and real requests comes properly aligned (to page).

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-id: 1431441056[email protected]
CC: Paolo Bonzini <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock: minimal bounce buffer alignment
Denis V. Lunev [Tue, 12 May 2015 14:30:55 +0000 (17:30 +0300)]
block: minimal bounce buffer alignment

The patch introduces new concept: minimal memory alignment for bounce
buffers. Original so called "optimal" value is actually minimal required
value for aligment. It should be used for validation that the IOVec
is properly aligned and bounce buffer is not required.

Though, from the performance point of view, it would be better if
bounce buffer or IOVec allocated by QEMU will be aligned stricter.

The patch does not change any alignment value yet.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-id: 1431441056[email protected]
CC: Paolo Bonzini <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock: return EPERM on writes or discards to read-only devices
Paolo Bonzini [Thu, 7 May 2015 15:45:48 +0000 (17:45 +0200)]
block: return EPERM on writes or discards to read-only devices

This is the behavior in the operating system, for example Linux's
blkdev_write_iter has the following:

        if (bdev_read_only(I_BDEV(bd_inode)))
                return -EPERM;

This does not apply to opening a device for read/write, when the
device only supports read-only operation.  In this case any of
EACCES, EPERM or EROFS is acceptable depending on why writing is
not possible.

Signed-off-by: Paolo Bonzini <[email protected]>
Message-id: 1431013548[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoconfigure: Add workaround for ccache and clang
John Snow [Wed, 25 Mar 2015 22:57:39 +0000 (18:57 -0400)]
configure: Add workaround for ccache and clang

Test if ccache is interfering with semantic analysis of macros,
disable its habit of trying to compile already pre-processed
versions of code if so. ccache attempts to save time by compiling
pre-processed versions of code, but this disturbs clang's static
analysis enough to produce false positives.

ccache allows us to disable this feature, opting instead to
compile the original version instead of its preprocessed version.
This makes ccache much slower for cache misses, but at least it
becomes usable with QEMU/clang.

This workaround only activates for users using ccache AND clang,
and only if their configuration is observed to be producing warnings.
You may need to clear your ccache for builds started without -Werror,
as those may continue to produce warnings from the cache.

Thanks to Peter Eisentraut for his writeup on the issue:
http://peter.eisentraut.org/blog/2014/12/01/ccache-and-clang-part-3/

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1427324259[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoconfigure: silence glib unknown attribute __alloc_size__
John Snow [Wed, 25 Mar 2015 22:57:38 +0000 (18:57 -0400)]
configure: silence glib unknown attribute __alloc_size__

The glib headers use GCC attributes.  Unfortunately the __GNUC__ and
__GNUC_MINOR__ version macros are also defined by clang, but clang
doesn't support the same attributes as GCC.

clang 3.5.0 does not support the __alloc_size__ attribute:

  https://github.com/llvm-mirror/clang/commit/c047507a9a79e89fc8339e074fa72822a7e7ea73

The following warning is produced:

  gstrfuncs.h:257:44: warning: unknown attribute '__alloc_size__' ignored [-Wunknown-attributes]
        G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(2);
          gmacros.h:67:45: note: expanded from macro 'G_GNUC_ALLOC_SIZE'
                #define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))

This patch checks whether glib headers cause warnings and disables
-Wunknown-attributes if it is able to.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1427324259[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoconfigure: factor out supported flag check
John Snow [Wed, 25 Mar 2015 22:57:37 +0000 (18:57 -0400)]
configure: factor out supported flag check

Factor out the function that checks if a compiler
flag is supported or not.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1427324259[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoconfigure: handle clang -nopie argument warning
Stefan Hajnoczi [Wed, 25 Mar 2015 22:57:36 +0000 (18:57 -0400)]
configure: handle clang -nopie argument warning

gcc 4.9.2 treats -nopie as an error:

  cc: error: unrecognized command line option ‘-nopie’

clang 3.5.0 treats -nopie as a warning:

  clang: warning: argument unused during compilation: '-nopie'

The causes ./configure to fail with clang:

  ERROR: configure test passed without -Werror but failed with -Werror.

Make the -nopie test use -Werror so that compile_prog works for both gcc
and clang.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1427324259[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: improve image writing performance further
Denis V. Lunev [Tue, 28 Apr 2015 07:47:00 +0000 (10:47 +0300)]
block/parallels: improve image writing performance further

Try to perform IO for the biggest continuous block possible.
All blocks abscent in the image are accounted in the same type
and preallocation is made for all of them at once.

The performance for sequential write is increased from 200 Mb/sec to
235 Mb/sec on my SSD HDD.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: optimize linear image expansion
Denis V. Lunev [Tue, 28 Apr 2015 07:46:59 +0000 (10:46 +0300)]
block/parallels: optimize linear image expansion

Plain image expansion spends a lot of time to update image file size.
This seriously affects the performance. The following simple test
  qemu_img create -f parallels -o cluster_size=64k ./1.hds 64G
  qemu_io -n -c "write -P 0x11 0 1024M" ./1.hds
could be improved if the format driver will pre-allocate some space
in the image file with a reasonable chunk.

This patch preallocates 128 Mb using bdrv_write_zeroes, which should
normally use fallocate() call inside. Fallback to older truncate()
could be used as a fallback using image open options thanks to the
previous patch.

The benefit is around 15%.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Karan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: add prealloc-mode and prealloc-size open paramemets
Denis V. Lunev [Tue, 28 Apr 2015 07:46:58 +0000 (10:46 +0300)]
block/parallels: add prealloc-mode and prealloc-size open paramemets

This is preparational commit for tweaks in Parallels image expansion.
The idea is that enlarge via truncate by one data block is slow. It
would be much better to use fallocate via bdrv_write_zeroes and
expand by some significant amount at once.

Original idea with sequential file writing to the end of the file without
fallocate/truncate would be slower than this approach if the image is
expanded with several operations:
- each image expanding means file metadata update, i.e. filesystem
  journal write. Truncate/write to newly truncated space update file
  metadata twice thus truncate removal helps. With fallocate call
  inside bdrv_write_zeroes file metadata is updated only once and
  this should happen infrequently thus this approach is the best one
  for the image expansion
- tail writes are ordered, i.e. the guest IO queue could not be sent
  immediately to the host introducing additional IO delays

This patch just adds proper parameters into BDRVParallelsState and
performs options parsing in parallels_open.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Roman Kagan <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: delay writing to BAT till bdrv_co_flush_to_os
Denis V. Lunev [Tue, 28 Apr 2015 07:46:57 +0000 (10:46 +0300)]
block/parallels: delay writing to BAT till bdrv_co_flush_to_os

The idea is that we do not need to immediately sync BAT to the image as
from the guest point of view there is a possibility that IO is lost
even in the physical controller until flush command was finished.
bdrv_co_flush_to_os is exactly the right place for this purpose.

Technically the patch uses loaded BAT data as a cache and performs
actual on-disk metadata updates in parallels_co_flush_to_os callback.

This patch speed ups
  qemu-img create -f parallels -o cluster_size=64k ./1.hds 64G
  qemu-io -f parallels -c "write -P 0x11 0 1024k" 1.hds
writing from 50-60 Mb/sec to 80-90 Mb/sec on rotational media and
from 160 Mb/sec to 190 Mb/sec on SSD disk.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: create bat_entry_off helper
Denis V. Lunev [Tue, 28 Apr 2015 07:46:56 +0000 (10:46 +0300)]
block/parallels: create bat_entry_off helper

calculate offset of the BAT entry in the image file.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: improve image reading performance
Denis V. Lunev [Tue, 28 Apr 2015 07:46:55 +0000 (10:46 +0300)]
block/parallels: improve image reading performance

Try to perform IO for the biggest continuous block possible.
The performance for sequential read is increased from 220 Mb/sec to
360 Mb/sec for continous image on my SSD HDD.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoiotests, parallels: check for incorrectly closed image in tests
Denis V. Lunev [Tue, 28 Apr 2015 07:46:54 +0000 (10:46 +0300)]
iotests, parallels: check for incorrectly closed image in tests

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: implement incorrect close detection
Denis V. Lunev [Tue, 28 Apr 2015 07:46:53 +0000 (10:46 +0300)]
block/parallels: implement incorrect close detection

The software driver must set inuse field in Parallels header to
0x746F6E59 when the image is opened in read-write mode. The presence of
this magic in the header on open forces image consistency check.

There is an unfortunate trick here. We can not check for inuse in
parallels_check as this will happen too late. It is possible to do
that for simple check, but during the fix this would always report
an error as the image was opened in BDRV_O_RDWR mode. Thus we save
the flag in BDRVParallelsState for this.

On the other hand, nothing should be done to clear inuse in
parallels_check. Generic close will do the job right.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: implement parallels_check method of block driver
Denis V. Lunev [Tue, 28 Apr 2015 07:46:52 +0000 (10:46 +0300)]
block/parallels: implement parallels_check method of block driver

The check is very simple at the moment. It calculates necessary stats
and fix only the following errors:
- space leak at the end of the image. This would happens due to
  preallocation
- clusters outside the image are zeroed. Nothing else could be done here

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: move parallels_open/probe to the very end of the file
Denis V. Lunev [Tue, 28 Apr 2015 07:46:51 +0000 (10:46 +0300)]
block/parallels: move parallels_open/probe to the very end of the file

This will help to avoid forward declarations for upcoming parallels_check

Some very obvious formatting fixes were made to the moved code to make
checkpatch happy.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: read parallels image header and BAT into single buffer
Denis V. Lunev [Tue, 28 Apr 2015 07:46:50 +0000 (10:46 +0300)]
block/parallels: read parallels image header and BAT into single buffer

This metadata cache would allow to properly batch BAT updates to disk
in next patches. These updates will be properly aligned to avoid
read-modify-write transactions on block level.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: keep BAT bitmap data in little endian in memory
Denis V. Lunev [Tue, 28 Apr 2015 07:46:49 +0000 (10:46 +0300)]
block/parallels: keep BAT bitmap data in little endian in memory

This will allow to use this data as buffer to BAT update directly
without any intermediate buffers.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: create bat2sect helper
Denis V. Lunev [Tue, 28 Apr 2015 07:46:48 +0000 (10:46 +0300)]
block/parallels: create bat2sect helper

deduplicate copy/paste arithmetcs

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: rename catalog_ names to bat_
Denis V. Lunev [Tue, 28 Apr 2015 07:46:47 +0000 (10:46 +0300)]
block/parallels: rename catalog_ names to bat_

BAT means 'block allocation table'. Thus this name is clean and shorter
on writing.

Some obvious formatting fixes in the old code were made to make checkpatch
happy.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoparallels: change copyright information in the image header
Denis V. Lunev [Tue, 28 Apr 2015 07:46:46 +0000 (10:46 +0300)]
parallels: change copyright information in the image header

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoiotests, parallels: test for newly created parallels image via qemu-img
Denis V. Lunev [Tue, 28 Apr 2015 07:46:45 +0000 (10:46 +0300)]
iotests, parallels: test for newly created parallels image via qemu-img

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: support parallels image creation
Denis V. Lunev [Tue, 28 Apr 2015 07:46:44 +0000 (10:46 +0300)]
block/parallels: support parallels image creation

Do not even care to create WithoutFreeSpace image, it is obsolete.
Always create WithouFreSpacExt one.

The code also does not spend a lot of efforts to fill cylinders and
heads fields, they are not used actually in a real life neither in
QEMU nor in Parallels products.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoiotests, parallels: test for write into Parallels image
Denis V. Lunev [Tue, 28 Apr 2015 07:46:43 +0000 (10:46 +0300)]
iotests, parallels: test for write into Parallels image

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: _co_writev callback for Parallels format
Denis V. Lunev [Tue, 28 Apr 2015 07:46:42 +0000 (10:46 +0300)]
block/parallels: _co_writev callback for Parallels format

Support write on Parallels images. The code is almost the same as one
in the previous patch implemented scatter-gather IO for read.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Roman Kagan <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: mark parallels format driver as zero inited
Denis V. Lunev [Tue, 28 Apr 2015 07:46:41 +0000 (10:46 +0300)]
block/parallels: mark parallels format driver as zero inited

From the guest point of view unallocated blocks are zeroed.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Roman Kagan <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: replace magic constants 4, 64 with proper sizeofs
Denis V. Lunev [Tue, 28 Apr 2015 07:46:40 +0000 (10:46 +0300)]
block/parallels: replace magic constants 4, 64 with proper sizeofs

simple purification..

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: provide _co_readv routine for parallels format driver
Denis V. Lunev [Tue, 28 Apr 2015 07:46:39 +0000 (10:46 +0300)]
block/parallels: provide _co_readv routine for parallels format driver

Main approach is taken from qcow2_co_readv.

The patch drops coroutine lock for the duration of IO operation and
peforms normal scatter-gather IO using standard QEMU backend.

The patch also adds comment about locking considerations in the driver.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Signed-off-by: Roman Kagan <[email protected]>
Message-id: 1430207220[email protected]
CC: Roman Kagan <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: add get_block_status
Roman Kagan [Tue, 28 Apr 2015 07:46:38 +0000 (10:46 +0300)]
block/parallels: add get_block_status

Implement VFS method for get_block_status to Parallels format driver.

qemu_co_mutex_lock is not necessary yet (the driver is read-only) but
will be necessary very soon when write will be supported.

Signed-off-by: Roman Kagan <[email protected]>
Reviewed-by: Denis V. Lunev <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: read up to cluster end in one go
Roman Kagan [Tue, 28 Apr 2015 07:46:37 +0000 (10:46 +0300)]
block/parallels: read up to cluster end in one go

Teach parallels_read() to do reads in coarser granularity than just a
single sector: if requested, read up to the cluster end in one go.

Signed-off-by: Roman Kagan <[email protected]>
Reviewed-by: Denis V. Lunev <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: switch to bdrv_read
Roman Kagan [Tue, 28 Apr 2015 07:46:36 +0000 (10:46 +0300)]
block/parallels: switch to bdrv_read

Switch the .bdrv_read method implementation from using bdrv_pread() to
bdrv_read() on the underlying file, since the latter is subject to i/o
throttling while the former is not.

Besides, since bdrv_read() operates in sectors rather than bytes, adjust
the helper functions to do so too.

Signed-off-by: Roman Kagan <[email protected]>
Reviewed-by: Denis V. Lunev <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoblock/parallels: rename parallels_header to ParallelsHeader
Denis V. Lunev [Tue, 28 Apr 2015 07:46:35 +0000 (10:46 +0300)]
block/parallels: rename parallels_header to ParallelsHeader

this follows QEMU coding convention

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agoiotests, parallels: quote TEST_IMG in 076 test to be path-safe
Denis V. Lunev [Tue, 28 Apr 2015 07:46:34 +0000 (10:46 +0300)]
iotests, parallels: quote TEST_IMG in 076 test to be path-safe

suggested by Jeff Cody

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Roman Kagan <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: 1430207220[email protected]
CC: Kevin Wolf <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
9 years agotarget-alpha: Add vector implementation for CMPBGE
Richard Henderson [Mon, 18 Aug 2014 17:19:06 +0000 (10:19 -0700)]
target-alpha: Add vector implementation for CMPBGE

While conditionalized on SSE2, it's a "portable" gcc generic vector
implementation, which could be enabled on other hosts.

Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Rewrite helper_zapnot
Richard Henderson [Tue, 15 Jul 2014 19:07:05 +0000 (12:07 -0700)]
target-alpha: Rewrite helper_zapnot

This form produces significantly smaller code on x86_64.

Signed-off-by: Richard Henderson <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150520-1' into staging
Peter Maydell [Thu, 21 May 2015 08:07:19 +0000 (09:07 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150520-1' into staging

vnc: misc fixes.

# gpg: Signature made Wed May 20 09:32:45 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"

* remotes/kraxel/tags/pull-vnc-20150520-1:
  qemu-sockets: Report explicit error if unlink fails
  vnc: Tweak error when init fails
  vnc: Don't assert if opening unix socket fails
  ui: remove check for failure of qemu_acl_init()
  Strip brackets from vnc host

Signed-off-by: Peter Maydell <[email protected]>
9 years agoqemu-sockets: Report explicit error if unlink fails
Cole Robinson [Tue, 5 May 2015 15:07:19 +0000 (11:07 -0400)]
qemu-sockets: Report explicit error if unlink fails

Consider this case:

$ ls -ld ~/root-owned/
drwx--x--x. 2 root root 4096 Apr 29 12:55 /home/crobinso/root-owned/
$ ls -l ~/root-owned/foo.sock
-rwxrwxrwx. 1 crobinso crobinso 0 Apr 29 12:55 /home/crobinso/root-owned/foo.sock

$ qemu-system-x86_64 -vnc unix:~/root-owned/foo.sock
qemu-system-x86_64: -vnc unix:/home/crobinso/root-owned/foo.sock: Failed to start VNC server: Failed to bind socket to /home/crobinso/root-owned/foo.sock: Address already in use

...which is techinically true, but the real error is that we failed to
unlink. So report it.

This may seem pathological but it's a real possibility via libvirt.

Signed-off-by: Cole Robinson <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agovnc: Tweak error when init fails
Cole Robinson [Tue, 5 May 2015 15:07:18 +0000 (11:07 -0400)]
vnc: Tweak error when init fails

Before:
qemu-system-x86_64: -display vnc=unix:/root/foo.sock: Failed to start VNC server on `(null)': Failed to bind socket to /root/foo.sock: Permission denied

After:
qemu-system-x86_64: -display vnc=unix:/root/foo.sock: Failed to start VNC server: Failed to bind socket to /root/foo.sock: Permission denied

Rather than tweak the string possibly show unix: value as well,
just drop the explicit display reporting. We already get the cli
string in the error message, that should be sufficient.

Signed-off-by: Cole Robinson <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agovnc: Don't assert if opening unix socket fails
Cole Robinson [Tue, 5 May 2015 15:07:17 +0000 (11:07 -0400)]
vnc: Don't assert if opening unix socket fails

Reproducer:

$ qemu-system-x86_64 -display vnc=unix:/root/i-cant-access-you.sock
qemu-system-x86_64: iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed.
Aborted (core dumped)

Signed-off-by: Cole Robinson <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agoui: remove check for failure of qemu_acl_init()
Daniel P. Berrange [Fri, 1 May 2015 10:44:46 +0000 (11:44 +0100)]
ui: remove check for failure of qemu_acl_init()

The qemu_acl_init() function has long since stopped being able
to return NULL, since g_malloc will abort on OOM. As such the
checks for NULL were unreachable code.

Signed-off-by: Daniel P. Berrange <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agoStrip brackets from vnc host
Ján Tomko [Mon, 27 Apr 2015 15:03:14 +0000 (17:03 +0200)]
Strip brackets from vnc host

Commit v2.2.0-1530-ge556032 vnc: switch to inet_listen_opts
bypassed the use of inet_parse in inet_listen, making literal
IPv6 addresses enclosed in brackets fail:

qemu-kvm: -vnc [::1]:0: Failed to start VNC server on `(null)': address
resolution failed for [::1]:5900: Name or service not known

Strip the brackets to make it work again.

Signed-off-by: Ján Tomko <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-serial-20150519-1' into staging
Peter Maydell [Tue, 19 May 2015 13:10:33 +0000 (14:10 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-serial-20150519-1' into staging

serial: fix multi-pci card error cleanup.

# gpg: Signature made Tue May 19 11:47:29 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"

* remotes/kraxel/tags/pull-serial-20150519-1:
  serial: fix multi-pci card error cleanup.

Signed-off-by: Peter Maydell <[email protected]>
9 years agoserial: fix multi-pci card error cleanup.
Gerd Hoffmann [Wed, 6 May 2015 10:58:19 +0000 (12:58 +0200)]
serial: fix multi-pci card error cleanup.

Put the number of serial ports into a local variable in
multi_serial_pci_realize, then increment the port count
(pci->ports) as we initialize the serial port cores.

Now pci->ports always holds the number of successfully
initialized ports and we can use multi_serial_pci_exit
to properly cleanup the already initialized bits in case
of a init failure.

https://bugzilla.redhat.com/show_bug.cgi?id=970551

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20150519-1' into staging
Peter Maydell [Tue, 19 May 2015 10:47:03 +0000 (11:47 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20150519-1' into staging

hw/display: qomify vga cards

# gpg: Signature made Tue May 19 11:23:09 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"

* remotes/kraxel/tags/pull-vga-20150519-1:
  vga-pci: QOMify
  qxl: QOMify
  cirrus_vga: QOMify

Signed-off-by: Peter Maydell <[email protected]>
9 years agovga-pci: QOMify
Gonglei [Tue, 12 May 2015 09:27:08 +0000 (17:27 +0800)]
vga-pci: QOMify

Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agoqxl: QOMify
Gonglei [Tue, 12 May 2015 09:27:10 +0000 (17:27 +0800)]
qxl: QOMify

Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agocirrus_vga: QOMify
Gonglei [Tue, 12 May 2015 09:27:09 +0000 (17:27 +0800)]
cirrus_vga: QOMify

QOMify pci-cirrus-vga like isa-cirrus-vga device.

Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-cocoa-20150519' into staging
Peter Maydell [Tue, 19 May 2015 09:25:59 +0000 (10:25 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-cocoa-20150519' into staging

cocoa queue:
 * fix various issues with full screen in the OSX UI
 * set an icon for our binary file
 * add entries to the View menu for QEMU consoles
 * fix various warnings that are produced when building on 10.10
   (largely deprecated interfaces)

# gpg: Signature made Tue May 19 09:17:23 2015 BST using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"

* remotes/pmaydell/tags/pull-cocoa-20150519:
  ui/cocoa: Add console items to the View menu
  ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
  ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
  ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
  ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
  ui/cocoa: Remove compatibility ifdefs for OSX 10.4
  ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
  Makefile.target: set icon for binary file on Mac OS X
  ui/cocoa: Make -full-screen option work on Mac OS X
  ui/cocoa: Fix several full screen issues on Mac OS X

Signed-off-by: Peter Maydell <[email protected]>
9 years agoui/cocoa: Add console items to the View menu
Programmingkid [Tue, 19 May 2015 08:11:18 +0000 (09:11 +0100)]
ui/cocoa: Add console items to the View menu

Add any console that is available to the current emulator as a
menu item under the View menu.

Signed-off-by: John Arbuckle <[email protected]>
[PMM: Adjusted to apply after zoom-to-fit menu item was added;
 create the View menu at the same time as all the others, and only
 add the dynamically-determined items to it later]
Signed-off-by: Peter Maydell <[email protected]>
9 years agoui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
Peter Maydell [Tue, 19 May 2015 08:11:18 +0000 (09:11 +0100)]
ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants

In OSX 10.10, the NSOKButton and NSCancelButton constants are deprecated
and provoke compiler warnings. Avoid them by using the
NSFileHandlingPanelCancelButton and NSFileHandlingPanelOKButton constants
instead. These are the documented correct constants for the 10.6-and-up
beginSheetModalForWindow API we use. We also use the same method for
the pre-10.6 compatibility code path, but conveniently the constant
values are the same and the constant names have been present since 10.0.
Preferring the constant names that match the non-legacy API makes more
sense anyway.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
Peter Maydell [Tue, 19 May 2015 08:11:18 +0000 (09:11 +0100)]
ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up

Starting in OSX 10.10, NSWindow useOptimizedDrawing is deprecated, so
don't use it there.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
Peter Maydell [Tue, 19 May 2015 08:11:18 +0000 (09:11 +0100)]
ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate

Our class QemuCocoaAppController implements the NSApplicationDelegate
interface, and we pass an object of this class to [NSApp setDelegate].
However, we weren't declaring in the class definition that we implemented
this interface; in OSX 10.10 this provokes the following (slighly
misleading) warning:
ui/cocoa.m:1031:24: warning: sending 'QemuCocoaAppController *' to parameter of
      incompatible type 'id<NSFileManagerDelegate>'
    [NSApp setDelegate:appController];
                       ^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47:
note: passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,
2_0);
                                              ^

Annoyingly, this interface wasn't formally defined until OSX 10.6, so we
have to surround the relevant part of the @interface line with an ifdef.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
Peter Maydell [Tue, 19 May 2015 08:11:18 +0000 (09:11 +0100)]
ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int

The type for openPanelDidEnd's returnCode argument should be NSInteger,
not int. This only matters for the OSX 10.5 code path where we pass
the method directly to an OSX function to call.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoui/cocoa: Remove compatibility ifdefs for OSX 10.4
Peter Maydell [Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)]
ui/cocoa: Remove compatibility ifdefs for OSX 10.4

Remove compatibility ifdefs that work around OSX 10.4 not providing
various typedefs and functions.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoui/cocoa: Drop tests for CGImageCreateWithImageInRect support
Peter Maydell [Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)]
ui/cocoa: Drop tests for CGImageCreateWithImageInRect support

The code that tries to test at both compiletime and runtime
for whether CGImageCreateWithImageInRect is supported provokes
a compile warning on OSX 10.3:

ui/cocoa.m:378:13: warning: comparison of function 'CGImageCreateWithImageInRect'
      equal to a null pointer is always false[-Wtautological-pointer-compare]
        if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is
supported on host at runtime
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~

The simplest way to deal with this is just to drop this code,
since we don't in practice support OSX 10.4 anyway. (10.5 was
released in 2007 and is the last PPC version, so is the earliest
we really need to continue to support at all.)

Signed-off-by: Peter Maydell <[email protected]>
Message-id: 1431296361[email protected]

9 years agoMakefile.target: set icon for binary file on Mac OS X
Programmingkid [Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)]
Makefile.target: set icon for binary file on Mac OS X

Implements setting the icon for the binary file in Mac OS X.

Signed-off-by: John Arbuckle <[email protected]>
[PMM: tweaked makefile to use $@ and quiet-command]
Signed-off-by: Peter Maydell <[email protected]>
9 years agoui/cocoa: Make -full-screen option work on Mac OS X
Programmingkid [Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)]
ui/cocoa: Make -full-screen option work on Mac OS X

This patch makes the -full-screen option actually instruct QEMU to
enter fullscreen at startup, on Mac OS X.

Signed-off-by: John Arbuckle <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
9 years agoui/cocoa: Fix several full screen issues on Mac OS X
Programmingkid [Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)]
ui/cocoa: Fix several full screen issues on Mac OS X

This patch makes several changes:
- Minimizes distorted full screen display by respecting aspect
ratios.
- Makes full screen mode available on Mac OS 10.7 and higher.
- Allows user to decide if video should be stretched to fill the
screen, using a menu item called "Zoom To Fit".
- Hides the normalWindow so it won't show up in full screen mode.
- Allows user to exit full screen mode.

Signed-off-by: John Arbuckle <[email protected]>
[PMM: minor whitespace tweaks, remove incorrectly duplicated
 use of 'f' menu accelerator key]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-alpha: Raise IOV from CVTQL
Richard Henderson [Tue, 8 Jul 2014 17:42:55 +0000 (10:42 -0700)]
target-alpha: Raise IOV from CVTQL

Even if an exception isn't taken, the status flags need updating
and the result should be written to the destination.  Move the body
of cvtql out of line, since we now always need a call.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Suppress underflow from CVTTQ if DNZ
Richard Henderson [Tue, 8 Jul 2014 17:14:09 +0000 (10:14 -0700)]
target-alpha: Suppress underflow from CVTTQ if DNZ

I.e. respect flush_inputs_to_zero.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Raise EXC_M_INV properly for fp inputs
Richard Henderson [Tue, 8 Jul 2014 17:11:06 +0000 (10:11 -0700)]
target-alpha: Raise EXC_M_INV properly for fp inputs

Ignore DNZ if software completion isn't used.  Raise INV for
denormals in system mode so the OS completion handler sees them.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Disallow literal operand to 1C.30 to 1C.37
Richard Henderson [Mon, 7 Jul 2014 13:18:20 +0000 (06:18 -0700)]
target-alpha: Disallow literal operand to 1C.30 to 1C.37

Before 64f45e49 we used to have literal checks for 4 of these 8 opcodes.
Confirmed that real hardware doesn't allow them.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Implement WH64EN
Richard Henderson [Fri, 4 Jul 2014 04:04:26 +0000 (21:04 -0700)]
target-alpha: Implement WH64EN

Backward compatible cache insn introduced for EV7.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Fix integer overflow checking insns
Richard Henderson [Thu, 3 Jul 2014 20:18:26 +0000 (13:18 -0700)]
target-alpha: Fix integer overflow checking insns

We need to write the result to the destination register before
raising any exception.  Thus inline the code for each insn, and
check for any exception after we're done.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Fix cvttq vs inf
Richard Henderson [Thu, 3 Jul 2014 19:37:59 +0000 (12:37 -0700)]
target-alpha: Fix cvttq vs inf

We should raise INV for infinities as well, not OVR+INE.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Fix cvttq vs large integers
Richard Henderson [Thu, 3 Jul 2014 19:36:34 +0000 (12:36 -0700)]
target-alpha: Fix cvttq vs large integers

The range +- 2**63 - 2**64 was returning the wrong truncated
result.  We also incorrectly signaled overflow for -2**63.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Raise IOV from CVTTQ
Richard Henderson [Sat, 28 Jun 2014 19:57:03 +0000 (12:57 -0700)]
target-alpha: Raise IOV from CVTTQ

Floating-point overflow is a different bit from integer overflow.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Set EXC_M_SWC for exceptions from /S insns
Richard Henderson [Mon, 30 Jun 2014 16:53:46 +0000 (09:53 -0700)]
target-alpha: Set EXC_M_SWC for exceptions from /S insns

Previously forgotten, the kernel needs the software completion bit to
know that it needs to emulate software completion qualified insns.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Set fpcr_exc_status even for disabled exceptions
Richard Henderson [Sat, 28 Jun 2014 18:08:28 +0000 (11:08 -0700)]
target-alpha: Set fpcr_exc_status even for disabled exceptions

The qualifiers can suppress the raising of exceptions, but real
hardware still records that the exceptions occurred.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Tidy FPCR representation
Richard Henderson [Fri, 8 Aug 2014 22:17:07 +0000 (12:17 -1000)]
target-alpha: Tidy FPCR representation

Store the fpcr as the hardware represents it.  Convert the softfpu
representation of exceptions into the fpcr representation.

Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Set PC correctly for floating-point exceptions
Richard Henderson [Sat, 28 Jun 2014 20:06:19 +0000 (13:06 -0700)]
target-alpha: Set PC correctly for floating-point exceptions

PC should be one past the faulting insn.  Add better commentary
for the machine-check exception path.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Forget installed round mode after MT_FPCR
Richard Henderson [Sat, 28 Jun 2014 17:25:36 +0000 (10:25 -0700)]
target-alpha: Forget installed round mode after MT_FPCR

When we use QUAL_RM_D, we copy fpcr_dyn_round to float_status.
When we install a new FPCR value, we update fpcr_dyn_round.
Reset the status of the cache so that we re-copy for the next
fp insn that requires dynamic rounding.

Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Rename floating-point subroutines
Richard Henderson [Fri, 8 Aug 2014 20:54:35 +0000 (10:54 -1000)]
target-alpha: Rename floating-point subroutines

... to match the instructions, which have no leading "f".

Signed-off-by: Richard Henderson <[email protected]>
9 years agotarget-alpha: Move VAX helpers to a new file
Richard Henderson [Fri, 8 Aug 2014 20:42:45 +0000 (10:42 -1000)]
target-alpha: Move VAX helpers to a new file

Keep the IEEE and VAX floating point emulation separate.

Signed-off-by: Richard Henderson <[email protected]>
9 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150518-3' into...
Peter Maydell [Mon, 18 May 2015 19:23:16 +0000 (20:23 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150518-3' into staging

target-arm:
 * New board model: xlnx-ep108
 * Some more preparation for AArch64 EL2/EL3
 * Fix bugs in access checking for generic counter registers
 * Remove a stray '+' sign

# gpg: Signature made Mon May 18 20:13:05 2015 BST using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"

* remotes/pmaydell/tags/pull-target-arm-20150518-3: (21 commits)
  target-arm: Remove unneeded '+'
  target-arm: Correct accessfn for CNTV_TVAL_EL0
  target-arm: Correct accessfn for CNTP_{CT}VAL_EL0
  target-arm: Add WFx syndrome function
  target-arm: Add EL3 and EL2 TCR checking
  target-arm: Add TTBR regime function and use
  linux-user/arm: Correct TARGET_NR_timerfd to TARGET_NR_timerfd_create
  arm: xlnx-ep108: Add bootloading
  arm: xlnx-ep108: Add external RAM
  arm: Add xlnx-ep108 machine
  arm: xlnx-zynqmp: Add UART support
  char: cadence_uart: Split state struct and type into header
  char: cadence_uart: Clean up variable names
  arm: xlnx-zynqmp: Add GEM support
  net: cadence_gem: Split state struct and type into header
  net: cadence_gem: Clean up variable names
  arm: xlnx-zynqmp: Connect CPU Timers to GIC
  arm: xlnx-zynqmp: Add GIC
  arm: Introduce Xilinx ZynqMP SoC
  target-arm: cpu64: Add support for Cortex-A53
  ...

Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Remove unneeded '+'
Edgar E. Iglesias [Wed, 13 May 2015 06:52:28 +0000 (16:52 +1000)]
target-arm: Remove unneeded '+'

Signed-off-by: Edgar E. Iglesias <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Message-id: 1431499963[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Correct accessfn for CNTV_TVAL_EL0
Edgar E. Iglesias [Wed, 13 May 2015 06:52:27 +0000 (16:52 +1000)]
target-arm: Correct accessfn for CNTV_TVAL_EL0

Signed-off-by: Edgar E. Iglesias <[email protected]>
Message-id: 1431499963[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Correct accessfn for CNTP_{CT}VAL_EL0
Edgar E. Iglesias [Wed, 13 May 2015 06:52:26 +0000 (16:52 +1000)]
target-arm: Correct accessfn for CNTP_{CT}VAL_EL0

Signed-off-by: Edgar E. Iglesias <[email protected]>
Message-id: 1431499963[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Add WFx syndrome function
Greg Bellows [Wed, 22 Apr 2015 17:09:20 +0000 (12:09 -0500)]
target-arm: Add WFx syndrome function

Adds a utility function for creating a WFx exception syndrome

Signed-off-by: Greg Bellows <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Acked-by: Edgar E. Iglesias <[email protected]>
Message-id: 1429722561[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Add EL3 and EL2 TCR checking
Greg Bellows [Wed, 22 Apr 2015 17:09:19 +0000 (12:09 -0500)]
target-arm: Add EL3 and EL2 TCR checking

Updated get_phys_addr_lpae to check the appropriate TTBCR/TCR depending on the
current EL. Support includes using the different TCR format as well as checks to
insure TTBR1 is not used when in EL2 or EL3.

Signed-off-by: Greg Bellows <[email protected]>
Acked-by: Edgar E. Iglesias <[email protected]>
Message-id: 1429722561[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agotarget-arm: Add TTBR regime function and use
Greg Bellows [Wed, 22 Apr 2015 17:09:18 +0000 (12:09 -0500)]
target-arm: Add TTBR regime function and use

Add a utility function for choosing the correct TTBR system register based on
the specified MMU index. Add use of function on physical address lookup.

Signed-off-by: Greg Bellows <[email protected]>
Acked-by: Edgar E. Iglesias <[email protected]>
Message-id: 1429722561[email protected]
[PMM: fixed regime_ttbr() return type to be uint64_t]
Signed-off-by: Peter Maydell <[email protected]>
9 years agolinux-user/arm: Correct TARGET_NR_timerfd to TARGET_NR_timerfd_create
Timothy Baldwin [Wed, 8 Apr 2015 20:40:52 +0000 (21:40 +0100)]
linux-user/arm: Correct TARGET_NR_timerfd to TARGET_NR_timerfd_create

Misspelled system call name in macro was causing timerfd_create not
to be supported for the ARM target.

Signed-off-by: Timothy Edward Baldwin <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
9 years agoarm: xlnx-ep108: Add bootloading
Peter Crosthwaite [Fri, 15 May 2015 02:23:30 +0000 (19:23 -0700)]
arm: xlnx-ep108: Add bootloading

Add bootloader support using standard ARM bootloader.

Reviewed-by: Alistair Francis <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: b829abaf2b70d02b28e79301553cbd74afc416a1.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agoarm: xlnx-ep108: Add external RAM
Peter Crosthwaite [Fri, 15 May 2015 02:23:27 +0000 (19:23 -0700)]
arm: xlnx-ep108: Add external RAM

Zynq MPSoC supports external DDR RAM. Add a RAM at 0 to the model.

Reviewed-by: Alistair Francis <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: 2c25e2a4198402a6477aef2975d5df7c415dd341.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agoarm: Add xlnx-ep108 machine
Peter Crosthwaite [Fri, 15 May 2015 02:23:24 +0000 (19:23 -0700)]
arm: Add xlnx-ep108 machine

Add a machine model for the Xilinx ZynqMP SoC EP108 board.

Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: 3896b34c862f370dc0679e4428bf3848d1f9f83c.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agoarm: xlnx-zynqmp: Add UART support
Peter Crosthwaite [Fri, 15 May 2015 02:23:21 +0000 (19:23 -0700)]
arm: xlnx-zynqmp: Add UART support

There are 2x Cadence UARTs in Zynq MP. Add them.

Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: e30795536f77599fabc1052278d846ccd52322e2.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agochar: cadence_uart: Split state struct and type into header
Peter Crosthwaite [Fri, 15 May 2015 02:23:18 +0000 (19:23 -0700)]
char: cadence_uart: Split state struct and type into header

Create a new header for Cadence UART to allow using the device with
modern SoC programming conventions. The state struct needs to be
visible to embed the device in SoC containers.

Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: 46a0fbd45b6b205f54c4a8c778deb75c77f8abdf.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
9 years agochar: cadence_uart: Clean up variable names
Peter Crosthwaite [Fri, 15 May 2015 02:23:15 +0000 (19:23 -0700)]
char: cadence_uart: Clean up variable names

Clean up some variable names in preparation for migrating the state struct
and type cast macro to a public header. The acronym "UART" on it's own is
not specific enough to be used in a more global namespace so preface with
"cadence". Fix the capitalisation of "uart" in the state type while touching
the typename. Preface macros used by the state struct itself with CADENCE_UART
so they don't conflict in namespace either.

Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Tested-by: Alistair Francis <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: 3812b7426c338beae9e082557f3524a99310ddc6.1431381507[email protected]
Signed-off-by: Peter Maydell <[email protected]>
This page took 0.087456 seconds and 4 git commands to generate.