Merge lp:~serge-hallyn/ubuntu/maverick/qemu-kvm/update-to-12.4 into lp:ubuntu/maverick/qemu-kvm

Proposed by Serge Hallyn
Status: Superseded
Proposed branch: lp:~serge-hallyn/ubuntu/maverick/qemu-kvm/update-to-12.4
Merge into: lp:ubuntu/maverick/qemu-kvm
Diff against target: 2838 lines (+645/-1148)
50 files modified
Changelog (+50/-0)
KVM_VERSION (+1/-1)
VERSION (+1/-1)
audio/ossaudio.c (+52/-20)
block.c (+11/-3)
block/qcow2-cluster.c (+1/-0)
block/qcow2-refcount.c (+248/-106)
block/qcow2.c (+11/-3)
debian/changelog (+11/-0)
debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch (+0/-137)
debian/patches/05_improve-qemu-img-errors.patch (+0/-20)
debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch (+0/-87)
debian/patches/SDL-wrong-behaviour-of-caps-lock.patch (+0/-31)
debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch (+0/-171)
debian/patches/arm-host-fix-compiler-warning.patch (+0/-90)
debian/patches/better_describe_-net_options.patch (+0/-60)
debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch (+0/-53)
debian/patches/series (+0/-8)
debian/rules (+11/-0)
default-configs/sh4-softmmu.mak (+1/-0)
default-configs/sh4eb-softmmu.mak (+1/-0)
dyngen-exec.h (+3/-3)
hw/device-assignment.c (+0/-75)
hw/fdc.c (+15/-5)
hw/fw_cfg.c (+1/-1)
hw/ide/cmd646.c (+2/-5)
hw/ide/internal.h (+1/-0)
hw/ide/piix.c (+1/-0)
hw/lsi53c895a.c (+84/-92)
hw/scsi-disk.c (+3/-1)
hw/sh7750.c (+5/-2)
hw/sh_pci.c (+15/-96)
hw/usb-uhci.c (+4/-3)
json-parser.c (+1/-1)
linux-user/main.c (+1/-1)
net.c (+0/-20)
net.h (+0/-1)
qemu-char.c (+1/-4)
qemu-common.h (+4/-0)
qemu-kvm.c (+5/-1)
qemu-options.hx (+1/-1)
target-i386/translate.c (+9/-6)
target-sh4/cpu.h (+2/-0)
target-sh4/helper.c (+20/-2)
target-sh4/translate.c (+1/-1)
tcg/arm/tcg-target.c (+7/-4)
tcg/mips/tcg-target.c (+33/-21)
tcg/mips/tcg-target.h (+3/-3)
vl.c (+20/-6)
vnc.c (+4/-2)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/maverick/qemu-kvm/update-to-12.4
Reviewer Review Type Date Requested Status
Mathias Gug Needs Fixing
Dustin Kirkland  Pending
Ubuntu branches Pending
Review via email: mp+27293@code.launchpad.net

This proposal has been superseded by a proposal from 2010-06-15.

Description of the change

Forward port to qemu 0.12.4. Remove patches which have been
merged upstream. Remove the capslock patch since 0.12.3+noroms
(in lucid) with that patch does not behave correctly anyway.

Tweak debian/rules per kees' input to allow parallel=N
DEB_BUILD_OPTIONS.

To post a comment you must log in.
Revision history for this message
Mathias Gug (mathiaz) wrote :

Thanks for creating a merge proposal.

Looking at the last changelog entry for the last new upstream release (0.12.3+noroms-0ubuntu1) you'll notice that the upstream tarball cannot be used directly as it contains some binary BIOS roms whose sources are not available. Thus we need to repack the upstream tarball before importing it into the archive - thus the +noroms appended to the upstream revision. This is why a bunch of new binary files under pc-bios/ have been added to the branch (line 2326).

There should only be one changelog entry with the revision set to 0.12.4+noroms-0ubuntu1 (ie without ~hallyn1 - but I guess you already knew about that ;)). For the point "Removed the capslock patch..." I'd add a reference to the LP bug number using the notation: LP: #DDDDDD

In debian/rules (line ) what does line 1408 mean?:

  , := ,

review: Needs Fixing
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

On Fri, 2010-06-11 at 04:13 +0000, Mathias Gug wrote:
> Review: Needs Fixing
> Thanks for creating a merge proposal.
>
> Looking at the last changelog entry for the last new upstream release (0.12.3+noroms-0ubuntu1) you'll notice that the upstream tarball cannot be used directly as it contains some binary BIOS roms whose sources are not available. Thus we need to repack the upstream tarball before importing it into the archive - thus the +noroms appended to the upstream revision. This is why a bunch of new binary files under pc-bios/ have been added to the branch (line 2326).
>
> There should only be one changelog entry with the revision set to 0.12.4+noroms-0ubuntu1 (ie without ~hallyn1 - but I guess you already knew about that ;)). For the point "Removed the capslock patch..." I'd add a reference to the LP bug number using the notation: LP: #DDDDDD

Thanks for you help - I'm starting a new branch to address these, and
will resubmit that.

> In debian/rules (line ) what does line 1408 mean?:
>
> , := ,

I'm told it's needed to define a variable containing literal ',', which
is dereferenced later using $(,) :)

thanks,
-serge

76. By Serge Hallyn

New upstream release.

Built on top of new +noroms tarball.
TODO: consolidate all debian/changelog entries into 1.
 (in a new bzr branch presumably)

77. By Serge Hallyn

fix debian/changelog and remove binary roms

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Changelog'
--- Changelog 2010-02-26 16:26:00 +0000
+++ Changelog 2010-06-11 20:46:30 +0000
@@ -1,3 +1,53 @@
1version 0.12.4
2 - Workaround for broken OSS_GETVERSION on FreeBSD, part two (Juergen Lock)
3 - oss: fix fragment setting (malc)
4 - oss: issue OSS_GETVERSION ioctl only when needed (malc)
5 - oss: refactor code around policy setting (malc)
6 - oss: workaround for cases when OSS_GETVERSION is not defined (malc)
7 - block: Free iovec arrays allocated by multiwrite_merge() (Stefan Hajnoczi)
8 - lsi: fix segfault in lsi_command_complete (Gerd Hoffmann)
9 - lsi: pass lsi_request to lsi_reselect (Gerd Hoffmann)
10 - lsi: move dma_len+dma_buf into lsi_request (Gerd Hoffmann)
11 - lsi: move current_dev into lsi_request (Gerd Hoffmann)
12 - lsi: have lsi_request for the whole life time of the request. (Gerd Hoffmann)
13 - lsi: use QTAILQ for lsi_queue (Gerd Hoffmann)
14 - tcp/mips: Change TCG_AREG0 (fp -> s0) (Stefan Weil)
15 - sh_pci: fix memory and I/O access (Aurelien Jarno)
16 - Fix incoming migration with iothread (Marcelo Tosatti)
17 - Fix SIGFPE for vnc display of width/height = 1 (Chris Webb)
18 - net: remove broken net_set_boot_mask() boot device validation (Eduardo Habkost)
19 - qcow2: Remove request from in-flight list after error (Kevin Wolf)
20 - qcow2: Don't ignore immediate read/write failures (Kevin Wolf)
21 - block: Fix multiwrite memory leak in error case (Kevin Wolf)
22 - block: Fix error code in multiwrite for immediate failures (Kevin Wolf)
23 - block: Fix multiwrite error handling (Kevin Wolf)
24 - scsi-disk: fix buffer overflow (Gerd Hoffmann)
25 - qcow2: Rewrite alloc_refcount_block/grow_refcount_table (Kevin Wolf)
26 - qcow2: Factor next_refcount_table_size out (Kevin Wolf)
27 - block: avoid creating too large iovecs in multiwrite_merge (Christoph Hellwig)
28 - json-parser: Fix segfault on malformed input (Kevin Wolf)
29 - linux-user: switch default ppc64 CPU to 970fx from 970 (Aurelien Jarno)
30 - target-sh4: MMU: fix store queue addresses (Aurelien Jarno)
31 - target-sh4: MMU: fix ITLB priviledge check (Aurelien Jarno)
32 - target-sh4: MMU: fix mem_idx computation (Aurelien Jarno)
33 - sh7750: handle MMUCR TI bit (Aurelien Jarno)
34 - UHCI spurious interrut fix (Paul Brook)
35 - tcg/mips: fix branch offset during retranslation (Aurelien Jarno)
36 - tcg/arm: correctly save/restore registers in prologue/epilogue (Aurelien Jarno)
37 - workaround for cmd646 bmdma register access while no dma is active (Igor V. Kovalenko)
38 - Fix corner case in chardev udp: parameter (Jan Kiszka)
39 - Don't set default monitor when there is a mux'ed one (Jan Kiszka)
40 - spelling typo (compatibilty) in hw/fw_cfg.c (Vagrant Cascadian)
41 - fdc: fix drive property handling. (Gerd Hoffmann)
42 - target-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957 (TeLeMan)
43 - target-i386: fix SIB decoding with index = 4 (Aurelien Jarno)
44 - Fix segfault with ram_size > 4095M without kvm (Ryan Harper)
45 - target-i386: Fix long jumps/calls in long mode with REX.W set (malc)
46 - target-i386: fix lddqu SSE instruction (Aurelien Jarno)
47 - qemu-char.c: drop debug printfs from qemu_chr_parse_compat (Jan Kiszka)
48 - fix undefined shifts by >32 (Paolo Bonzini)
49 - Fix qemu -net user,hostfwd= example (Aurelien Jarno)
50
1version 0.12.351version 0.12.3
2 - kvm: Fix eflags corruption in kvm mode (Jan Kiszka)52 - kvm: Fix eflags corruption in kvm mode (Jan Kiszka)
3 - qcow2: Fix access after end of array (Kevin Wolf)53 - qcow2: Fix access after end of array (Kevin Wolf)
454
=== modified file 'KVM_VERSION'
--- KVM_VERSION 2010-02-26 16:26:00 +0000
+++ KVM_VERSION 2010-06-11 20:46:30 +0000
@@ -1,1 +1,1 @@
1qemu-kvm-0.12.31qemu-kvm-0.12.4
22
=== modified file 'VERSION'
--- VERSION 2010-02-26 16:26:00 +0000
+++ VERSION 2010-06-11 20:46:30 +0000
@@ -1,1 +1,1 @@
10.12.310.12.4
22
=== modified file 'audio/ossaudio.c'
--- audio/ossaudio.c 2010-01-20 17:54:24 +0000
+++ audio/ossaudio.c 2010-06-11 20:46:30 +0000
@@ -38,6 +38,10 @@
38#define AUDIO_CAP "oss"38#define AUDIO_CAP "oss"
39#include "audio_int.h"39#include "audio_int.h"
4040
41#if defined OSS_GETVERSION && defined SNDCTL_DSP_POLICY
42#define USE_DSP_POLICY
43#endif
44
41typedef struct OSSVoiceOut {45typedef struct OSSVoiceOut {
42 HWVoiceOut hw;46 HWVoiceOut hw;
43 void *pcm_buf;47 void *pcm_buf;
@@ -236,14 +240,39 @@
236}240}
237#endif241#endif
238242
243#ifdef USE_DSP_POLICY
244static int oss_get_version (int fd, int *version, const char *typ)
245{
246 if (ioctl (fd, OSS_GETVERSION, &version)) {
247#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
248 /*
249 * Looks like atm (20100109) FreeBSD knows OSS_GETVERSION
250 * since 7.x, but currently only on the mixer device (or in
251 * the Linuxolator), and in the native version that part of
252 * the code is in fact never reached so the ioctl fails anyway.
253 * Until this is fixed, just check the errno and if its what
254 * FreeBSD's sound drivers return atm assume they are new enough.
255 */
256 if (errno == EINVAL) {
257 *version = 0x040000;
258 return 0;
259 }
260#endif
261 oss_logerr2 (errno, typ, "Failed to get OSS version\n");
262 return -1;
263 }
264 return 0;
265}
266#endif
267
239static int oss_open (int in, struct oss_params *req,268static int oss_open (int in, struct oss_params *req,
240 struct oss_params *obt, int *pfd)269 struct oss_params *obt, int *pfd)
241{270{
242 int fd;271 int fd;
243 int version;
244 int oflags = conf.exclusive ? O_EXCL : 0;272 int oflags = conf.exclusive ? O_EXCL : 0;
245 audio_buf_info abinfo;273 audio_buf_info abinfo;
246 int fmt, freq, nchannels;274 int fmt, freq, nchannels;
275 int setfragment = 1;
247 const char *dspname = in ? conf.devpath_in : conf.devpath_out;276 const char *dspname = in ? conf.devpath_in : conf.devpath_out;
248 const char *typ = in ? "ADC" : "DAC";277 const char *typ = in ? "ADC" : "DAC";
249278
@@ -281,27 +310,30 @@
281 goto err;310 goto err;
282 }311 }
283312
284 if (ioctl (fd, OSS_GETVERSION, &version)) {313#ifdef USE_DSP_POLICY
285 oss_logerr2 (errno, typ, "Failed to get OSS version\n");314 if (conf.policy >= 0) {
286 version = 0;315 int version;
287 }316
288317 if (!oss_get_version (fd, &version, typ)) {
289 if (conf.debug) {318 if (conf.debug) {
290 dolog ("OSS version = %#x\n", version);319 dolog ("OSS version = %#x\n", version);
291 }320 }
292321
293#ifdef SNDCTL_DSP_POLICY322 if (version >= 0x040000) {
294 if (conf.policy >= 0 && version >= 0x040000) {323 int policy = conf.policy;
295 int policy = conf.policy;324 if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {
296 if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {325 oss_logerr2 (errno, typ,
297 oss_logerr2 (errno, typ, "Failed to set timing policy to %d\n",326 "Failed to set timing policy to %d\n",
298 conf.policy);327 conf.policy);
299 goto err;328 goto err;
329 }
330 setfragment = 0;
331 }
300 }332 }
301 }333 }
302 else
303#endif334#endif
304 {335
336 if (setfragment) {
305 int mmmmssss = (req->nfrags << 16) | ctz32 (req->fragsize);337 int mmmmssss = (req->nfrags << 16) | ctz32 (req->fragsize);
306 if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) {338 if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) {
307 oss_logerr2 (errno, typ, "Failed to set buffer length (%d, %d)\n",339 oss_logerr2 (errno, typ, "Failed to set buffer length (%d, %d)\n",
@@ -857,7 +889,7 @@
857 .valp = &conf.exclusive,889 .valp = &conf.exclusive,
858 .descr = "Open device in exclusive mode (vmix wont work)"890 .descr = "Open device in exclusive mode (vmix wont work)"
859 },891 },
860#ifdef SNDCTL_DSP_POLICY892#ifdef USE_DSP_POLICY
861 {893 {
862 .name = "POLICY",894 .name = "POLICY",
863 .tag = AUD_OPT_INT,895 .tag = AUD_OPT_INT,
864896
=== modified file 'block.c'
--- block.c 2010-02-26 16:26:00 +0000
+++ block.c 2010-06-11 20:46:30 +0000
@@ -1608,6 +1608,9 @@
16081608
1609 for (i = 0; i < mcb->num_callbacks; i++) {1609 for (i = 0; i < mcb->num_callbacks; i++) {
1610 mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error);1610 mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error);
1611 if (mcb->callbacks[i].free_qiov) {
1612 qemu_iovec_destroy(mcb->callbacks[i].free_qiov);
1613 }
1611 qemu_free(mcb->callbacks[i].free_qiov);1614 qemu_free(mcb->callbacks[i].free_qiov);
1612 qemu_vfree(mcb->callbacks[i].free_buf);1615 qemu_vfree(mcb->callbacks[i].free_buf);
1613 }1616 }
@@ -1617,7 +1620,7 @@
1617{1620{
1618 MultiwriteCB *mcb = opaque;1621 MultiwriteCB *mcb = opaque;
16191622
1620 if (ret < 0) {1623 if (ret < 0 && !mcb->error) {
1621 mcb->error = ret;1624 mcb->error = ret;
1622 multiwrite_user_cb(mcb);1625 multiwrite_user_cb(mcb);
1623 }1626 }
@@ -1669,6 +1672,10 @@
1669 merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]);1672 merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]);
1670 }1673 }
16711674
1675 if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) {
1676 merge = 0;
1677 }
1678
1672 if (merge) {1679 if (merge) {
1673 size_t size;1680 size_t size;
1674 QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov));1681 QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov));
@@ -1754,10 +1761,11 @@
1754 // submitted yet. Otherwise we'll wait for the submitted AIOs to1761 // submitted yet. Otherwise we'll wait for the submitted AIOs to
1755 // complete and report the error in the callback.1762 // complete and report the error in the callback.
1756 if (mcb->num_requests == 0) {1763 if (mcb->num_requests == 0) {
1757 reqs[i].error = EIO;1764 reqs[i].error = -EIO;
1758 goto fail;1765 goto fail;
1759 } else {1766 } else {
1760 mcb->error = EIO;1767 mcb->num_requests++;
1768 multiwrite_cb(mcb, -EIO);
1761 break;1769 break;
1762 }1770 }
1763 } else {1771 } else {
17641772
=== modified file 'block/qcow2-cluster.c'
--- block/qcow2-cluster.c 2010-02-26 16:26:00 +0000
+++ block/qcow2-cluster.c 2010-06-11 20:46:30 +0000
@@ -811,6 +811,7 @@
811811
812 cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s->cluster_size);812 cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s->cluster_size);
813 if (cluster_offset < 0) {813 if (cluster_offset < 0) {
814 QLIST_REMOVE(m, next_in_flight);
814 return cluster_offset;815 return cluster_offset;
815 }816 }
816817
817818
=== modified file 'block/qcow2-refcount.c'
--- block/qcow2-refcount.c 2010-02-26 16:26:00 +0000
+++ block/qcow2-refcount.c 2010-06-11 20:46:30 +0000
@@ -27,7 +27,7 @@
27#include "block/qcow2.h"27#include "block/qcow2.h"
2828
29static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size);29static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size);
30static int update_refcount(BlockDriverState *bs,30static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
31 int64_t offset, int64_t length,31 int64_t offset, int64_t length,
32 int addend);32 int addend);
3333
@@ -123,124 +123,266 @@
123 return be16_to_cpu(s->refcount_block_cache[block_index]);123 return be16_to_cpu(s->refcount_block_cache[block_index]);
124}124}
125125
126static int grow_refcount_table(BlockDriverState *bs, int min_size)126/*
127 * Rounds the refcount table size up to avoid growing the table for each single
128 * refcount block that is allocated.
129 */
130static unsigned int next_refcount_table_size(BDRVQcowState *s,
131 unsigned int min_size)
132{
133 unsigned int min_clusters = (min_size >> (s->cluster_bits - 3)) + 1;
134 unsigned int refcount_table_clusters =
135 MAX(1, s->refcount_table_size >> (s->cluster_bits - 3));
136
137 while (min_clusters > refcount_table_clusters) {
138 refcount_table_clusters = (refcount_table_clusters * 3 + 1) / 2;
139 }
140
141 return refcount_table_clusters << (s->cluster_bits - 3);
142}
143
144
145/* Checks if two offsets are described by the same refcount block */
146static int in_same_refcount_block(BDRVQcowState *s, uint64_t offset_a,
147 uint64_t offset_b)
148{
149 uint64_t block_a = offset_a >> (2 * s->cluster_bits - REFCOUNT_SHIFT);
150 uint64_t block_b = offset_b >> (2 * s->cluster_bits - REFCOUNT_SHIFT);
151
152 return (block_a == block_b);
153}
154
155/*
156 * Loads a refcount block. If it doesn't exist yet, it is allocated first
157 * (including growing the refcount table if needed).
158 *
159 * Returns the offset of the refcount block on success or -errno in error case
160 */
161static int64_t alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index)
127{162{
128 BDRVQcowState *s = bs->opaque;163 BDRVQcowState *s = bs->opaque;
129 int new_table_size, new_table_size2, refcount_table_clusters, i, ret;164 unsigned int refcount_table_index;
130 uint64_t *new_table;165 int ret;
131 int64_t table_offset;166
167 /* Find the refcount block for the given cluster */
168 refcount_table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT);
169
170 if (refcount_table_index < s->refcount_table_size) {
171
172 uint64_t refcount_block_offset =
173 s->refcount_table[refcount_table_index];
174
175 /* If it's already there, we're done */
176 if (refcount_block_offset) {
177 if (refcount_block_offset != s->refcount_block_cache_offset) {
178 ret = load_refcount_block(bs, refcount_block_offset);
179 if (ret < 0) {
180 return ret;
181 }
182 }
183 return refcount_block_offset;
184 }
185 }
186
187 /*
188 * If we came here, we need to allocate something. Something is at least
189 * a cluster for the new refcount block. It may also include a new refcount
190 * table if the old refcount table is too small.
191 *
192 * Note that allocating clusters here needs some special care:
193 *
194 * - We can't use the normal qcow2_alloc_clusters(), it would try to
195 * increase the refcount and very likely we would end up with an endless
196 * recursion. Instead we must place the refcount blocks in a way that
197 * they can describe them themselves.
198 *
199 * - We need to consider that at this point we are inside update_refcounts
200 * and doing the initial refcount increase. This means that some clusters
201 * have already been allocated by the caller, but their refcount isn't
202 * accurate yet. free_cluster_index tells us where this allocation ends
203 * as long as we don't overwrite it by freeing clusters.
204 *
205 * - alloc_clusters_noref and qcow2_free_clusters may load a different
206 * refcount block into the cache
207 */
208
209 if (cache_refcount_updates) {
210 ret = write_refcount_block(s);
211 if (ret < 0) {
212 return ret;
213 }
214 }
215
216 /* Allocate the refcount block itself and mark it as used */
217 uint64_t new_block = alloc_clusters_noref(bs, s->cluster_size);
218 memset(s->refcount_block_cache, 0, s->cluster_size);
219 s->refcount_block_cache_offset = new_block;
220
221#ifdef DEBUG_ALLOC2
222 fprintf(stderr, "qcow2: Allocate refcount block %d for %" PRIx64
223 " at %" PRIx64 "\n",
224 refcount_table_index, cluster_index << s->cluster_bits, new_block);
225#endif
226
227 if (in_same_refcount_block(s, new_block, cluster_index << s->cluster_bits)) {
228 /* The block describes itself, need to update the cache */
229 int block_index = (new_block >> s->cluster_bits) &
230 ((1 << (s->cluster_bits - REFCOUNT_SHIFT)) - 1);
231 s->refcount_block_cache[block_index] = cpu_to_be16(1);
232 } else {
233 /* Described somewhere else. This can recurse at most twice before we
234 * arrive at a block that describes itself. */
235 ret = update_refcount(bs, new_block, s->cluster_size, 1);
236 if (ret < 0) {
237 goto fail_block;
238 }
239 }
240
241 /* Now the new refcount block needs to be written to disk */
242 ret = bdrv_pwrite(s->hd, new_block, s->refcount_block_cache,
243 s->cluster_size);
244 if (ret < 0) {
245 goto fail_block;
246 }
247
248 /* If the refcount table is big enough, just hook the block up there */
249 if (refcount_table_index < s->refcount_table_size) {
250 uint64_t data64 = cpu_to_be64(new_block);
251 ret = bdrv_pwrite(s->hd,
252 s->refcount_table_offset + refcount_table_index * sizeof(uint64_t),
253 &data64, sizeof(data64));
254 if (ret < 0) {
255 goto fail_block;
256 }
257
258 s->refcount_table[refcount_table_index] = new_block;
259 return new_block;
260 }
261
262 /*
263 * If we come here, we need to grow the refcount table. Again, a new
264 * refcount table needs some space and we can't simply allocate to avoid
265 * endless recursion.
266 *
267 * Therefore let's grab new refcount blocks at the end of the image, which
268 * will describe themselves and the new refcount table. This way we can
269 * reference them only in the new table and do the switch to the new
270 * refcount table at once without producing an inconsistent state in
271 * between.
272 */
273 /* Calculate the number of refcount blocks needed so far */
274 uint64_t refcount_block_clusters = 1 << (s->cluster_bits - REFCOUNT_SHIFT);
275 uint64_t blocks_used = (s->free_cluster_index +
276 refcount_block_clusters - 1) / refcount_block_clusters;
277
278 /* And now we need at least one block more for the new metadata */
279 uint64_t table_size = next_refcount_table_size(s, blocks_used + 1);
280 uint64_t last_table_size;
281 uint64_t blocks_clusters;
282 do {
283 uint64_t table_clusters = size_to_clusters(s, table_size);
284 blocks_clusters = 1 +
285 ((table_clusters + refcount_block_clusters - 1)
286 / refcount_block_clusters);
287 uint64_t meta_clusters = table_clusters + blocks_clusters;
288
289 last_table_size = table_size;
290 table_size = next_refcount_table_size(s, blocks_used +
291 ((meta_clusters + refcount_block_clusters - 1)
292 / refcount_block_clusters));
293
294 } while (last_table_size != table_size);
295
296#ifdef DEBUG_ALLOC2
297 fprintf(stderr, "qcow2: Grow refcount table %" PRId32 " => %" PRId64 "\n",
298 s->refcount_table_size, table_size);
299#endif
300
301 /* Create the new refcount table and blocks */
302 uint64_t meta_offset = (blocks_used * refcount_block_clusters) *
303 s->cluster_size;
304 uint64_t table_offset = meta_offset + blocks_clusters * s->cluster_size;
305 uint16_t *new_blocks = qemu_mallocz(blocks_clusters * s->cluster_size);
306 uint64_t *new_table = qemu_mallocz(table_size * sizeof(uint64_t));
307
308 assert(meta_offset >= (s->free_cluster_index * s->cluster_size));
309
310 /* Fill the new refcount table */
311 memcpy(new_table, s->refcount_table,
312 s->refcount_table_size * sizeof(uint64_t));
313 new_table[refcount_table_index] = new_block;
314
315 int i;
316 for (i = 0; i < blocks_clusters; i++) {
317 new_table[blocks_used + i] = meta_offset + (i * s->cluster_size);
318 }
319
320 /* Fill the refcount blocks */
321 uint64_t table_clusters = size_to_clusters(s, table_size * sizeof(uint64_t));
322 int block = 0;
323 for (i = 0; i < table_clusters + blocks_clusters; i++) {
324 new_blocks[block++] = cpu_to_be16(1);
325 }
326
327 /* Write refcount blocks to disk */
328 ret = bdrv_pwrite(s->hd, meta_offset, new_blocks,
329 blocks_clusters * s->cluster_size);
330 qemu_free(new_blocks);
331 if (ret < 0) {
332 goto fail_table;
333 }
334
335 /* Write refcount table to disk */
336 for(i = 0; i < table_size; i++) {
337 cpu_to_be64s(&new_table[i]);
338 }
339
340 ret = bdrv_pwrite(s->hd, table_offset, new_table,
341 table_size * sizeof(uint64_t));
342 if (ret < 0) {
343 goto fail_table;
344 }
345
346 for(i = 0; i < table_size; i++) {
347 cpu_to_be64s(&new_table[i]);
348 }
349
350 /* Hook up the new refcount table in the qcow2 header */
132 uint8_t data[12];351 uint8_t data[12];
133 int old_table_size;
134 int64_t old_table_offset;
135
136 if (min_size <= s->refcount_table_size)
137 return 0;
138 /* compute new table size */
139 refcount_table_clusters = s->refcount_table_size >> (s->cluster_bits - 3);
140 for(;;) {
141 if (refcount_table_clusters == 0) {
142 refcount_table_clusters = 1;
143 } else {
144 refcount_table_clusters = (refcount_table_clusters * 3 + 1) / 2;
145 }
146 new_table_size = refcount_table_clusters << (s->cluster_bits - 3);
147 if (min_size <= new_table_size)
148 break;
149 }
150#ifdef DEBUG_ALLOC2
151 printf("grow_refcount_table from %d to %d\n",
152 s->refcount_table_size,
153 new_table_size);
154#endif
155 new_table_size2 = new_table_size * sizeof(uint64_t);
156 new_table = qemu_mallocz(new_table_size2);
157 memcpy(new_table, s->refcount_table,
158 s->refcount_table_size * sizeof(uint64_t));
159 for(i = 0; i < s->refcount_table_size; i++)
160 cpu_to_be64s(&new_table[i]);
161 /* Note: we cannot update the refcount now to avoid recursion */
162 table_offset = alloc_clusters_noref(bs, new_table_size2);
163 ret = bdrv_pwrite(s->hd, table_offset, new_table, new_table_size2);
164 if (ret != new_table_size2)
165 goto fail;
166 for(i = 0; i < s->refcount_table_size; i++)
167 be64_to_cpus(&new_table[i]);
168
169 cpu_to_be64w((uint64_t*)data, table_offset);352 cpu_to_be64w((uint64_t*)data, table_offset);
170 cpu_to_be32w((uint32_t*)(data + 8), refcount_table_clusters);353 cpu_to_be32w((uint32_t*)(data + 8), table_clusters);
171 ret = bdrv_pwrite(s->hd, offsetof(QCowHeader, refcount_table_offset),354 ret = bdrv_pwrite(s->hd, offsetof(QCowHeader, refcount_table_offset),
172 data, sizeof(data));355 data, sizeof(data));
173 if (ret != sizeof(data)) {356 if (ret < 0) {
174 goto fail;357 goto fail_table;
175 }358 }
176359
360 /* And switch it in memory */
361 uint64_t old_table_offset = s->refcount_table_offset;
362 uint64_t old_table_size = s->refcount_table_size;
363
177 qemu_free(s->refcount_table);364 qemu_free(s->refcount_table);
178 old_table_offset = s->refcount_table_offset;
179 old_table_size = s->refcount_table_size;
180 s->refcount_table = new_table;365 s->refcount_table = new_table;
181 s->refcount_table_size = new_table_size;366 s->refcount_table_size = table_size;
182 s->refcount_table_offset = table_offset;367 s->refcount_table_offset = table_offset;
183368
184 update_refcount(bs, table_offset, new_table_size2, 1);369 /* Free old table. Remember, we must not change free_cluster_index */
370 uint64_t old_free_cluster_index = s->free_cluster_index;
185 qcow2_free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));371 qcow2_free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t));
186 return 0;372 s->free_cluster_index = old_free_cluster_index;
187 fail:373
374 ret = load_refcount_block(bs, new_block);
375 if (ret < 0) {
376 goto fail_block;
377 }
378
379 return new_block;
380
381fail_table:
188 qemu_free(new_table);382 qemu_free(new_table);
189 return ret < 0 ? ret : -EIO;383fail_block:
190}384 s->refcount_block_cache_offset = 0;
191385 return ret;
192
193static int64_t alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index)
194{
195 BDRVQcowState *s = bs->opaque;
196 int64_t offset, refcount_block_offset;
197 unsigned int refcount_table_index;
198 int ret;
199 uint64_t data64;
200 int cache = cache_refcount_updates;
201
202 /* Find L1 index and grow refcount table if needed */
203 refcount_table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT);
204 if (refcount_table_index >= s->refcount_table_size) {
205 ret = grow_refcount_table(bs, refcount_table_index + 1);
206 if (ret < 0)
207 return ret;
208 }
209
210 /* Load or allocate the refcount block */
211 refcount_block_offset = s->refcount_table[refcount_table_index];
212 if (!refcount_block_offset) {
213 if (cache_refcount_updates) {
214 write_refcount_block(s);
215 cache_refcount_updates = 0;
216 }
217 /* create a new refcount block */
218 /* Note: we cannot update the refcount now to avoid recursion */
219 offset = alloc_clusters_noref(bs, s->cluster_size);
220 memset(s->refcount_block_cache, 0, s->cluster_size);
221 ret = bdrv_pwrite(s->hd, offset, s->refcount_block_cache, s->cluster_size);
222 if (ret != s->cluster_size)
223 return -EINVAL;
224 s->refcount_table[refcount_table_index] = offset;
225 data64 = cpu_to_be64(offset);
226 ret = bdrv_pwrite(s->hd, s->refcount_table_offset +
227 refcount_table_index * sizeof(uint64_t),
228 &data64, sizeof(data64));
229 if (ret != sizeof(data64))
230 return -EINVAL;
231
232 refcount_block_offset = offset;
233 s->refcount_block_cache_offset = offset;
234 update_refcount(bs, offset, s->cluster_size, 1);
235 cache_refcount_updates = cache;
236 } else {
237 if (refcount_block_offset != s->refcount_block_cache_offset) {
238 if (load_refcount_block(bs, refcount_block_offset) < 0)
239 return -EIO;
240 }
241 }
242
243 return refcount_block_offset;
244}386}
245387
246#define REFCOUNTS_PER_SECTOR (512 >> REFCOUNT_SHIFT)388#define REFCOUNTS_PER_SECTOR (512 >> REFCOUNT_SHIFT)
247389
=== modified file 'block/qcow2.c'
--- block/qcow2.c 2010-02-26 16:26:00 +0000
+++ block/qcow2.c 2010-06-11 20:46:30 +0000
@@ -467,8 +467,10 @@
467 acb->hd_aiocb = bdrv_aio_readv(s->hd,467 acb->hd_aiocb = bdrv_aio_readv(s->hd,
468 (acb->cluster_offset >> 9) + index_in_cluster,468 (acb->cluster_offset >> 9) + index_in_cluster,
469 &acb->hd_qiov, acb->n, qcow_aio_read_cb, acb);469 &acb->hd_qiov, acb->n, qcow_aio_read_cb, acb);
470 if (acb->hd_aiocb == NULL)470 if (acb->hd_aiocb == NULL) {
471 ret = -EIO;
471 goto done;472 goto done;
473 }
472 }474 }
473475
474 return;476 return;
@@ -620,11 +622,17 @@
620 (acb->cluster_offset >> 9) + index_in_cluster,622 (acb->cluster_offset >> 9) + index_in_cluster,
621 &acb->hd_qiov, acb->n,623 &acb->hd_qiov, acb->n,
622 qcow_aio_write_cb, acb);624 qcow_aio_write_cb, acb);
623 if (acb->hd_aiocb == NULL)625 if (acb->hd_aiocb == NULL) {
624 goto done;626 ret = -EIO;
627 goto fail;
628 }
625629
626 return;630 return;
627631
632fail:
633 if (acb->l2meta.nb_clusters != 0) {
634 QLIST_REMOVE(&acb->l2meta, next_in_flight);
635 }
628done:636done:
629 if (acb->qiov->niov > 1)637 if (acb->qiov->niov > 1)
630 qemu_vfree(acb->orig_buf);638 qemu_vfree(acb->orig_buf);
631639
=== modified file 'debian/changelog'
--- debian/changelog 2010-04-23 18:45:55 +0000
+++ debian/changelog 2010-06-11 20:46:30 +0000
@@ -1,3 +1,14 @@
1qemu-kvm (0.12.4+noroms-0ubuntu1) maverick; urgency=low
2
3 * New upstream release.
4 * add block from kees to debian/rules to parallelize make
5 * Removed patches which have been merged.
6 * Removed the capslock patch because capslock isn't behaving
7 right for me in 0.12.3 with the patch anyway, probably bc the
8 underlying SDL has been fixed. Original patch was for LP#427612.
9
10 -- Serge Hallyn <serge.hallyn@canonical.com> Fri, 11 Jun 2010 11:58:47 -0500
11
1qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low12qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low
213
3 * Architecture-specific fixes (LP: #568904)14 * Architecture-specific fixes (LP: #568904)
415
=== removed file 'debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch'
--- debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch 2010-01-20 17:54:24 +0000
+++ debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch 1970-01-01 00:00:00 +0000
@@ -1,137 +0,0 @@
1http://lists.gnu.org/archive/html/qemu-devel/2010-01/msg01114.html
2
3From: Loic Minier
4Date: Tue, 29 Dec 2009 22:06:13 +0100
5Subject: [PATCH] linux-user: adapt uname machine to emulated CPU
6
7---
8 Makefile.target | 2 +-
9 linux-user/cpu-uname.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
10 linux-user/cpu-uname.h | 1 +
11 linux-user/syscall.c | 3 +-
12 4 files changed, 76 insertions(+), 2 deletions(-)
13 create mode 100644 linux-user/cpu-uname.c
14 create mode 100644 linux-user/cpu-uname.h
15
16diff --git a/Makefile.target b/Makefile.target
17index e661478..9f5bd17 100644
18--- a/Makefile.target
19+++ b/Makefile.target
20@@ -95,7 +95,7 @@ $(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR
21
22 QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
23 obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
24- elfload.o linuxload.o uaccess.o gdbstub.o
25+ elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o
26
27 obj-$(TARGET_HAS_BFLT) += flatload.o
28 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
29diff --git a/linux-user/cpu-uname.c b/linux-user/cpu-uname.c
30new file mode 100644
31index 0000000..ddc37be
32--- /dev/null
33+++ b/linux-user/cpu-uname.c
34@@ -0,0 +1,72 @@
35+/*
36+ * cpu to uname machine name map
37+ *
38+ * Copyright (c) 2009 Loïc Minier
39+ *
40+ * This program is free software; you can redistribute it and/or modify
41+ * it under the terms of the GNU General Public License as published by
42+ * the Free Software Foundation; either version 2 of the License, or
43+ * (at your option) any later version.
44+ *
45+ * This program is distributed in the hope that it will be useful,
46+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
47+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48+ * GNU General Public License for more details.
49+ *
50+ * You should have received a copy of the GNU General Public License
51+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
52+ */
53+
54+#include <stdio.h>
55+
56+#include "qemu.h"
57+//#include "qemu-common.h"
58+#include "cpu-uname.h"
59+
60+/* return highest utsname machine name for emulated instruction set
61+ *
62+ * NB: the default emulated CPU ("any") might not match any existing CPU, e.g.
63+ * on ARM it has all features turned on, so there is no perfect arch string to
64+ * return here */
65+const char *cpu_to_uname_machine(void *cpu_env)
66+{
67+#ifdef TARGET_ARM
68+ /* utsname machine name on linux arm is CPU arch name + endianness, e.g.
69+ * armv7l; to get a list of CPU arch names from the linux source, use:
70+ * grep arch_name: -A1 linux/arch/arm/mm/proc-*.S
71+ * see arch/arm/kernel/setup.c: setup_processor()
72+ *
73+ * to test by CPU id, compare cpu_env->cp15.c0_cpuid to ARM_CPUID_*
74+ * defines and to test by CPU feature, use arm_feature(cpu_env,
75+ * ARM_FEATURE_*) */
76+
77+ /* in theory, endianness is configurable on some ARM CPUs, but this isn't
78+ * used in user mode emulation */
79+#ifdef TARGET_WORDS_BIGENDIAN
80+#define utsname_suffix "b"
81+#else
82+#define utsname_suffix "l"
83+#endif
84+ if (arm_feature(cpu_env, ARM_FEATURE_V7))
85+ return "armv7" utsname_suffix;
86+ if (arm_feature(cpu_env, ARM_FEATURE_V6))
87+ return "armv6" utsname_suffix;
88+ /* earliest emulated CPU is ARMv5TE; qemu can emulate the 1026, but not its
89+ * Jazelle support */
90+ return "armv5te" utsname_suffix;
91+#elif defined(TARGET_X86_64)
92+ return "x86-64";
93+#elif defined(TARGET_I386)
94+ /* see arch/x86/kernel/cpu/bugs.c: check_bugs(), 386, 486, 586, 686 */
95+ uint32_t cpuid_version = ((CPUX86State *)cpu_env)->cpuid_version;
96+ int family = ((cpuid_version >> 8) & 0x0f) + ((cpuid_version >> 20) & 0xff);
97+ if (family == 4)
98+ return "i486";
99+ if (family == 5)
100+ return "i586";
101+ return "i686";
102+#else
103+ /* default is #define-d in each arch/ subdir */
104+ return UNAME_MACHINE;
105+#endif
106+}
107diff --git a/linux-user/cpu-uname.h b/linux-user/cpu-uname.h
108new file mode 100644
109index 0000000..32492de
110--- /dev/null
111+++ b/linux-user/cpu-uname.h
112@@ -0,0 +1 @@
113+const char *cpu_to_uname_machine(void *cpu_env);
114diff --git a/linux-user/syscall.c b/linux-user/syscall.c
115index f2dd39e..9fb493f 100644
116--- a/linux-user/syscall.c
117+++ b/linux-user/syscall.c
118@@ -82,6 +82,7 @@
119 #include <linux/fb.h>
120 #include <linux/vt.h>
121 #include "linux_loop.h"
122+#include "cpu-uname.h"
123
124 #include "qemu.h"
125 #include "qemu-common.h"
126@@ -5739,7 +5740,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
127 if (!is_error(ret)) {
128 /* Overrite the native machine name with whatever is being
129 emulated. */
130- strcpy (buf->machine, UNAME_MACHINE);
131+ strcpy (buf->machine, cpu_to_uname_machine(cpu_env));
132 /* Allow the user to override the reported release. */
133 if (qemu_uname_release && *qemu_uname_release)
134 strcpy (buf->release, qemu_uname_release);
135--
1361.6.5
137
1380
=== removed file 'debian/patches/05_improve-qemu-img-errors.patch'
--- debian/patches/05_improve-qemu-img-errors.patch 2009-09-10 22:58:09 +0000
+++ debian/patches/05_improve-qemu-img-errors.patch 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1qemu-img: improve error reporting
2
3Use strerror to provide a better error message when qemu-img fails.
4
5https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/418112
6
7Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
8
9diff -uprN qemu-kvm-0.11.0~rc2/qemu-img.c qemu-kvm-0.11.0~rc2.new/qemu-img.c
10--- qemu-kvm-0.11.0~rc2/qemu-img.c 2009-08-30 04:10:59.000000000 -0500
11+++ qemu-kvm-0.11.0~rc2.new/qemu-img.c 2009-09-10 22:30:32.572211443 -0500
12@@ -368,7 +368,7 @@ static int img_create(int argc, char **a
13 } else if (ret == -EFBIG) {
14 error("The image size is too large for file format '%s'", fmt);
15 } else {
16- error("Error while formatting");
17+ error("Error while formatting (%s)", strerror(-ret));
18 }
19 }
20 return 0;
210
=== removed file 'debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch'
--- debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch 2010-02-18 14:08:33 +0000
+++ debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch 1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
1From de01f17a2cb88dc5ff53cc321342b888c33b120a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org>
3Date: Thu, 11 Feb 2010 17:42:33 +0100
4Subject: [PATCH] Detect and use GCC atomic builtins for locking
5
6---
7 configure | 17 +++++++++++++++++
8 qemu-lock.h | 13 +++++++++++++
9 2 files changed, 30 insertions(+), 0 deletions(-)
10
11diff --git a/configure b/configure
12index 0a84b0e..b33f045 100755
13--- a/configure
14+++ b/configure
15@@ -1823,6 +1823,20 @@ if compile_prog "" ""; then
16 fi
17
18 ##########################################
19+# check if we have gcc atomic built-ins
20+gcc_atomic_builtins=no
21+cat > $TMPC << EOF
22+int main(void) {
23+ int i;
24+ __sync_lock_test_and_set(&i, 1);
25+ __sync_lock_release(&i);
26+}
27+EOF
28+if compile_prog "" ""; then
29+ gcc_atomic_builtins=yes
30+fi
31+
32+##########################################
33 # check if we have fdatasync
34
35 fdatasync=no
36@@ -2168,6 +2182,9 @@ fi
37 if test "$gcc_attribute_warn_unused_result" = "yes" ; then
38 echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
39 fi
40+if test "$gcc_atomic_builtins" = "yes" ; then
41+ echo "CONFIG_GCC_ATOMIC_BUILTINS=y" >> $config_host_mak
42+fi
43 if test "$fdatasync" = "yes" ; then
44 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
45 fi
46diff --git a/qemu-lock.h b/qemu-lock.h
47index 9a3e6ac..5c8eb34 100644
48--- a/qemu-lock.h
49+++ b/qemu-lock.h
50@@ -33,6 +33,14 @@
51
52 #else
53
54+#ifdef CONFIG_GCC_ATOMIC_BUILTINS
55+typedef int spinlock_t;
56+
57+#define SPIN_LOCK_UNLOCKED 0
58+
59+#define resetlock(p) __sync_lock_release((p))
60+#else /* CONFIG_GCC_ATOMIC_BUILTINS */
61+
62 #if defined(__hppa__)
63
64 typedef int spinlock_t[4];
65@@ -56,7 +64,11 @@ static inline void resetlock (spinlock_t *p)
66 }
67
68 #endif
69+#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */
70
71+#ifdef CONFIG_GCC_ATOMIC_BUILTINS
72+#define testandset(p) __sync_lock_test_and_set((p), 1)
73+#else /* CONFIG_GCC_ATOMIC_BUILTINS */
74 #if defined(_ARCH_PPC)
75 static inline int testandset (int *p)
76 {
77@@ -213,6 +225,7 @@ static inline int testandset (int *p)
78 #else
79 #error unimplemented CPU support
80 #endif
81+#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */
82
83 #if defined(CONFIG_USER_ONLY)
84 static inline void spin_lock(spinlock_t *lock)
85--
861.6.6.1
87
880
=== removed file 'debian/patches/SDL-wrong-behaviour-of-caps-lock.patch'
--- debian/patches/SDL-wrong-behaviour-of-caps-lock.patch 2010-04-01 00:22:02 +0000
+++ debian/patches/SDL-wrong-behaviour-of-caps-lock.patch 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1From bb212d2b23bee1abe52db53231caccc1a6a27791 Mon Sep 17 00:00:00 2001
2From: Shahar Havivi <shaharh@redhat.com>
3Date: Fri, 12 Feb 2010 00:00:44 +0200
4Subject: [PATCH] Qemu does not pass pressed capslock to client
5
6---
7 sdl.c | 8 +++++---
8 1 files changed, 5 insertions(+), 3 deletions(-)
9
10diff --git a/sdl.c b/sdl.c
11index cf27ad2..9074641 100644
12--- a/sdl.c
13+++ b/sdl.c
14@@ -390,9 +390,11 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
15 break;
16 case 0x45: /* num lock */
17 case 0x3a: /* caps lock */
18- /* SDL does not send the key up event, so we generate it */
19- kbd_put_keycode(keycode);
20- kbd_put_keycode(keycode | 0x80);
21+ if (ev->type == SDL_KEYUP) {
22+ kbd_put_keycode(keycode | 0x80);
23+ } else {
24+ kbd_put_keycode(keycode);
25+ }
26 return;
27 }
28
29--
301.6.3.3
31
320
=== removed file 'debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch'
--- debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch 2010-02-18 14:08:33 +0000
+++ debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch 1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
1From 2c28192f9eb4a23cda0787c97cdb78c33735803e Mon Sep 17 00:00:00 2001
2From: Michael Casadevall <mcasadevall@ubuntu.com>
3Date: Tue, 16 Feb 2010 05:31:19 -0500
4Subject: [PATCH] This patch adds support for the pselect syscall in linux-user emulation and also adds several support functions required to translate the timespec structs between the target and the host.
5
6Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
7---
8 linux-user/arm/syscall_nr.h | 2 +-
9 linux-user/syscall.c | 119 +++++++++++++++++++++++++++++++++++++++++++
10 2 files changed, 120 insertions(+), 1 deletions(-)
11
12diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h
13index b1db341..79a216a 100644
14--- a/linux-user/arm/syscall_nr.h
15+++ b/linux-user/arm/syscall_nr.h
16@@ -338,7 +338,7 @@
17 #define TARGET_NR_readlinkat (332)
18 #define TARGET_NR_fchmodat (333)
19 #define TARGET_NR_faccessat (334)
20- /* 335 for pselect6 */
21+#define TARGET_NR_pselect6 (335)
22 /* 336 for ppoll */
23 #define TARGET_NR_unshare (337)
24 #define TARGET_NR_set_robust_list (338)
25diff --git a/linux-user/syscall.c b/linux-user/syscall.c
26index 9fb493f..3663451 100644
27--- a/linux-user/syscall.c
28+++ b/linux-user/syscall.c
29@@ -850,6 +850,38 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr,
30 return 0;
31 }
32
33+static inline abi_long copy_from_user_timespec(struct timespec *ts,
34+ abi_ulong target_ts_addr)
35+{
36+ struct target_timespec *target_ts;
37+
38+ if (!lock_user_struct(VERIFY_READ, target_ts, target_ts_addr, 1))
39+ return -TARGET_EFAULT;
40+
41+ __get_user(ts->tv_sec, &target_ts->tv_sec);
42+ __get_user(ts->tv_nsec, &target_ts->tv_nsec);
43+
44+ unlock_user_struct(target_ts, target_ts_addr, 0);
45+
46+ return 0;
47+}
48+
49+
50+static inline abi_long copy_to_user_timespec(abi_ulong target_ts_addr,
51+ const struct timespec *ts)
52+{
53+ struct target_timespec *target_ts;
54+
55+ if (!lock_user_struct(VERIFY_WRITE, target_ts, target_ts_addr, 0))
56+ return -TARGET_EFAULT;
57+
58+ __put_user(ts->tv_sec, &target_ts->tv_sec);
59+ __put_user(ts->tv_nsec, &target_ts->tv_nsec);
60+
61+ unlock_user_struct(target_ts, target_ts_addr, 1);
62+
63+ return 0;
64+}
65 #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
66 #include <mqueue.h>
67
68@@ -949,6 +981,75 @@ static abi_long do_select(int n,
69 return ret;
70 }
71
72+#ifdef TARGET_NR_pselect6
73+/* do_pselect() must return target values and target errnos. */
74+static abi_long do_pselect(int n,
75+ abi_ulong rfd_addr, abi_ulong wfd_addr,
76+ abi_ulong efd_addr, abi_ulong target_tv_addr,
77+ abi_ulong set_addr)
78+{
79+ fd_set rfds, wfds, efds;
80+ fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
81+ struct timespec tv, *tv_ptr;
82+ sigset_t set, *set_ptr;
83+ abi_long ret;
84+
85+ if (rfd_addr) {
86+ if (copy_from_user_fdset(&rfds, rfd_addr, n))
87+ return -TARGET_EFAULT;
88+ rfds_ptr = &rfds;
89+ } else {
90+ rfds_ptr = NULL;
91+ }
92+ if (wfd_addr) {
93+ if (copy_from_user_fdset(&wfds, wfd_addr, n))
94+ return -TARGET_EFAULT;
95+ wfds_ptr = &wfds;
96+ } else {
97+ wfds_ptr = NULL;
98+ }
99+ if (efd_addr) {
100+ if (copy_from_user_fdset(&efds, efd_addr, n))
101+ return -TARGET_EFAULT;
102+ efds_ptr = &efds;
103+ } else {
104+ efds_ptr = NULL;
105+ }
106+
107+ if (target_tv_addr) {
108+ if (copy_from_user_timespec(&tv, target_tv_addr))
109+ return -TARGET_EFAULT;
110+ tv_ptr = &tv;
111+ } else {
112+ tv_ptr = NULL;
113+ }
114+
115+ /* We don't need to return sigmask to target */
116+ if (set_addr) {
117+ target_to_host_old_sigset(&set, &set_addr);
118+ set_ptr = &set;
119+ } else {
120+ set_ptr = NULL;
121+ }
122+
123+ ret = get_errno(pselect(n, rfds_ptr, wfds_ptr, efds_ptr, tv_ptr, set_ptr));
124+
125+ if (!is_error(ret)) {
126+ if (rfd_addr && copy_to_user_fdset(rfd_addr, &rfds, n))
127+ return -TARGET_EFAULT;
128+ if (wfd_addr && copy_to_user_fdset(wfd_addr, &wfds, n))
129+ return -TARGET_EFAULT;
130+ if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n))
131+ return -TARGET_EFAULT;
132+
133+ if (target_tv_addr && copy_to_user_timespec(target_tv_addr, &tv))
134+ return -TARGET_EFAULT;
135+ }
136+
137+ return ret;
138+}
139+#endif
140+
141 static abi_long do_pipe2(int host_pipe[], int flags)
142 {
143 #ifdef CONFIG_PIPE2
144@@ -5136,6 +5237,24 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
145 }
146 break;
147 #endif
148+
149+#ifdef TARGET_NR_pselect6
150+ case TARGET_NR_pselect6:
151+ {
152+ abi_ulong inp, outp, exp, tvp, set;
153+ long nsel;
154+
155+ nsel = tswapl(arg1);
156+ inp = tswapl(arg2);
157+ outp = tswapl(arg3);
158+ exp = tswapl(arg4);
159+ tvp = tswapl(arg5);
160+ set = tswapl(arg6);
161+
162+ ret = do_pselect(nsel, inp, outp, exp, tvp, set);
163+ }
164+ break;
165+#endif
166 case TARGET_NR_symlink:
167 {
168 void *p2;
169--
1701.6.6.1
171
1720
=== removed file 'debian/patches/arm-host-fix-compiler-warning.patch'
--- debian/patches/arm-host-fix-compiler-warning.patch 2010-02-27 11:59:10 +0000
+++ debian/patches/arm-host-fix-compiler-warning.patch 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1From bc4347b883e8175dadef77ed9e02ccaa5e8eba94 Mon Sep 17 00:00:00 2001
2From: Stefan Weil <weil@mail.berlios.de>
3Date: Wed, 20 Jan 2010 19:43:25 +0100
4Subject: [PATCH] arm host: fix compiler warning
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Compilation for arm (native or cross) results in this
10warning:
11
12fpu/softfloat-native.c: In function ‘float64_round_to_int’:
13fpu/softfloat-native.c:387: error: control reaches end of non-void function
14
15float64_round_to_int uses special assembler code for arm
16and has no explicit return value.
17
18As there is no obvious reason why arm should need special
19code, all fpu related conditionals were removed.
20The remaining code is standard (C99) and compiles for arm,
21too.
22
23Signed-off-by: Stefan Weil <weil@mail.berlios.de>
24Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
25Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
26---
27 fpu/softfloat-native.c | 20 --------------------
28 fpu/softfloat-native.h | 7 -------
29 2 files changed, 0 insertions(+), 27 deletions(-)
30
31diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c
32index 8d64f4e..049c830 100644
33--- a/fpu/softfloat-native.c
34+++ b/fpu/softfloat-native.c
35@@ -12,8 +12,6 @@ void set_float_rounding_mode(int val STATUS_PARAM)
36 #if (defined(CONFIG_BSD) && !defined(__APPLE__) && !defined(__GLIBC__)) || \
37 (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
38 fpsetround(val);
39-#elif defined(__arm__)
40- /* nothing to do */
41 #else
42 fesetround(val);
43 #endif
44@@ -365,25 +363,7 @@ float64 float64_trunc_to_int( float64 a STATUS_PARAM )
45
46 float64 float64_round_to_int( float64 a STATUS_PARAM )
47 {
48-#if defined(__arm__)
49- switch(STATUS(float_rounding_mode)) {
50- default:
51- case float_round_nearest_even:
52- asm("rndd %0, %1" : "=f" (a) : "f"(a));
53- break;
54- case float_round_down:
55- asm("rnddm %0, %1" : "=f" (a) : "f"(a));
56- break;
57- case float_round_up:
58- asm("rnddp %0, %1" : "=f" (a) : "f"(a));
59- break;
60- case float_round_to_zero:
61- asm("rnddz %0, %1" : "=f" (a) : "f"(a));
62- break;
63- }
64-#else
65 return rint(a);
66-#endif
67 }
68
69 float64 float64_rem( float64 a, float64 b STATUS_PARAM)
70diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h
71index fe737b3..6da0bcb 100644
72--- a/fpu/softfloat-native.h
73+++ b/fpu/softfloat-native.h
74@@ -126,13 +126,6 @@ enum {
75 float_round_up = FP_RP,
76 float_round_to_zero = FP_RZ
77 };
78-#elif defined(__arm__)
79-enum {
80- float_round_nearest_even = 0,
81- float_round_down = 1,
82- float_round_up = 2,
83- float_round_to_zero = 3
84-};
85 #else
86 enum {
87 float_round_nearest_even = FE_TONEAREST,
88--
891.7.0
90
910
=== removed file 'debian/patches/better_describe_-net_options.patch'
--- debian/patches/better_describe_-net_options.patch 2010-03-05 18:39:19 +0000
+++ debian/patches/better_describe_-net_options.patch 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
1[PATCH] better describe -net options
2
3The manpage reflects that multiple -net user calls may be made,
4but if this is done, it can cause the program to hang. Instead,
5multiple -net calls can be combined into one, and this patch adds
6that information to qemu-options.hx. Also, -net user may only
7be used in conjunction with -net nic. This is already implcitly
8stated, but this patch makes that statement more explicit.
9
10https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/474969
11https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/453617
12
13Signed-off-by: Brian Thomason <brian.thomason@canonical.com>
14---
15 qemu-options.hx | 15 +++++++++++++--
16 1 files changed, 13 insertions(+), 2 deletions(-)
17
18diff --git a/qemu-options.hx b/qemu-options.hx
19index fd50add..724f434 100644
20--- a/qemu-options.hx
21+++ b/qemu-options.hx
22@@ -952,7 +952,8 @@ for a list of available devices for your target.
23
24 @item -net user[,@var{option}][,@var{option}][,...]
25 Use the user mode network stack which requires no administrator
26-privilege to run. Valid options are:
27+privilege to run. Please note that this can be used only in conjunction with
28+@option{-net nic}. Valid options are:
29
30 @table @option
31 @item vlan=@var{n}
32@@ -1028,7 +1029,8 @@ the guest IP address @var{guestaddr} on guest port @var{guestport}. If
33 @var{guestaddr} is not specified, its value is x.x.x.15 (default first address
34 given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
35 be bound to a specific host interface. If no connection type is set, TCP is
36-used. This option can be given multiple times.
37+used. This option can not be given multiple times, but multiple rules may
38+be combined.
39
40 For example, to redirect host X11 connection from screen 1 to guest
41 screen 0, use the following:
42@@ -1052,6 +1054,15 @@ telnet localhost 5555
43 Then when you use on the host @code{telnet localhost 5555}, you
44 connect to the guest telnet server.
45
46+To combine two or more hostfwd rules, simply use a comma as a delimiter. For
47+example, to combine the two rules mentioned in the examples above, use the
48+following:
49+
50+@example
51+#on the host
52+qemu -net user,hostfwd=tcp:127.0.0.1:6001-:6000,hostfwd=tcp:5555-::23 [...]
53+@end example
54+
55 @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
56 Forward guest TCP connections to the IP address @var{server} on port @var{port}
57 to the character device @var{dev}. This option can be given multiple times.
58--
591.6.3.3
60
610
=== removed file 'debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch'
--- debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch 2010-03-12 13:30:30 +0000
+++ debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1From e2a305fb13ff0f5cf6ff805555aaa90a5ed5954c Mon Sep 17 00:00:00 2001
2From: Christoph Hellwig <hch@lst.de>
3Date: Tue, 26 Jan 2010 14:49:08 +0100
4Subject: [PATCH] block: avoid creating too large iovecs in multiwrite_merge
5
6If we go over the maximum number of iovecs support by syscall we get
7back EINVAL from the kernel which translate to I/O errors for the guest.
8
9Add a MAX_IOV defintion for platforms that don't have it. For now we use
10the same 1024 define that's used on Linux and various other platforms,
11but until the windows block backend implements some kind of vectored I/O
12it doesn't matter.
13
14Signed-off-by: Christoph Hellwig <hch@lst.de>
15Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
16---
17 block.c | 4 ++++
18 qemu-common.h | 4 ++++
19 2 files changed, 8 insertions(+), 0 deletions(-)
20
21diff --git a/block.c b/block.c
22index 9c106a8..1919d19 100644
23--- a/block.c
24+++ b/block.c
25@@ -1691,6 +1691,10 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
26 merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]);
27 }
28
29+ if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) {
30+ merge = 0;
31+ }
32+
33 if (merge) {
34 size_t size;
35 QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov));
36diff --git a/qemu-common.h b/qemu-common.h
37index ae4f23b..b09f717 100644
38--- a/qemu-common.h
39+++ b/qemu-common.h
40@@ -54,6 +54,10 @@ struct iovec {
41 void *iov_base;
42 size_t iov_len;
43 };
44+/*
45+ * Use the same value as Linux for now.
46+ */
47+#define IOV_MAX 1024
48 #else
49 #include <sys/uio.h>
50 #endif
51--
521.7.0.2
53
540
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-04-01 00:22:02 +0000
+++ debian/patches/series 2010-06-11 20:46:30 +0000
@@ -1,11 +1,3 @@
105_improve-qemu-img-errors.patch
20001-linux-user-adapt-uname-machine-to-emulated-CPU.patch
30001-Fix-missing-symbols-in-.rel-.rela.plt-sections.patch10001-Fix-missing-symbols-in-.rel-.rela.plt-sections.patch
4Detect-and-use-GCC-atomic-builtins-for-locking.patch
5This-patch-adds-support-for-the-pselect-syscall-in-l.patch
6arm-host-fix-compiler-warning.patch
7better_describe_-net_options.patch
8block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch
9arm-higher-initrd-load-address.patch2arm-higher-initrd-load-address.patch
10larger_default_ram_size.patch3larger_default_ram_size.patch
11SDL-wrong-behaviour-of-caps-lock.patch
124
=== modified file 'debian/rules'
--- debian/rules 2010-04-23 18:45:55 +0000
+++ debian/rules 2010-06-11 20:46:30 +0000
@@ -7,6 +7,17 @@
7DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)7DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
8DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)8DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
99
10ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
11 INSTALL_PROGRAM += -s
12endif
13
14# Handle DEB_BUILD_OPTIONS=parallel=N
15, := ,
16ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
17 NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
18 MAKEFLAGS += -j$(NUMJOBS)
19endif
20
10ifeq ($(DEB_HOST_ARCH_OS),linux)21ifeq ($(DEB_HOST_ARCH_OS),linux)
11# Note: We differ from Debian here by favoring the pulseaudio driver, since that's default in Ubuntu.22# Note: We differ from Debian here by favoring the pulseaudio driver, since that's default in Ubuntu.
12# Users override this when calling qemu by exporting the environment variable QEMU_AUDIO_DRV.23# Users override this when calling qemu by exporting the environment variable QEMU_AUDIO_DRV.
1324
=== modified file 'default-configs/sh4-softmmu.mak'
--- default-configs/sh4-softmmu.mak 2010-01-20 17:54:24 +0000
+++ default-configs/sh4-softmmu.mak 2010-06-11 20:46:30 +0000
@@ -2,3 +2,4 @@
22
3CONFIG_USB_OHCI=y3CONFIG_USB_OHCI=y
4CONFIG_PTIMER=y4CONFIG_PTIMER=y
5CONFIG_ISA_MMIO=y
56
=== modified file 'default-configs/sh4eb-softmmu.mak'
--- default-configs/sh4eb-softmmu.mak 2010-01-20 17:54:24 +0000
+++ default-configs/sh4eb-softmmu.mak 2010-06-11 20:46:30 +0000
@@ -2,3 +2,4 @@
22
3CONFIG_USB_OHCI=y3CONFIG_USB_OHCI=y
4CONFIG_PTIMER=y4CONFIG_PTIMER=y
5CONFIG_ISA_MMIO=y
56
=== modified file 'dyngen-exec.h'
--- dyngen-exec.h 2010-01-20 17:54:24 +0000
+++ dyngen-exec.h 2010-06-11 20:46:30 +0000
@@ -69,9 +69,9 @@
69#define AREG1 "r14"69#define AREG1 "r14"
70#define AREG2 "r15"70#define AREG2 "r15"
71#elif defined(__mips__)71#elif defined(__mips__)
72#define AREG0 "fp"72#define AREG0 "s0"
73#define AREG1 "s0"73#define AREG1 "s1"
74#define AREG2 "s1"74#define AREG2 "fp"
75#elif defined(__sparc__)75#elif defined(__sparc__)
76#ifdef CONFIG_SOLARIS76#ifdef CONFIG_SOLARIS
77#define AREG0 "g2"77#define AREG0 "g2"
7878
=== modified file 'hw/device-assignment.c'
--- hw/device-assignment.c 2010-01-21 16:22:13 +0000
+++ hw/device-assignment.c 2010-06-11 20:46:30 +0000
@@ -1311,77 +1311,6 @@
1311 }1311 }
1312}1312}
13131313
1314/* Option ROM header */
1315struct option_rom_header {
1316 uint8_t signature[2];
1317 uint8_t rom_size;
1318 uint32_t entry_point;
1319 uint8_t reserved[17];
1320 uint16_t pci_header_offset;
1321 uint16_t expansion_header_offset;
1322} __attribute__ ((packed));
1323
1324/* Option ROM PCI data structure */
1325struct option_rom_pci_header {
1326 uint8_t signature[4];
1327 uint16_t vendor_id;
1328 uint16_t device_id;
1329 uint16_t vital_product_data_offset;
1330 uint16_t structure_length;
1331 uint8_t structure_revision;
1332 uint8_t class_code[3];
1333 uint16_t image_length;
1334 uint16_t image_revision;
1335 uint8_t code_type;
1336 uint8_t indicator;
1337 uint16_t reserved;
1338} __attribute__ ((packed));
1339
1340/*
1341 * Scan the list of Option ROMs at roms. If a suitable Option ROM is found,
1342 * allocate a ram space and copy it there. Then return its size aligned to
1343 * both 2KB and target page size.
1344 */
1345#define OPTION_ROM_ALIGN(x) (((x) + 2047) & ~2047)
1346static void scan_option_rom(const char *name, uint8_t devfn, void *roms)
1347{
1348 int i, size;
1349 uint8_t csum;
1350 struct option_rom_header *rom;
1351 struct option_rom_pci_header *pcih;
1352
1353 rom = roms;
1354
1355 for ( ; ; ) {
1356 /* Invalid signature means we're out of option ROMs. */
1357 if (strncmp((char *)rom->signature, "\x55\xaa", 2) ||
1358 (rom->rom_size == 0))
1359 break;
1360
1361 size = rom->rom_size * 512;
1362 /* Invalid checksum means we're out of option ROMs. */
1363 csum = 0;
1364 for (i = 0; i < size; i++)
1365 csum += ((uint8_t *)rom)[i];
1366 if (csum != 0)
1367 break;
1368
1369 /* Check the PCI header (if any) for a match. */
1370 pcih = (struct option_rom_pci_header *)
1371 ((char *)rom + rom->pci_header_offset);
1372 if ((rom->pci_header_offset != 0) &&
1373 !strncmp((char *)pcih->signature, "PCIR", 4))
1374 goto found;
1375
1376 rom = (struct option_rom_header *)((char *)rom + size);
1377 }
1378 return;
1379
1380 found:
1381 rom_add_blob(name ? name : "assigned device", rom, size, 0);
1382 return;
1383}
1384
1385/*1314/*
1386 * Scan the assigned devices for the devices that have an option ROM, and then1315 * Scan the assigned devices for the devices that have an option ROM, and then
1387 * load the corresponding ROM data to RAM. If an error occurs while loading an1316 * load the corresponding ROM data to RAM. If an error occurs while loading an
@@ -1445,9 +1374,5 @@
1445 size, PROT_READ);1374 size, PROT_READ);
1446 }1375 }
14471376
1448 if (!dev->dev.qdev.hotplugged) {
1449 /* Scan the buffer for suitable ROMs and increase the offset */
1450 scan_option_rom(dev->dev.qdev.id, dev->dev.devfn, buf);
1451 }
1452 free(buf);1377 free(buf);
1453}1378}
14541379
=== modified file 'hw/fdc.c'
--- hw/fdc.c 2010-01-20 17:54:24 +0000
+++ hw/fdc.c 2010-06-11 20:46:30 +0000
@@ -1860,8 +1860,12 @@
1860 ISADevice *dev;1860 ISADevice *dev;
18611861
1862 dev = isa_create("isa-fdc");1862 dev = isa_create("isa-fdc");
1863 qdev_prop_set_drive(&dev->qdev, "driveA", fds[0]);1863 if (fds[0]) {
1864 qdev_prop_set_drive(&dev->qdev, "driveB", fds[1]);1864 qdev_prop_set_drive(&dev->qdev, "driveA", fds[0]);
1865 }
1866 if (fds[1]) {
1867 qdev_prop_set_drive(&dev->qdev, "driveB", fds[1]);
1868 }
1865 if (qdev_init(&dev->qdev) < 0)1869 if (qdev_init(&dev->qdev) < 0)
1866 return NULL;1870 return NULL;
1867 return &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state);1871 return &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state);
@@ -1879,8 +1883,12 @@
1879 sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev);1883 sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev);
1880 fdctrl = &sys->state;1884 fdctrl = &sys->state;
1881 fdctrl->dma_chann = dma_chann; /* FIXME */1885 fdctrl->dma_chann = dma_chann; /* FIXME */
1882 qdev_prop_set_drive(dev, "driveA", fds[0]);1886 if (fds[0]) {
1883 qdev_prop_set_drive(dev, "driveB", fds[1]);1887 qdev_prop_set_drive(dev, "driveA", fds[0]);
1888 }
1889 if (fds[1]) {
1890 qdev_prop_set_drive(dev, "driveB", fds[1]);
1891 }
1884 qdev_init_nofail(dev);1892 qdev_init_nofail(dev);
1885 sysbus_connect_irq(&sys->busdev, 0, irq);1893 sysbus_connect_irq(&sys->busdev, 0, irq);
1886 sysbus_mmio_map(&sys->busdev, 0, mmio_base);1894 sysbus_mmio_map(&sys->busdev, 0, mmio_base);
@@ -1896,7 +1904,9 @@
1896 fdctrl_t *fdctrl;1904 fdctrl_t *fdctrl;
18971905
1898 dev = qdev_create(NULL, "SUNW,fdtwo");1906 dev = qdev_create(NULL, "SUNW,fdtwo");
1899 qdev_prop_set_drive(dev, "drive", fds[0]);1907 if (fds[0]) {
1908 qdev_prop_set_drive(dev, "drive", fds[0]);
1909 }
1900 qdev_init_nofail(dev);1910 qdev_init_nofail(dev);
1901 sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev);1911 sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev);
1902 fdctrl = &sys->state;1912 fdctrl = &sys->state;
19031913
=== modified file 'hw/fw_cfg.c'
--- hw/fw_cfg.c 2010-01-21 16:22:13 +0000
+++ hw/fw_cfg.c 2010-06-11 20:46:30 +0000
@@ -179,7 +179,7 @@
179179
180static void put_unused(QEMUFile *f, void *pv, size_t size)180static void put_unused(QEMUFile *f, void *pv, size_t size)
181{181{
182 fprintf(stderr, "uint32_as_uint16 is only used for backward compatibilty.\n");182 fprintf(stderr, "uint32_as_uint16 is only used for backward compatibility.\n");
183 fprintf(stderr, "This functions shouldn't be called.\n");183 fprintf(stderr, "This functions shouldn't be called.\n");
184}184}
185185
186186
=== modified file 'hw/ide/cmd646.c'
--- hw/ide/cmd646.c 2010-01-20 17:54:24 +0000
+++ hw/ide/cmd646.c 2010-06-11 20:46:30 +0000
@@ -70,11 +70,7 @@
7070
71static PCIIDEState *pci_from_bm(BMDMAState *bm)71static PCIIDEState *pci_from_bm(BMDMAState *bm)
72{72{
73 if (bm->unit == 0) {73 return bm->pci_dev;
74 return container_of(bm, PCIIDEState, bmdma[0]);
75 } else {
76 return container_of(bm, PCIIDEState, bmdma[1]);
77 }
78}74}
7975
80static uint32_t bmdma_readb(void *opaque, uint32_t addr)76static uint32_t bmdma_readb(void *opaque, uint32_t addr)
@@ -145,6 +141,7 @@
145 BMDMAState *bm = &d->bmdma[i];141 BMDMAState *bm = &d->bmdma[i];
146 d->bus[i].bmdma = bm;142 d->bus[i].bmdma = bm;
147 bm->bus = d->bus+i;143 bm->bus = d->bus+i;
144 bm->pci_dev = d;
148 qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);145 qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);
149146
150 register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);147 register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);
151148
=== modified file 'hw/ide/internal.h'
--- hw/ide/internal.h 2010-02-26 16:26:00 +0000
+++ hw/ide/internal.h 2010-06-11 20:46:30 +0000
@@ -481,6 +481,7 @@
481 uint8_t status;481 uint8_t status;
482 uint32_t addr;482 uint32_t addr;
483483
484 struct PCIIDEState *pci_dev;
484 IDEBus *bus;485 IDEBus *bus;
485 /* current transfer state */486 /* current transfer state */
486 uint32_t cur_addr;487 uint32_t cur_addr;
487488
=== modified file 'hw/ide/piix.c'
--- hw/ide/piix.c 2010-01-20 17:54:24 +0000
+++ hw/ide/piix.c 2010-06-11 20:46:30 +0000
@@ -78,6 +78,7 @@
78 BMDMAState *bm = &d->bmdma[i];78 BMDMAState *bm = &d->bmdma[i];
79 d->bus[i].bmdma = bm;79 d->bus[i].bmdma = bm;
80 bm->bus = d->bus+i;80 bm->bus = d->bus+i;
81 bm->pci_dev = d;
81 qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);82 qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);
8283
83 register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);84 register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);
8485
=== modified file 'hw/lsi53c895a.c'
--- hw/lsi53c895a.c 2010-01-20 17:54:24 +0000
+++ hw/lsi53c895a.c 2010-06-11 20:46:30 +0000
@@ -173,11 +173,15 @@
173/* Flag set if this is a tagged command. */173/* Flag set if this is a tagged command. */
174#define LSI_TAG_VALID (1 << 16)174#define LSI_TAG_VALID (1 << 16)
175175
176typedef struct {176typedef struct lsi_request {
177 uint32_t tag;177 uint32_t tag;
178 SCSIDevice *dev;
179 uint32_t dma_len;
180 uint8_t *dma_buf;
178 uint32_t pending;181 uint32_t pending;
179 int out;182 int out;
180} lsi_queue;183 QTAILQ_ENTRY(lsi_request) next;
184} lsi_request;
181185
182typedef struct {186typedef struct {
183 PCIDevice dev;187 PCIDevice dev;
@@ -198,16 +202,13 @@
198 * 3 if a DMA operation is in progress. */202 * 3 if a DMA operation is in progress. */
199 int waiting;203 int waiting;
200 SCSIBus bus;204 SCSIBus bus;
201 SCSIDevice *current_dev;205 SCSIDevice *select_dev;
202 int current_lun;206 int current_lun;
203 /* The tag is a combination of the device ID and the SCSI tag. */207 /* The tag is a combination of the device ID and the SCSI tag. */
204 uint32_t current_tag;208 uint32_t select_tag;
205 uint32_t current_dma_len;
206 int command_complete;209 int command_complete;
207 uint8_t *dma_buf;210 QTAILQ_HEAD(, lsi_request) queue;
208 lsi_queue *queue;211 lsi_request *current;
209 int queue_len;
210 int active_commands;
211212
212 uint32_t dsa;213 uint32_t dsa;
213 uint32_t temp;214 uint32_t temp;
@@ -370,7 +371,7 @@
370static uint8_t lsi_reg_readb(LSIState *s, int offset);371static uint8_t lsi_reg_readb(LSIState *s, int offset);
371static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);372static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);
372static void lsi_execute_script(LSIState *s);373static void lsi_execute_script(LSIState *s);
373static void lsi_reselect(LSIState *s, uint32_t tag);374static void lsi_reselect(LSIState *s, lsi_request *p);
374375
375static inline uint32_t read_dword(LSIState *s, uint32_t addr)376static inline uint32_t read_dword(LSIState *s, uint32_t addr)
376{377{
@@ -391,9 +392,9 @@
391392
392static void lsi_update_irq(LSIState *s)393static void lsi_update_irq(LSIState *s)
393{394{
394 int i;
395 int level;395 int level;
396 static int last_level;396 static int last_level;
397 lsi_request *p;
397398
398 /* It's unclear whether the DIP/SIP bits should be cleared when the399 /* It's unclear whether the DIP/SIP bits should be cleared when the
399 Interrupt Status Registers are cleared or when istat0 is read.400 Interrupt Status Registers are cleared or when istat0 is read.
@@ -427,9 +428,9 @@
427 if (!level && lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON)) {428 if (!level && lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON)) {
428 DPRINTF("Handled IRQs & disconnected, looking for pending "429 DPRINTF("Handled IRQs & disconnected, looking for pending "
429 "processes\n");430 "processes\n");
430 for (i = 0; i < s->active_commands; i++) {431 QTAILQ_FOREACH(p, &s->queue, next) {
431 if (s->queue[i].pending) {432 if (p->pending) {
432 lsi_reselect(s, s->queue[i].tag);433 lsi_reselect(s, p);
433 break;434 break;
434 }435 }
435 }436 }
@@ -508,15 +509,16 @@
508 uint32_t count;509 uint32_t count;
509 target_phys_addr_t addr;510 target_phys_addr_t addr;
510511
511 if (!s->current_dma_len) {512 assert(s->current);
513 if (!s->current->dma_len) {
512 /* Wait until data is available. */514 /* Wait until data is available. */
513 DPRINTF("DMA no data available\n");515 DPRINTF("DMA no data available\n");
514 return;516 return;
515 }517 }
516518
517 count = s->dbc;519 count = s->dbc;
518 if (count > s->current_dma_len)520 if (count > s->current->dma_len)
519 count = s->current_dma_len;521 count = s->current->dma_len;
520522
521 addr = s->dnad;523 addr = s->dnad;
522 /* both 40 and Table Indirect 64-bit DMAs store upper bits in dnad64 */524 /* both 40 and Table Indirect 64-bit DMAs store upper bits in dnad64 */
@@ -532,29 +534,29 @@
532 s->dnad += count;534 s->dnad += count;
533 s->dbc -= count;535 s->dbc -= count;
534536
535 if (s->dma_buf == NULL) {537 if (s->current->dma_buf == NULL) {
536 s->dma_buf = s->current_dev->info->get_buf(s->current_dev,538 s->current->dma_buf = s->current->dev->info->get_buf(s->current->dev,
537 s->current_tag);539 s->current->tag);
538 }540 }
539541
540 /* ??? Set SFBR to first data byte. */542 /* ??? Set SFBR to first data byte. */
541 if (out) {543 if (out) {
542 cpu_physical_memory_read(addr, s->dma_buf, count);544 cpu_physical_memory_read(addr, s->current->dma_buf, count);
543 } else {545 } else {
544 cpu_physical_memory_write(addr, s->dma_buf, count);546 cpu_physical_memory_write(addr, s->current->dma_buf, count);
545 }547 }
546 s->current_dma_len -= count;548 s->current->dma_len -= count;
547 if (s->current_dma_len == 0) {549 if (s->current->dma_len == 0) {
548 s->dma_buf = NULL;550 s->current->dma_buf = NULL;
549 if (out) {551 if (out) {
550 /* Write the data. */552 /* Write the data. */
551 s->current_dev->info->write_data(s->current_dev, s->current_tag);553 s->current->dev->info->write_data(s->current->dev, s->current->tag);
552 } else {554 } else {
553 /* Request any remaining data. */555 /* Request any remaining data. */
554 s->current_dev->info->read_data(s->current_dev, s->current_tag);556 s->current->dev->info->read_data(s->current->dev, s->current->tag);
555 }557 }
556 } else {558 } else {
557 s->dma_buf += count;559 s->current->dma_buf += count;
558 lsi_resume_script(s);560 lsi_resume_script(s);
559 }561 }
560}562}
@@ -563,15 +565,14 @@
563/* Add a command to the queue. */565/* Add a command to the queue. */
564static void lsi_queue_command(LSIState *s)566static void lsi_queue_command(LSIState *s)
565{567{
566 lsi_queue *p;568 lsi_request *p = s->current;
567569
568 DPRINTF("Queueing tag=0x%x\n", s->current_tag);570 DPRINTF("Queueing tag=0x%x\n", s->current_tag);
569 if (s->queue_len == s->active_commands) {571 assert(s->current != NULL);
570 s->queue_len++;572 assert(s->current->dma_len == 0);
571 s->queue = qemu_realloc(s->queue, s->queue_len * sizeof(lsi_queue));573 QTAILQ_INSERT_TAIL(&s->queue, s->current, next);
572 }574 s->current = NULL;
573 p = &s->queue[s->active_commands++];575
574 p->tag = s->current_tag;
575 p->pending = 0;576 p->pending = 0;
576 p->out = (s->sstat1 & PHASE_MASK) == PHASE_DO;577 p->out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
577}578}
@@ -588,45 +589,29 @@
588}589}
589590
590/* Perform reselection to continue a command. */591/* Perform reselection to continue a command. */
591static void lsi_reselect(LSIState *s, uint32_t tag)592static void lsi_reselect(LSIState *s, lsi_request *p)
592{593{
593 lsi_queue *p;
594 int n;
595 int id;594 int id;
596595
597 p = NULL;596 assert(s->current == NULL);
598 for (n = 0; n < s->active_commands; n++) {597 QTAILQ_REMOVE(&s->queue, p, next);
599 p = &s->queue[n];598 s->current = p;
600 if (p->tag == tag)599
601 break;600 id = (p->tag >> 8) & 0xf;
602 }
603 if (n == s->active_commands) {
604 BADF("Reselected non-existant command tag=0x%x\n", tag);
605 return;
606 }
607 id = (tag >> 8) & 0xf;
608 s->ssid = id | 0x80;601 s->ssid = id | 0x80;
609 /* LSI53C700 Family Compatibility, see LSI53C895A 4-73 */602 /* LSI53C700 Family Compatibility, see LSI53C895A 4-73 */
610 if (!s->dcntl & LSI_DCNTL_COM) {603 if (!s->dcntl & LSI_DCNTL_COM) {
611 s->sfbr = 1 << (id & 0x7);604 s->sfbr = 1 << (id & 0x7);
612 }605 }
613 DPRINTF("Reselected target %d\n", id);606 DPRINTF("Reselected target %d\n", id);
614 s->current_dev = s->bus.devs[id];
615 s->current_tag = tag;
616 s->scntl1 |= LSI_SCNTL1_CON;607 s->scntl1 |= LSI_SCNTL1_CON;
617 lsi_set_phase(s, PHASE_MI);608 lsi_set_phase(s, PHASE_MI);
618 s->msg_action = p->out ? 2 : 3;609 s->msg_action = p->out ? 2 : 3;
619 s->current_dma_len = p->pending;610 s->current->dma_len = p->pending;
620 s->dma_buf = NULL;
621 lsi_add_msg_byte(s, 0x80);611 lsi_add_msg_byte(s, 0x80);
622 if (s->current_tag & LSI_TAG_VALID) {612 if (s->current->tag & LSI_TAG_VALID) {
623 lsi_add_msg_byte(s, 0x20);613 lsi_add_msg_byte(s, 0x20);
624 lsi_add_msg_byte(s, tag & 0xff);614 lsi_add_msg_byte(s, p->tag & 0xff);
625 }
626
627 s->active_commands--;
628 if (n != s->active_commands) {
629 s->queue[n] = s->queue[s->active_commands];
630 }615 }
631616
632 if (lsi_irq_on_rsl(s)) {617 if (lsi_irq_on_rsl(s)) {
@@ -638,10 +623,9 @@
638 the device was reselected, nonzero if the IO is deferred. */623 the device was reselected, nonzero if the IO is deferred. */
639static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg)624static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg)
640{625{
641 lsi_queue *p;626 lsi_request *p;
642 int i;627
643 for (i = 0; i < s->active_commands; i++) {628 QTAILQ_FOREACH(p, &s->queue, next) {
644 p = &s->queue[i];
645 if (p->tag == tag) {629 if (p->tag == tag) {
646 if (p->pending) {630 if (p->pending) {
647 BADF("Multiple IO pending for tag %d\n", tag);631 BADF("Multiple IO pending for tag %d\n", tag);
@@ -656,10 +640,10 @@
656 (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON) &&640 (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON) &&
657 !(s->istat0 & (LSI_ISTAT0_SIP | LSI_ISTAT0_DIP)))) {641 !(s->istat0 & (LSI_ISTAT0_SIP | LSI_ISTAT0_DIP)))) {
658 /* Reselect device. */642 /* Reselect device. */
659 lsi_reselect(s, tag);643 lsi_reselect(s, p);
660 return 0;644 return 0;
661 } else {645 } else {
662 DPRINTF("Queueing IO tag=0x%x\n", tag);646 DPRINTF("Queueing IO tag=0x%x\n", tag);
663 p->pending = arg;647 p->pending = arg;
664 return 1;648 return 1;
665 }649 }
@@ -687,11 +671,15 @@
687 } else {671 } else {
688 lsi_set_phase(s, PHASE_ST);672 lsi_set_phase(s, PHASE_ST);
689 }673 }
674
675 qemu_free(s->current);
676 s->current = NULL;
677
690 lsi_resume_script(s);678 lsi_resume_script(s);
691 return;679 return;
692 }680 }
693681
694 if (s->waiting == 1 || tag != s->current_tag ||682 if (s->waiting == 1 || !s->current || tag != s->current->tag ||
695 (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {683 (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {
696 if (lsi_queue_tag(s, tag, arg))684 if (lsi_queue_tag(s, tag, arg))
697 return;685 return;
@@ -699,7 +687,7 @@
699687
700 /* host adapter (re)connected */688 /* host adapter (re)connected */
701 DPRINTF("Data ready tag=0x%x len=%d\n", tag, arg);689 DPRINTF("Data ready tag=0x%x len=%d\n", tag, arg);
702 s->current_dma_len = arg;690 s->current->dma_len = arg;
703 s->command_complete = 1;691 s->command_complete = 1;
704 if (!s->waiting)692 if (!s->waiting)
705 return;693 return;
@@ -721,14 +709,20 @@
721 cpu_physical_memory_read(s->dnad, buf, s->dbc);709 cpu_physical_memory_read(s->dnad, buf, s->dbc);
722 s->sfbr = buf[0];710 s->sfbr = buf[0];
723 s->command_complete = 0;711 s->command_complete = 0;
724 n = s->current_dev->info->send_command(s->current_dev, s->current_tag, buf,712
725 s->current_lun);713 assert(s->current == NULL);
714 s->current = qemu_mallocz(sizeof(lsi_request));
715 s->current->tag = s->select_tag;
716 s->current->dev = s->select_dev;
717
718 n = s->current->dev->info->send_command(s->current->dev, s->current->tag, buf,
719 s->current_lun);
726 if (n > 0) {720 if (n > 0) {
727 lsi_set_phase(s, PHASE_DI);721 lsi_set_phase(s, PHASE_DI);
728 s->current_dev->info->read_data(s->current_dev, s->current_tag);722 s->current->dev->info->read_data(s->current->dev, s->current->tag);
729 } else if (n < 0) {723 } else if (n < 0) {
730 lsi_set_phase(s, PHASE_DO);724 lsi_set_phase(s, PHASE_DO);
731 s->current_dev->info->write_data(s->current_dev, s->current_tag);725 s->current->dev->info->write_data(s->current->dev, s->current->tag);
732 }726 }
733727
734 if (!s->command_complete) {728 if (!s->command_complete) {
@@ -851,16 +845,16 @@
851 }845 }
852 break;846 break;
853 case 0x20: /* SIMPLE queue */847 case 0x20: /* SIMPLE queue */
854 s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;848 s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;
855 DPRINTF("SIMPLE queue tag=0x%x\n", s->current_tag & 0xff);849 DPRINTF("SIMPLE queue tag=0x%x\n", s->current_tag & 0xff);
856 break;850 break;
857 case 0x21: /* HEAD of queue */851 case 0x21: /* HEAD of queue */
858 BADF("HEAD queue not implemented\n");852 BADF("HEAD queue not implemented\n");
859 s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;853 s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;
860 break;854 break;
861 case 0x22: /* ORDERED queue */855 case 0x22: /* ORDERED queue */
862 BADF("ORDERED queue not implemented\n");856 BADF("ORDERED queue not implemented\n");
863 s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;857 s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID;
864 break;858 break;
865 default:859 default:
866 if ((msg & 0x80) == 0) {860 if ((msg & 0x80) == 0) {
@@ -905,17 +899,17 @@
905899
906static void lsi_wait_reselect(LSIState *s)900static void lsi_wait_reselect(LSIState *s)
907{901{
908 int i;902 lsi_request *p;
903
909 DPRINTF("Wait Reselect\n");904 DPRINTF("Wait Reselect\n");
910 if (s->current_dma_len)905
911 BADF("Reselect with pending DMA\n");906 QTAILQ_FOREACH(p, &s->queue, next) {
912 for (i = 0; i < s->active_commands; i++) {907 if (p->pending) {
913 if (s->queue[i].pending) {908 lsi_reselect(s, p);
914 lsi_reselect(s, s->queue[i].tag);
915 break;909 break;
916 }910 }
917 }911 }
918 if (s->current_dma_len == 0) {912 if (s->current == NULL) {
919 s->waiting = 1;913 s->waiting = 1;
920 }914 }
921}915}
@@ -1093,8 +1087,8 @@
1093 /* ??? Linux drivers compain when this is set. Maybe1087 /* ??? Linux drivers compain when this is set. Maybe
1094 it only applies in low-level mode (unimplemented).1088 it only applies in low-level mode (unimplemented).
1095 lsi_script_scsi_interrupt(s, LSI_SIST0_CMP, 0); */1089 lsi_script_scsi_interrupt(s, LSI_SIST0_CMP, 0); */
1096 s->current_dev = s->bus.devs[id];1090 s->select_dev = s->bus.devs[id];
1097 s->current_tag = id << 8;1091 s->select_tag = id << 8;
1098 s->scntl1 |= LSI_SCNTL1_CON;1092 s->scntl1 |= LSI_SCNTL1_CON;
1099 if (insn & (1 << 3)) {1093 if (insn & (1 << 3)) {
1100 s->socl |= LSI_SOCL_ATN;1094 s->socl |= LSI_SOCL_ATN;
@@ -2006,9 +2000,11 @@
2006{2000{
2007 LSIState *s = opaque;2001 LSIState *s = opaque;
20082002
2009 assert(s->dma_buf == NULL);2003 if (s->current) {
2010 assert(s->current_dma_len == 0);2004 assert(s->current->dma_buf == NULL);
2011 assert(s->active_commands == 0);2005 assert(s->current->dma_len == 0);
2006 }
2007 assert(QTAILQ_EMPTY(&s->queue));
2012}2008}
20132009
2014static const VMStateDescription vmstate_lsi_scsi = {2010static const VMStateDescription vmstate_lsi_scsi = {
@@ -2101,8 +2097,6 @@
2101 cpu_unregister_io_memory(s->mmio_io_addr);2097 cpu_unregister_io_memory(s->mmio_io_addr);
2102 cpu_unregister_io_memory(s->ram_io_addr);2098 cpu_unregister_io_memory(s->ram_io_addr);
21032099
2104 qemu_free(s->queue);
2105
2106 return 0;2100 return 0;
2107}2101}
21082102
@@ -2138,9 +2132,7 @@
2138 PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_mmio_mapfunc);2132 PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_mmio_mapfunc);
2139 pci_register_bar((struct PCIDevice *)s, 2, 0x2000,2133 pci_register_bar((struct PCIDevice *)s, 2, 0x2000,
2140 PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc);2134 PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc);
2141 s->queue = qemu_malloc(sizeof(lsi_queue));2135 QTAILQ_INIT(&s->queue);
2142 s->queue_len = 1;
2143 s->active_commands = 0;
21442136
2145 lsi_soft_reset(s);2137 lsi_soft_reset(s);
21462138
21472139
=== modified file 'hw/scsi-disk.c'
--- hw/scsi-disk.c 2010-02-26 16:26:00 +0000
+++ hw/scsi-disk.c 2010-06-11 20:46:30 +0000
@@ -434,7 +434,9 @@
434 memcpy(&outbuf[16], "QEMU HARDDISK ", 16);434 memcpy(&outbuf[16], "QEMU HARDDISK ", 16);
435 }435 }
436 memcpy(&outbuf[8], "QEMU ", 8);436 memcpy(&outbuf[8], "QEMU ", 8);
437 memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION, 4);437 memset(&outbuf[32], 0, 4);
438 memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION,
439 MIN(4, strlen(s->version ? s->version : QEMU_VERSION)));
438 /* Identify device as SCSI-3 rev 1.440 /* Identify device as SCSI-3 rev 1.
439 Some later commands are also implemented. */441 Some later commands are also implemented. */
440 outbuf[2] = 3;442 outbuf[2] = 3;
441443
=== modified file 'hw/sh7750.c'
--- hw/sh7750.c 2010-01-20 17:54:24 +0000
+++ hw/sh7750.c 2010-06-11 20:46:30 +0000
@@ -396,8 +396,11 @@
396 portb_changed(s, temp);396 portb_changed(s, temp);
397 return;397 return;
398 case SH7750_MMUCR_A7:398 case SH7750_MMUCR_A7:
399 s->cpu->mmucr = mem_value;399 if (mem_value & MMUCR_TI) {
400 return;400 cpu_sh4_invalidate_tlb(s->cpu);
401 }
402 s->cpu->mmucr = mem_value & ~MMUCR_TI;
403 return;
401 case SH7750_PTEH_A7:404 case SH7750_PTEH_A7:
402 /* If asid changes, clear all registered tlb entries. */405 /* If asid changes, clear all registered tlb entries. */
403 if ((s->cpu->pteh & 0xff) != (mem_value & 0xff))406 if ((s->cpu->pteh & 0xff) != (mem_value & 0xff))
404407
=== modified file 'hw/sh_pci.c'
--- hw/sh_pci.c 2010-01-20 17:54:24 +0000
+++ hw/sh_pci.c 2010-06-11 20:46:30 +0000
@@ -47,10 +47,15 @@
47 pcic->par = val;47 pcic->par = val;
48 break;48 break;
49 case 0x1c4:49 case 0x1c4:
50 pcic->mbr = val;50 pcic->mbr = val & 0xff000001;
51 break;51 break;
52 case 0x1c8:52 case 0x1c8:
53 pcic->iobr = val;53 if ((val & 0xfffc0000) != (pcic->iobr & 0xfffc0000)) {
54 cpu_register_physical_memory(pcic->iobr & 0xfffc0000, 0x40000,
55 IO_MEM_UNASSIGNED);
56 pcic->iobr = val & 0xfffc0001;
57 isa_mmio_init(pcic->iobr & 0xfffc0000, 0x40000);
58 }
54 break;59 break;
55 case 0x220:60 case 0x220:
56 pci_data_write(pcic->bus, pcic->par, val, 4);61 pci_data_write(pcic->bus, pcic->par, val, 4);
@@ -66,89 +71,16 @@
66 return le32_to_cpup((uint32_t*)(pcic->dev->config + addr));71 return le32_to_cpup((uint32_t*)(pcic->dev->config + addr));
67 case 0x1c0:72 case 0x1c0:
68 return pcic->par;73 return pcic->par;
74 case 0x1c4:
75 return pcic->mbr;
76 case 0x1c8:
77 return pcic->iobr;
69 case 0x220:78 case 0x220:
70 return pci_data_read(pcic->bus, pcic->par, 4);79 return pci_data_read(pcic->bus, pcic->par, 4);
71 }80 }
72 return 0;81 return 0;
73}82}
7483
75static void sh_pci_data_write (SHPCIC *pcic, target_phys_addr_t addr,
76 uint32_t val, int size)
77{
78 pci_data_write(pcic->bus, addr + pcic->mbr, val, size);
79}
80
81static uint32_t sh_pci_mem_read (SHPCIC *pcic, target_phys_addr_t addr,
82 int size)
83{
84 return pci_data_read(pcic->bus, addr + pcic->mbr, size);
85}
86
87static void sh_pci_writeb (void *p, target_phys_addr_t addr, uint32_t val)
88{
89 sh_pci_data_write(p, addr, val, 1);
90}
91
92static void sh_pci_writew (void *p, target_phys_addr_t addr, uint32_t val)
93{
94 sh_pci_data_write(p, addr, val, 2);
95}
96
97static void sh_pci_writel (void *p, target_phys_addr_t addr, uint32_t val)
98{
99 sh_pci_data_write(p, addr, val, 4);
100}
101
102static uint32_t sh_pci_readb (void *p, target_phys_addr_t addr)
103{
104 return sh_pci_mem_read(p, addr, 1);
105}
106
107static uint32_t sh_pci_readw (void *p, target_phys_addr_t addr)
108{
109 return sh_pci_mem_read(p, addr, 2);
110}
111
112static uint32_t sh_pci_readl (void *p, target_phys_addr_t addr)
113{
114 return sh_pci_mem_read(p, addr, 4);
115}
116
117static int sh_pci_addr2port(SHPCIC *pcic, target_phys_addr_t addr)
118{
119 return addr + pcic->iobr;
120}
121
122static void sh_pci_outb (void *p, target_phys_addr_t addr, uint32_t val)
123{
124 cpu_outb(sh_pci_addr2port(p, addr), val);
125}
126
127static void sh_pci_outw (void *p, target_phys_addr_t addr, uint32_t val)
128{
129 cpu_outw(sh_pci_addr2port(p, addr), val);
130}
131
132static void sh_pci_outl (void *p, target_phys_addr_t addr, uint32_t val)
133{
134 cpu_outl(sh_pci_addr2port(p, addr), val);
135}
136
137static uint32_t sh_pci_inb (void *p, target_phys_addr_t addr)
138{
139 return cpu_inb(sh_pci_addr2port(p, addr));
140}
141
142static uint32_t sh_pci_inw (void *p, target_phys_addr_t addr)
143{
144 return cpu_inw(sh_pci_addr2port(p, addr));
145}
146
147static uint32_t sh_pci_inl (void *p, target_phys_addr_t addr)
148{
149 return cpu_inl(sh_pci_addr2port(p, addr));
150}
151
152typedef struct {84typedef struct {
153 CPUReadMemoryFunc * const r[3];85 CPUReadMemoryFunc * const r[3];
154 CPUWriteMemoryFunc * const w[3];86 CPUWriteMemoryFunc * const w[3];
@@ -159,21 +91,11 @@
159 { NULL, NULL, sh_pci_reg_write },91 { NULL, NULL, sh_pci_reg_write },
160};92};
16193
162static MemOp sh_pci_mem = {
163 { sh_pci_readb, sh_pci_readw, sh_pci_readl },
164 { sh_pci_writeb, sh_pci_writew, sh_pci_writel },
165};
166
167static MemOp sh_pci_iop = {
168 { sh_pci_inb, sh_pci_inw, sh_pci_inl },
169 { sh_pci_outb, sh_pci_outw, sh_pci_outl },
170};
171
172PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,94PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
173 void *opaque, int devfn_min, int nirq)95 void *opaque, int devfn_min, int nirq)
174{96{
175 SHPCIC *p;97 SHPCIC *p;
176 int mem, reg, iop;98 int reg;
17799
178 p = qemu_mallocz(sizeof(SHPCIC));100 p = qemu_mallocz(sizeof(SHPCIC));
179 p->bus = pci_register_bus(NULL, "pci",101 p->bus = pci_register_bus(NULL, "pci",
@@ -182,14 +104,11 @@
182 p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice),104 p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice),
183 -1, NULL, NULL);105 -1, NULL, NULL);
184 reg = cpu_register_io_memory(sh_pci_reg.r, sh_pci_reg.w, p);106 reg = cpu_register_io_memory(sh_pci_reg.r, sh_pci_reg.w, p);
185 iop = cpu_register_io_memory(sh_pci_iop.r, sh_pci_iop.w, p);
186 mem = cpu_register_io_memory(sh_pci_mem.r, sh_pci_mem.w, p);
187 cpu_register_physical_memory(0x1e200000, 0x224, reg);107 cpu_register_physical_memory(0x1e200000, 0x224, reg);
188 cpu_register_physical_memory(0x1e240000, 0x40000, iop);
189 cpu_register_physical_memory(0x1d000000, 0x1000000, mem);
190 cpu_register_physical_memory(0xfe200000, 0x224, reg);108 cpu_register_physical_memory(0xfe200000, 0x224, reg);
191 cpu_register_physical_memory(0xfe240000, 0x40000, iop);109
192 cpu_register_physical_memory(0xfd000000, 0x1000000, mem);110 p->iobr = 0xfe240000;
111 isa_mmio_init(p->iobr, 0x40000);
193112
194 pci_config_set_vendor_id(p->dev->config, PCI_VENDOR_ID_HITACHI);113 pci_config_set_vendor_id(p->dev->config, PCI_VENDOR_ID_HITACHI);
195 pci_config_set_device_id(p->dev->config, PCI_DEVICE_ID_HITACHI_SH7751R);114 pci_config_set_device_id(p->dev->config, PCI_DEVICE_ID_HITACHI_SH7751R);
196115
=== modified file 'hw/usb-uhci.c'
--- hw/usb-uhci.c 2010-01-20 17:54:24 +0000
+++ hw/usb-uhci.c 2010-06-11 20:46:30 +0000
@@ -677,9 +677,6 @@
677677
678 ret = async->packet.len;678 ret = async->packet.len;
679679
680 if (td->ctrl & TD_CTRL_IOC)
681 *int_mask |= 0x01;
682
683 if (td->ctrl & TD_CTRL_IOS)680 if (td->ctrl & TD_CTRL_IOS)
684 td->ctrl &= ~TD_CTRL_ACTIVE;681 td->ctrl &= ~TD_CTRL_ACTIVE;
685682
@@ -693,6 +690,8 @@
693 here. The docs are somewhat unclear, but win2k relies on this690 here. The docs are somewhat unclear, but win2k relies on this
694 behavior. */691 behavior. */
695 td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK);692 td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK);
693 if (td->ctrl & TD_CTRL_IOC)
694 *int_mask |= 0x01;
696695
697 if (pid == USB_TOKEN_IN) {696 if (pid == USB_TOKEN_IN) {
698 if (len > max_len) {697 if (len > max_len) {
@@ -750,6 +749,8 @@
750 if (err == 0) {749 if (err == 0) {
751 td->ctrl &= ~TD_CTRL_ACTIVE;750 td->ctrl &= ~TD_CTRL_ACTIVE;
752 s->status |= UHCI_STS_USBERR;751 s->status |= UHCI_STS_USBERR;
752 if (td->ctrl & TD_CTRL_IOC)
753 *int_mask |= 0x01;
753 uhci_update_irq(s);754 uhci_update_irq(s);
754 }755 }
755 }756 }
756757
=== modified file 'json-parser.c'
--- json-parser.c 2010-02-26 16:26:00 +0000
+++ json-parser.c 2010-06-11 20:46:30 +0000
@@ -266,7 +266,7 @@
266266
267 peek = qlist_peek(working);267 peek = qlist_peek(working);
268 key = parse_value(ctxt, &working, ap);268 key = parse_value(ctxt, &working, ap);
269 if (qobject_type(key) != QTYPE_QSTRING) {269 if (!key || qobject_type(key) != QTYPE_QSTRING) {
270 parse_error(ctxt, peek, "key is not a string in object");270 parse_error(ctxt, peek, "key is not a string in object");
271 goto out;271 goto out;
272 }272 }
273273
=== modified file 'linux-user/main.c'
--- linux-user/main.c 2010-01-20 17:54:24 +0000
+++ linux-user/main.c 2010-06-11 20:46:30 +0000
@@ -2684,7 +2684,7 @@
2684#endif2684#endif
2685#elif defined(TARGET_PPC)2685#elif defined(TARGET_PPC)
2686#ifdef TARGET_PPC642686#ifdef TARGET_PPC64
2687 cpu_model = "970";2687 cpu_model = "970fx";
2688#else2688#else
2689 cpu_model = "750";2689 cpu_model = "750";
2690#endif2690#endif
26912691
=== modified file 'net.c'
--- net.c 2010-02-26 16:26:00 +0000
+++ net.c 2010-06-11 20:46:30 +0000
@@ -1187,26 +1187,6 @@
1187 qemu_del_vlan_client(vc);1187 qemu_del_vlan_client(vc);
1188}1188}
11891189
1190void net_set_boot_mask(int net_boot_mask)
1191{
1192 int i;
1193
1194 /* Only the first four NICs may be bootable */
1195 net_boot_mask = net_boot_mask & 0xF;
1196
1197 for (i = 0; i < nb_nics; i++) {
1198 if (net_boot_mask & (1 << i)) {
1199 nd_table[i].bootable = 1;
1200 net_boot_mask &= ~(1 << i);
1201 }
1202 }
1203
1204 if (net_boot_mask) {
1205 fprintf(stderr, "Cannot boot from non-existent NIC\n");
1206 exit(1);
1207 }
1208}
1209
1210void do_info_network(Monitor *mon)1190void do_info_network(Monitor *mon)
1211{1191{
1212 VLANState *vlan;1192 VLANState *vlan;
12131193
=== modified file 'net.h'
--- net.h 2010-02-26 16:26:00 +0000
+++ net.h 2010-06-11 20:46:30 +0000
@@ -163,7 +163,6 @@
163int net_init_clients(void);163int net_init_clients(void);
164void net_check_clients(void);164void net_check_clients(void);
165void net_cleanup(void);165void net_cleanup(void);
166void net_set_boot_mask(int boot_mask);
167void net_host_device_add(Monitor *mon, const QDict *qdict);166void net_host_device_add(Monitor *mon, const QDict *qdict);
168void net_host_device_remove(Monitor *mon, const QDict *qdict);167void net_host_device_remove(Monitor *mon, const QDict *qdict);
169168
170169
=== modified file 'qemu-char.c'
--- qemu-char.c 2010-02-26 16:26:00 +0000
+++ qemu-char.c 2010-06-11 20:46:30 +0000
@@ -2317,8 +2317,7 @@
2317 qemu_opt_set(opts, "backend", "udp");2317 qemu_opt_set(opts, "backend", "udp");
2318 if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) {2318 if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) {
2319 host[0] = 0;2319 host[0] = 0;
2320 if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) {2320 if (sscanf(p, ":%32[^@,]%n", port, &pos) < 1) {
2321 fprintf(stderr, "udp #1\n");
2322 goto fail;2321 goto fail;
2323 }2322 }
2324 }2323 }
@@ -2329,7 +2328,6 @@
2329 if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) {2328 if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) {
2330 host[0] = 0;2329 host[0] = 0;
2331 if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) {2330 if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) {
2332 fprintf(stderr, "udp #2\n");
2333 goto fail;2331 goto fail;
2334 }2332 }
2335 }2333 }
@@ -2357,7 +2355,6 @@
2357 }2355 }
23582356
2359fail:2357fail:
2360 fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename);
2361 qemu_opts_del(opts);2358 qemu_opts_del(opts);
2362 return NULL;2359 return NULL;
2363}2360}
23642361
=== modified file 'qemu-common.h'
--- qemu-common.h 2010-02-26 16:26:00 +0000
+++ qemu-common.h 2010-06-11 20:46:30 +0000
@@ -54,6 +54,10 @@
54 void *iov_base;54 void *iov_base;
55 size_t iov_len;55 size_t iov_len;
56};56};
57/*
58 * Use the same value as Linux for now.
59 */
60#define IOV_MAX 1024
57#else61#else
58#include <sys/uio.h>62#include <sys/uio.h>
59#endif63#endif
6064
=== modified file 'qemu-kvm.c'
--- qemu-kvm.c 2010-02-26 16:26:00 +0000
+++ qemu-kvm.c 2010-06-11 20:46:30 +0000
@@ -444,7 +444,8 @@
444 r = kvm_vm_ioctl(kvm_state, KVM_CREATE_VCPU, id);444 r = kvm_vm_ioctl(kvm_state, KVM_CREATE_VCPU, id);
445 if (r < 0) {445 if (r < 0) {
446 fprintf(stderr, "kvm_create_vcpu: %m\n");446 fprintf(stderr, "kvm_create_vcpu: %m\n");
447 return;447 fprintf(stderr, "Failed to create vCPU. Check the -smp parameter.\n");
448 goto err;
448 }449 }
449450
450 env->kvm_fd = r;451 env->kvm_fd = r;
@@ -466,6 +467,9 @@
466 return;467 return;
467 err_fd:468 err_fd:
468 close(env->kvm_fd);469 close(env->kvm_fd);
470 err:
471 /* We're no good with semi-broken states. */
472 abort();
469}473}
470474
471static int kvm_set_boot_vcpu_id(kvm_context_t kvm, uint32_t id)475static int kvm_set_boot_vcpu_id(kvm_context_t kvm, uint32_t id)
472476
=== modified file 'qemu-options.hx'
--- qemu-options.hx 2010-02-26 16:26:00 +0000
+++ qemu-options.hx 2010-06-11 20:46:30 +0000
@@ -969,7 +969,7 @@
969969
970@example970@example
971# on the host971# on the host
972qemu -net user,hostfwd=tcp:5555::23 [...]972qemu -net user,hostfwd=tcp::5555-:23 [...]
973telnet localhost 5555973telnet localhost 5555
974@end example974@end example
975975
976976
=== modified file 'target-i386/translate.c'
--- target-i386/translate.c 2010-01-21 16:22:13 +0000
+++ target-i386/translate.c 2010-06-11 20:46:30 +0000
@@ -2047,8 +2047,8 @@
2047 gen_op_movl_A0_im(disp);2047 gen_op_movl_A0_im(disp);
2048 }2048 }
2049 }2049 }
2050 /* XXX: index == 4 is always invalid */2050 /* index == 4 means no index */
2051 if (havesib && (index != 4 || scale != 0)) {2051 if (havesib && (index != 4)) {
2052#ifdef TARGET_X86_642052#ifdef TARGET_X86_64
2053 if (s->aflag == 2) {2053 if (s->aflag == 2) {
2054 gen_op_addq_A0_reg_sN(scale, index);2054 gen_op_addq_A0_reg_sN(scale, index);
@@ -3165,11 +3165,16 @@
3165 case 0x1e7: /* movntdq */3165 case 0x1e7: /* movntdq */
3166 case 0x02b: /* movntps */3166 case 0x02b: /* movntps */
3167 case 0x12b: /* movntps */3167 case 0x12b: /* movntps */
3168 if (mod == 3)
3169 goto illegal_op;
3170 gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
3171 gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));
3172 break;
3168 case 0x3f0: /* lddqu */3173 case 0x3f0: /* lddqu */
3169 if (mod == 3)3174 if (mod == 3)
3170 goto illegal_op;3175 goto illegal_op;
3171 gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);3176 gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
3172 gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));3177 gen_ldo_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));
3173 break;3178 break;
3174 case 0x22b: /* movntss */3179 case 0x22b: /* movntss */
3175 case 0x32b: /* movntsd */3180 case 0x32b: /* movntsd */
@@ -4591,9 +4596,7 @@
4591 /* operand size for jumps is 64 bit */4596 /* operand size for jumps is 64 bit */
4592 ot = OT_QUAD;4597 ot = OT_QUAD;
4593 } else if (op == 3 || op == 5) {4598 } else if (op == 3 || op == 5) {
4594 /* for call calls, the operand is 16 or 32 bit, even4599 ot = dflag ? OT_LONG + (rex_w == 1) : OT_WORD;
4595 in long mode */
4596 ot = dflag ? OT_LONG : OT_WORD;
4597 } else if (op == 6) {4600 } else if (op == 6) {
4598 /* default push size is 64 bit */4601 /* default push size is 64 bit */
4599 ot = dflag ? OT_QUAD : OT_WORD;4602 ot = dflag ? OT_QUAD : OT_WORD;
46004603
=== modified file 'target-sh4/cpu.h'
--- target-sh4/cpu.h 2010-01-20 17:54:24 +0000
+++ target-sh4/cpu.h 2010-06-11 20:46:30 +0000
@@ -167,6 +167,7 @@
167void do_interrupt(CPUSH4State * env);167void do_interrupt(CPUSH4State * env);
168168
169void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));169void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
170void cpu_sh4_invalidate_tlb(CPUSH4State *s);
170void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr,171void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr,
171 uint32_t mem_value);172 uint32_t mem_value);
172173
@@ -222,6 +223,7 @@
222/* MMU control register */223/* MMU control register */
223#define MMUCR 0x1F000010224#define MMUCR 0x1F000010
224#define MMUCR_AT (1<<0)225#define MMUCR_AT (1<<0)
226#define MMUCR_TI (1<<2)
225#define MMUCR_SV (1<<8)227#define MMUCR_SV (1<<8)
226#define MMUCR_URC_BITS (6)228#define MMUCR_URC_BITS (6)
227#define MMUCR_URC_OFFSET (10)229#define MMUCR_URC_OFFSET (10)
228230
=== modified file 'target-sh4/helper.c'
--- target-sh4/helper.c 2009-08-04 12:36:50 +0000
+++ target-sh4/helper.c 2010-06-11 20:46:30 +0000
@@ -377,7 +377,7 @@
377 n = find_itlb_entry(env, address, use_asid, 1);377 n = find_itlb_entry(env, address, use_asid, 1);
378 if (n >= 0) {378 if (n >= 0) {
379 matching = &env->itlb[n];379 matching = &env->itlb[n];
380 if ((env->sr & SR_MD) & !(matching->pr & 2))380 if (!(env->sr & SR_MD) && !(matching->pr & 2))
381 n = MMU_ITLB_VIOLATION;381 n = MMU_ITLB_VIOLATION;
382 else382 else
383 *prot = PAGE_READ;383 *prot = PAGE_READ;
@@ -430,7 +430,7 @@
430 if ((address >= 0x80000000 && address < 0xc0000000) ||430 if ((address >= 0x80000000 && address < 0xc0000000) ||
431 address >= 0xe0000000) {431 address >= 0xe0000000) {
432 if (!(env->sr & SR_MD)432 if (!(env->sr & SR_MD)
433 && (address < 0xe0000000 || address > 0xe4000000)) {433 && (address < 0xe0000000 || address >= 0xe4000000)) {
434 /* Unauthorized access in user mode (only store queues are available) */434 /* Unauthorized access in user mode (only store queues are available) */
435 fprintf(stderr, "Unauthorized access\n");435 fprintf(stderr, "Unauthorized access\n");
436 if (rw == 0)436 if (rw == 0)
@@ -574,6 +574,24 @@
574 entry->tc = (uint8_t)cpu_ptea_tc(env->ptea);574 entry->tc = (uint8_t)cpu_ptea_tc(env->ptea);
575}575}
576576
577 void cpu_sh4_invalidate_tlb(CPUSH4State *s)
578{
579 int i;
580
581 /* UTLB */
582 for (i = 0; i < UTLB_SIZE; i++) {
583 tlb_t * entry = &s->utlb[i];
584 entry->v = 0;
585 }
586 /* ITLB */
587 for (i = 0; i < UTLB_SIZE; i++) {
588 tlb_t * entry = &s->utlb[i];
589 entry->v = 0;
590 }
591
592 tlb_flush(s, 1);
593}
594
577void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr,595void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr,
578 uint32_t mem_value)596 uint32_t mem_value)
579{597{
580598
=== modified file 'target-sh4/translate.c'
--- target-sh4/translate.c 2010-01-20 17:54:24 +0000
+++ target-sh4/translate.c 2010-06-11 20:46:30 +0000
@@ -1905,7 +1905,7 @@
1905 ctx.bstate = BS_NONE;1905 ctx.bstate = BS_NONE;
1906 ctx.sr = env->sr;1906 ctx.sr = env->sr;
1907 ctx.fpscr = env->fpscr;1907 ctx.fpscr = env->fpscr;
1908 ctx.memidx = (env->sr & SR_MD) ? 1 : 0;1908 ctx.memidx = (env->sr & SR_MD) == 0 ? 1 : 0;
1909 /* We don't know if the delayed pc came from a dynamic or static branch,1909 /* We don't know if the delayed pc came from a dynamic or static branch,
1910 so assume it is a dynamic branch. */1910 so assume it is a dynamic branch. */
1911 ctx.delayed_pc = -1; /* use delayed pc from env pointer */1911 ctx.delayed_pc = -1; /* use delayed pc from env pointer */
19121912
=== modified file 'tcg/arm/tcg-target.c'
--- tcg/arm/tcg-target.c 2010-01-20 17:54:24 +0000
+++ tcg/arm/tcg-target.c 2010-06-11 20:46:30 +0000
@@ -1697,12 +1697,15 @@
16971697
1698void tcg_target_qemu_prologue(TCGContext *s)1698void tcg_target_qemu_prologue(TCGContext *s)
1699{1699{
1700 /* stmdb sp!, { r9 - r11, lr } */1700 /* Theoretically there is no need to save r12, but an
1701 tcg_out32(s, (COND_AL << 28) | 0x092d4e00);1701 even number of registers to be saved as per EABI */
1702
1703 /* stmdb sp!, { r4 - r12, lr } */
1704 tcg_out32(s, (COND_AL << 28) | 0x092d5ff0);
17021705
1703 tcg_out_bx(s, COND_AL, TCG_REG_R0);1706 tcg_out_bx(s, COND_AL, TCG_REG_R0);
1704 tb_ret_addr = s->code_ptr;1707 tb_ret_addr = s->code_ptr;
17051708
1706 /* ldmia sp!, { r9 - r11, pc } */1709 /* ldmia sp!, { r4 - r12, pc } */
1707 tcg_out32(s, (COND_AL << 28) | 0x08bd8e00);1710 tcg_out32(s, (COND_AL << 28) | 0x08bd9ff0);
1708}1711}
17091712
=== modified file 'tcg/mips/tcg-target.c'
--- tcg/mips/tcg-target.c 2010-02-26 16:26:00 +0000
+++ tcg/mips/tcg-target.c 2010-06-11 20:46:30 +0000
@@ -340,6 +340,17 @@
340}340}
341341
342/*342/*
343 * Type branch
344 */
345static inline void tcg_out_opc_br(TCGContext *s, int opc, int rt, int rs)
346{
347 /* We need to keep the offset unchanged for retranslation */
348 uint16_t offset = (uint16_t)(*(uint32_t *) &s->code_ptr);
349
350 tcg_out_opc_imm(s, opc, rt, rs, offset);
351}
352
353/*
343 * Type sa354 * Type sa
344 */355 */
345static inline void tcg_out_opc_sa(TCGContext *s, int opc, int rd, int rt, int sa)356static inline void tcg_out_opc_sa(TCGContext *s, int opc, int rd, int rt, int sa)
@@ -469,42 +480,42 @@
469480
470 switch (cond) {481 switch (cond) {
471 case TCG_COND_EQ:482 case TCG_COND_EQ:
472 tcg_out_opc_imm(s, OPC_BEQ, arg1, arg2, 0);483 tcg_out_opc_br(s, OPC_BEQ, arg1, arg2);
473 break;484 break;
474 case TCG_COND_NE:485 case TCG_COND_NE:
475 tcg_out_opc_imm(s, OPC_BNE, arg1, arg2, 0);486 tcg_out_opc_br(s, OPC_BNE, arg1, arg2);
476 break;487 break;
477 case TCG_COND_LT:488 case TCG_COND_LT:
478 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg1, arg2);489 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg1, arg2);
479 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO, 0);490 tcg_out_opc_br(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO);
480 break;491 break;
481 case TCG_COND_LTU:492 case TCG_COND_LTU:
482 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg1, arg2);493 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg1, arg2);
483 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO, 0);494 tcg_out_opc_br(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO);
484 break;495 break;
485 case TCG_COND_GE:496 case TCG_COND_GE:
486 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg1, arg2);497 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg1, arg2);
487 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO, 0);498 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO);
488 break;499 break;
489 case TCG_COND_GEU:500 case TCG_COND_GEU:
490 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg1, arg2);501 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg1, arg2);
491 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO, 0);502 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO);
492 break;503 break;
493 case TCG_COND_LE:504 case TCG_COND_LE:
494 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg2, arg1);505 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg2, arg1);
495 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO, 0);506 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO);
496 break;507 break;
497 case TCG_COND_LEU:508 case TCG_COND_LEU:
498 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg2, arg1);509 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg2, arg1);
499 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO, 0);510 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_AT, TCG_REG_ZERO);
500 break;511 break;
501 case TCG_COND_GT:512 case TCG_COND_GT:
502 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg2, arg1);513 tcg_out_opc_reg(s, OPC_SLT, TCG_REG_AT, arg2, arg1);
503 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO, 0);514 tcg_out_opc_br(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO);
504 break;515 break;
505 case TCG_COND_GTU:516 case TCG_COND_GTU:
506 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg2, arg1);517 tcg_out_opc_reg(s, OPC_SLTU, TCG_REG_AT, arg2, arg1);
507 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO, 0);518 tcg_out_opc_br(s, OPC_BNE, TCG_REG_AT, TCG_REG_ZERO);
508 break;519 break;
509 default:520 default:
510 tcg_abort();521 tcg_abort();
@@ -553,7 +564,7 @@
553 }564 }
554565
555 label_ptr = s->code_ptr;566 label_ptr = s->code_ptr;
556 tcg_out_opc_imm(s, OPC_BNE, arg2, arg4, 0);567 tcg_out_opc_br(s, OPC_BNE, arg2, arg4);
557 tcg_out_nop(s);568 tcg_out_nop(s);
558569
559 switch(cond) {570 switch(cond) {
@@ -670,20 +681,20 @@
670681
671# if TARGET_LONG_BITS == 64682# if TARGET_LONG_BITS == 64
672 label3_ptr = s->code_ptr;683 label3_ptr = s->code_ptr;
673 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_T0, TCG_REG_AT, 0);684 tcg_out_opc_br(s, OPC_BNE, TCG_REG_T0, TCG_REG_AT);
674 tcg_out_nop(s);685 tcg_out_nop(s);
675686
676 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0,687 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0,
677 offsetof(CPUState, tlb_table[mem_index][0].addr_read) + addr_memh);688 offsetof(CPUState, tlb_table[mem_index][0].addr_read) + addr_memh);
678689
679 label1_ptr = s->code_ptr;690 label1_ptr = s->code_ptr;
680 tcg_out_opc_imm(s, OPC_BEQ, addr_regh, TCG_REG_AT, 0);691 tcg_out_opc_br(s, OPC_BEQ, addr_regh, TCG_REG_AT);
681 tcg_out_nop(s);692 tcg_out_nop(s);
682693
683 reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr);694 reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr);
684# else695# else
685 label1_ptr = s->code_ptr;696 label1_ptr = s->code_ptr;
686 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_T0, TCG_REG_AT, 0);697 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_T0, TCG_REG_AT);
687 tcg_out_nop(s);698 tcg_out_nop(s);
688# endif699# endif
689700
@@ -725,7 +736,7 @@
725 }736 }
726737
727 label2_ptr = s->code_ptr;738 label2_ptr = s->code_ptr;
728 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_ZERO, TCG_REG_ZERO, 0);739 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_ZERO, TCG_REG_ZERO);
729 tcg_out_nop(s);740 tcg_out_nop(s);
730741
731 /* label1: fast path */742 /* label1: fast path */
@@ -857,20 +868,20 @@
857868
858# if TARGET_LONG_BITS == 64869# if TARGET_LONG_BITS == 64
859 label3_ptr = s->code_ptr;870 label3_ptr = s->code_ptr;
860 tcg_out_opc_imm(s, OPC_BNE, TCG_REG_T0, TCG_REG_AT, 0);871 tcg_out_opc_br(s, OPC_BNE, TCG_REG_T0, TCG_REG_AT);
861 tcg_out_nop(s);872 tcg_out_nop(s);
862873
863 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0,874 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0,
864 offsetof(CPUState, tlb_table[mem_index][0].addr_write) + addr_memh);875 offsetof(CPUState, tlb_table[mem_index][0].addr_write) + addr_memh);
865876
866 label1_ptr = s->code_ptr;877 label1_ptr = s->code_ptr;
867 tcg_out_opc_imm(s, OPC_BEQ, addr_regh, TCG_REG_AT, 0);878 tcg_out_opc_br(s, OPC_BEQ, addr_regh, TCG_REG_AT);
868 tcg_out_nop(s);879 tcg_out_nop(s);
869880
870 reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr);881 reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr);
871# else882# else
872 label1_ptr = s->code_ptr;883 label1_ptr = s->code_ptr;
873 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_T0, TCG_REG_AT, 0);884 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_T0, TCG_REG_AT);
874 tcg_out_nop(s);885 tcg_out_nop(s);
875# endif886# endif
876887
@@ -911,7 +922,7 @@
911 tcg_out_nop(s);922 tcg_out_nop(s);
912923
913 label2_ptr = s->code_ptr;924 label2_ptr = s->code_ptr;
914 tcg_out_opc_imm(s, OPC_BEQ, TCG_REG_ZERO, TCG_REG_ZERO, 0);925 tcg_out_opc_br(s, OPC_BEQ, TCG_REG_ZERO, TCG_REG_ZERO);
915 tcg_out_nop(s);926 tcg_out_nop(s);
916927
917 /* label1: fast path */928 /* label1: fast path */
@@ -1262,7 +1273,9 @@
1262};1273};
12631274
1264static int tcg_target_callee_save_regs[] = {1275static int tcg_target_callee_save_regs[] = {
1276#if 0 /* used for the global env (TCG_AREG0), so no need to save */
1265 TCG_REG_S0,1277 TCG_REG_S0,
1278#endif
1266 TCG_REG_S1,1279 TCG_REG_S1,
1267 TCG_REG_S2,1280 TCG_REG_S2,
1268 TCG_REG_S3,1281 TCG_REG_S3,
@@ -1271,8 +1284,7 @@
1271 TCG_REG_S6,1284 TCG_REG_S6,
1272 TCG_REG_S7,1285 TCG_REG_S7,
1273 TCG_REG_GP,1286 TCG_REG_GP,
1274 /* TCG_REG_FP, */ /* currently used for the global env, so np1287 TCG_REG_FP,
1275 need to save */
1276 TCG_REG_RA, /* should be last for ABI compliance */1288 TCG_REG_RA, /* should be last for ABI compliance */
1277};1289};
12781290
12791291
=== modified file 'tcg/mips/tcg-target.h'
--- tcg/mips/tcg-target.h 2010-01-20 17:54:24 +0000
+++ tcg/mips/tcg-target.h 2010-06-11 20:46:30 +0000
@@ -92,9 +92,9 @@
92#undef TCG_TARGET_HAS_ext16u_i32 /* andi rt, rs, 0xffff */92#undef TCG_TARGET_HAS_ext16u_i32 /* andi rt, rs, 0xffff */
9393
94/* Note: must be synced with dyngen-exec.h */94/* Note: must be synced with dyngen-exec.h */
95#define TCG_AREG0 TCG_REG_FP95#define TCG_AREG0 TCG_REG_S0
96#define TCG_AREG1 TCG_REG_S096#define TCG_AREG1 TCG_REG_S1
97#define TCG_AREG2 TCG_REG_S197#define TCG_AREG2 TCG_REG_FP
9898
99#include <sys/cachectl.h>99#include <sys/cachectl.h>
100100
101101
=== modified file 'vl.c'
--- vl.c 2010-02-26 16:26:00 +0000
+++ vl.c 2010-06-11 20:46:30 +0000
@@ -2597,9 +2597,9 @@
2597 fprintf(stderr,2597 fprintf(stderr,
2598 "only 63 CPUs in NUMA mode supported.\n");2598 "only 63 CPUs in NUMA mode supported.\n");
2599 }2599 }
2600 value = (1 << (endvalue + 1)) - (1 << value);2600 value = (2ULL << endvalue) - (1ULL << value);
2601 } else {2601 } else {
2602 value = 1 << value;2602 value = 1ULL << value;
2603 }2603 }
2604 }2604 }
2605 node_cpumask[nodenr] = value;2605 node_cpumask[nodenr] = value;
@@ -3515,6 +3515,8 @@
3515 return 0;3515 return 0;
3516 if (env->stopped)3516 if (env->stopped)
3517 return 0;3517 return 0;
3518 if (!vm_running)
3519 return 0;
3518 return 1;3520 return 1;
3519}3521}
35203522
@@ -4909,7 +4911,7 @@
4909 const char *gdbstub_dev = NULL;4911 const char *gdbstub_dev = NULL;
4910 uint32_t boot_devices_bitmap = 0;4912 uint32_t boot_devices_bitmap = 0;
4911 int i;4913 int i;
4912 int snapshot, linux_boot, net_boot;4914 int snapshot, linux_boot;
4913 const char *initrd_filename;4915 const char *initrd_filename;
4914 const char *kernel_filename, *kernel_cmdline;4916 const char *kernel_filename, *kernel_cmdline;
4915 char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */4917 char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
@@ -5428,6 +5430,9 @@
5428 case QEMU_OPTION_serial:5430 case QEMU_OPTION_serial:
5429 add_device_config(DEV_SERIAL, optarg);5431 add_device_config(DEV_SERIAL, optarg);
5430 default_serial = 0;5432 default_serial = 0;
5433 if (strncmp(optarg, "mon:", 4) == 0) {
5434 default_monitor = 0;
5435 }
5431 break;5436 break;
5432 case QEMU_OPTION_watchdog:5437 case QEMU_OPTION_watchdog:
5433 if (watchdog) {5438 if (watchdog) {
@@ -5446,10 +5451,16 @@
5446 case QEMU_OPTION_virtiocon:5451 case QEMU_OPTION_virtiocon:
5447 add_device_config(DEV_VIRTCON, optarg);5452 add_device_config(DEV_VIRTCON, optarg);
5448 default_virtcon = 0;5453 default_virtcon = 0;
5454 if (strncmp(optarg, "mon:", 4) == 0) {
5455 default_monitor = 0;
5456 }
5449 break;5457 break;
5450 case QEMU_OPTION_parallel:5458 case QEMU_OPTION_parallel:
5451 add_device_config(DEV_PARALLEL, optarg);5459 add_device_config(DEV_PARALLEL, optarg);
5452 default_parallel = 0;5460 default_parallel = 0;
5461 if (strncmp(optarg, "mon:", 4) == 0) {
5462 default_monitor = 0;
5463 }
5453 break;5464 break;
5454 case QEMU_OPTION_loadvm:5465 case QEMU_OPTION_loadvm:
5455 loadvm = optarg;5466 loadvm = optarg;
@@ -5905,6 +5916,12 @@
5905 fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");5916 fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
5906 kvm_allowed = 0;5917 kvm_allowed = 0;
5907 }5918 }
5919 } else {
5920 /* without kvm enabled, we can only support 4095 MB RAM */
5921 if (ram_size > (4095UL << 20)) {
5922 fprintf(stderr, "qemu: without kvm support at most 4095 MB RAM can be simulated\n");
5923 exit(1);
5924 }
5908 }5925 }
59095926
5910 if (qemu_init_main_loop()) {5927 if (qemu_init_main_loop()) {
@@ -5948,9 +5965,6 @@
5948 exit(1);5965 exit(1);
5949 }5966 }
59505967
5951 net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF;
5952 net_set_boot_mask(net_boot);
5953
5954 /* init the bluetooth world */5968 /* init the bluetooth world */
5955 if (foreach_device_config(DEV_BT, bt_parse))5969 if (foreach_device_config(DEV_BT, bt_parse))
5956 exit(1);5970 exit(1);
59575971
=== modified file 'vnc.c'
--- vnc.c 2010-02-26 16:26:00 +0000
+++ vnc.c 2010-06-11 20:46:30 +0000
@@ -1421,8 +1421,10 @@
1421 dz = 1;1421 dz = 1;
14221422
1423 if (vs->absolute) {1423 if (vs->absolute) {
1424 kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1),1424 kbd_mouse_event(ds_get_width(vs->ds) > 1 ?
1425 y * 0x7FFF / (ds_get_height(vs->ds) - 1),1425 x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000,
1426 ds_get_height(vs->ds) > 1 ?
1427 y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000,
1426 dz, buttons);1428 dz, buttons);
1427 } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {1429 } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {
1428 x -= 0x7FFF;1430 x -= 0x7FFF;

Subscribers

People subscribed via source and target branches