Merge lp:~serge-hallyn/ubuntu/maverick/qemu-kvm/update-to-12.4 into lp:ubuntu/maverick/qemu-kvm
- Maverick (10.10)
- update-to-12.4
- Merge into maverick
Status: | Merged |
---|---|
Merged at revision: | 77 |
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dustin Kirkland | Approve | ||
Mathias Gug | Pending | ||
Ubuntu branches | Pending | ||
Review via email: mp+27640@code.launchpad.net |
This proposal supersedes a proposal from 2010-06-10.
Commit message
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.
Mathias Gug (mathiaz) wrote : Posted in a previous version of this proposal | # |
Serge Hallyn (serge-hallyn) wrote : Posted in a previous version of this proposal | # |
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+
>
> There should only be one changelog entry with the revision set to 0.12.4+
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
Dustin Kirkland (kirkland) wrote : | # |
Thanks Serge. One very minor comment:
* debian/changelog: "LP#427612" must be "LP: #427612"; note the colon-space
Otherwise, approved. Uploading now.
Preview Diff
1 | === modified file 'Changelog' | |||
2 | --- Changelog 2010-02-26 16:26:00 +0000 | |||
3 | +++ Changelog 2010-06-15 15:07:26 +0000 | |||
4 | @@ -1,3 +1,53 @@ | |||
5 | 1 | version 0.12.4 | ||
6 | 2 | - Workaround for broken OSS_GETVERSION on FreeBSD, part two (Juergen Lock) | ||
7 | 3 | - oss: fix fragment setting (malc) | ||
8 | 4 | - oss: issue OSS_GETVERSION ioctl only when needed (malc) | ||
9 | 5 | - oss: refactor code around policy setting (malc) | ||
10 | 6 | - oss: workaround for cases when OSS_GETVERSION is not defined (malc) | ||
11 | 7 | - block: Free iovec arrays allocated by multiwrite_merge() (Stefan Hajnoczi) | ||
12 | 8 | - lsi: fix segfault in lsi_command_complete (Gerd Hoffmann) | ||
13 | 9 | - lsi: pass lsi_request to lsi_reselect (Gerd Hoffmann) | ||
14 | 10 | - lsi: move dma_len+dma_buf into lsi_request (Gerd Hoffmann) | ||
15 | 11 | - lsi: move current_dev into lsi_request (Gerd Hoffmann) | ||
16 | 12 | - lsi: have lsi_request for the whole life time of the request. (Gerd Hoffmann) | ||
17 | 13 | - lsi: use QTAILQ for lsi_queue (Gerd Hoffmann) | ||
18 | 14 | - tcp/mips: Change TCG_AREG0 (fp -> s0) (Stefan Weil) | ||
19 | 15 | - sh_pci: fix memory and I/O access (Aurelien Jarno) | ||
20 | 16 | - Fix incoming migration with iothread (Marcelo Tosatti) | ||
21 | 17 | - Fix SIGFPE for vnc display of width/height = 1 (Chris Webb) | ||
22 | 18 | - net: remove broken net_set_boot_mask() boot device validation (Eduardo Habkost) | ||
23 | 19 | - qcow2: Remove request from in-flight list after error (Kevin Wolf) | ||
24 | 20 | - qcow2: Don't ignore immediate read/write failures (Kevin Wolf) | ||
25 | 21 | - block: Fix multiwrite memory leak in error case (Kevin Wolf) | ||
26 | 22 | - block: Fix error code in multiwrite for immediate failures (Kevin Wolf) | ||
27 | 23 | - block: Fix multiwrite error handling (Kevin Wolf) | ||
28 | 24 | - scsi-disk: fix buffer overflow (Gerd Hoffmann) | ||
29 | 25 | - qcow2: Rewrite alloc_refcount_block/grow_refcount_table (Kevin Wolf) | ||
30 | 26 | - qcow2: Factor next_refcount_table_size out (Kevin Wolf) | ||
31 | 27 | - block: avoid creating too large iovecs in multiwrite_merge (Christoph Hellwig) | ||
32 | 28 | - json-parser: Fix segfault on malformed input (Kevin Wolf) | ||
33 | 29 | - linux-user: switch default ppc64 CPU to 970fx from 970 (Aurelien Jarno) | ||
34 | 30 | - target-sh4: MMU: fix store queue addresses (Aurelien Jarno) | ||
35 | 31 | - target-sh4: MMU: fix ITLB priviledge check (Aurelien Jarno) | ||
36 | 32 | - target-sh4: MMU: fix mem_idx computation (Aurelien Jarno) | ||
37 | 33 | - sh7750: handle MMUCR TI bit (Aurelien Jarno) | ||
38 | 34 | - UHCI spurious interrut fix (Paul Brook) | ||
39 | 35 | - tcg/mips: fix branch offset during retranslation (Aurelien Jarno) | ||
40 | 36 | - tcg/arm: correctly save/restore registers in prologue/epilogue (Aurelien Jarno) | ||
41 | 37 | - workaround for cmd646 bmdma register access while no dma is active (Igor V. Kovalenko) | ||
42 | 38 | - Fix corner case in chardev udp: parameter (Jan Kiszka) | ||
43 | 39 | - Don't set default monitor when there is a mux'ed one (Jan Kiszka) | ||
44 | 40 | - spelling typo (compatibilty) in hw/fw_cfg.c (Vagrant Cascadian) | ||
45 | 41 | - fdc: fix drive property handling. (Gerd Hoffmann) | ||
46 | 42 | - target-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957 (TeLeMan) | ||
47 | 43 | - target-i386: fix SIB decoding with index = 4 (Aurelien Jarno) | ||
48 | 44 | - Fix segfault with ram_size > 4095M without kvm (Ryan Harper) | ||
49 | 45 | - target-i386: Fix long jumps/calls in long mode with REX.W set (malc) | ||
50 | 46 | - target-i386: fix lddqu SSE instruction (Aurelien Jarno) | ||
51 | 47 | - qemu-char.c: drop debug printfs from qemu_chr_parse_compat (Jan Kiszka) | ||
52 | 48 | - fix undefined shifts by >32 (Paolo Bonzini) | ||
53 | 49 | - Fix qemu -net user,hostfwd= example (Aurelien Jarno) | ||
54 | 50 | |||
55 | 1 | version 0.12.3 | 51 | version 0.12.3 |
56 | 2 | - kvm: Fix eflags corruption in kvm mode (Jan Kiszka) | 52 | - kvm: Fix eflags corruption in kvm mode (Jan Kiszka) |
57 | 3 | - qcow2: Fix access after end of array (Kevin Wolf) | 53 | - qcow2: Fix access after end of array (Kevin Wolf) |
58 | 4 | 54 | ||
59 | === modified file 'KVM_VERSION' | |||
60 | --- KVM_VERSION 2010-02-26 16:26:00 +0000 | |||
61 | +++ KVM_VERSION 2010-06-15 15:07:26 +0000 | |||
62 | @@ -1,1 +1,1 @@ | |||
64 | 1 | qemu-kvm-0.12.3 | 1 | qemu-kvm-0.12.4 |
65 | 2 | 2 | ||
66 | === modified file 'VERSION' | |||
67 | --- VERSION 2010-02-26 16:26:00 +0000 | |||
68 | +++ VERSION 2010-06-15 15:07:26 +0000 | |||
69 | @@ -1,1 +1,1 @@ | |||
71 | 1 | 0.12.3 | 1 | 0.12.4 |
72 | 2 | 2 | ||
73 | === modified file 'audio/ossaudio.c' | |||
74 | --- audio/ossaudio.c 2010-01-20 17:54:24 +0000 | |||
75 | +++ audio/ossaudio.c 2010-06-15 15:07:26 +0000 | |||
76 | @@ -38,6 +38,10 @@ | |||
77 | 38 | #define AUDIO_CAP "oss" | 38 | #define AUDIO_CAP "oss" |
78 | 39 | #include "audio_int.h" | 39 | #include "audio_int.h" |
79 | 40 | 40 | ||
80 | 41 | #if defined OSS_GETVERSION && defined SNDCTL_DSP_POLICY | ||
81 | 42 | #define USE_DSP_POLICY | ||
82 | 43 | #endif | ||
83 | 44 | |||
84 | 41 | typedef struct OSSVoiceOut { | 45 | typedef struct OSSVoiceOut { |
85 | 42 | HWVoiceOut hw; | 46 | HWVoiceOut hw; |
86 | 43 | void *pcm_buf; | 47 | void *pcm_buf; |
87 | @@ -236,14 +240,39 @@ | |||
88 | 236 | } | 240 | } |
89 | 237 | #endif | 241 | #endif |
90 | 238 | 242 | ||
91 | 243 | #ifdef USE_DSP_POLICY | ||
92 | 244 | static int oss_get_version (int fd, int *version, const char *typ) | ||
93 | 245 | { | ||
94 | 246 | if (ioctl (fd, OSS_GETVERSION, &version)) { | ||
95 | 247 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | ||
96 | 248 | /* | ||
97 | 249 | * Looks like atm (20100109) FreeBSD knows OSS_GETVERSION | ||
98 | 250 | * since 7.x, but currently only on the mixer device (or in | ||
99 | 251 | * the Linuxolator), and in the native version that part of | ||
100 | 252 | * the code is in fact never reached so the ioctl fails anyway. | ||
101 | 253 | * Until this is fixed, just check the errno and if its what | ||
102 | 254 | * FreeBSD's sound drivers return atm assume they are new enough. | ||
103 | 255 | */ | ||
104 | 256 | if (errno == EINVAL) { | ||
105 | 257 | *version = 0x040000; | ||
106 | 258 | return 0; | ||
107 | 259 | } | ||
108 | 260 | #endif | ||
109 | 261 | oss_logerr2 (errno, typ, "Failed to get OSS version\n"); | ||
110 | 262 | return -1; | ||
111 | 263 | } | ||
112 | 264 | return 0; | ||
113 | 265 | } | ||
114 | 266 | #endif | ||
115 | 267 | |||
116 | 239 | static int oss_open (int in, struct oss_params *req, | 268 | static int oss_open (int in, struct oss_params *req, |
117 | 240 | struct oss_params *obt, int *pfd) | 269 | struct oss_params *obt, int *pfd) |
118 | 241 | { | 270 | { |
119 | 242 | int fd; | 271 | int fd; |
120 | 243 | int version; | ||
121 | 244 | int oflags = conf.exclusive ? O_EXCL : 0; | 272 | int oflags = conf.exclusive ? O_EXCL : 0; |
122 | 245 | audio_buf_info abinfo; | 273 | audio_buf_info abinfo; |
123 | 246 | int fmt, freq, nchannels; | 274 | int fmt, freq, nchannels; |
124 | 275 | int setfragment = 1; | ||
125 | 247 | const char *dspname = in ? conf.devpath_in : conf.devpath_out; | 276 | const char *dspname = in ? conf.devpath_in : conf.devpath_out; |
126 | 248 | const char *typ = in ? "ADC" : "DAC"; | 277 | const char *typ = in ? "ADC" : "DAC"; |
127 | 249 | 278 | ||
128 | @@ -281,27 +310,30 @@ | |||
129 | 281 | goto err; | 310 | goto err; |
130 | 282 | } | 311 | } |
131 | 283 | 312 | ||
148 | 284 | if (ioctl (fd, OSS_GETVERSION, &version)) { | 313 | #ifdef USE_DSP_POLICY |
149 | 285 | oss_logerr2 (errno, typ, "Failed to get OSS version\n"); | 314 | if (conf.policy >= 0) { |
150 | 286 | version = 0; | 315 | int version; |
151 | 287 | } | 316 | |
152 | 288 | 317 | if (!oss_get_version (fd, &version, typ)) { | |
153 | 289 | if (conf.debug) { | 318 | if (conf.debug) { |
154 | 290 | dolog ("OSS version = %#x\n", version); | 319 | dolog ("OSS version = %#x\n", version); |
155 | 291 | } | 320 | } |
156 | 292 | 321 | ||
157 | 293 | #ifdef SNDCTL_DSP_POLICY | 322 | if (version >= 0x040000) { |
158 | 294 | if (conf.policy >= 0 && version >= 0x040000) { | 323 | int policy = conf.policy; |
159 | 295 | int policy = conf.policy; | 324 | if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) { |
160 | 296 | if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) { | 325 | oss_logerr2 (errno, typ, |
161 | 297 | oss_logerr2 (errno, typ, "Failed to set timing policy to %d\n", | 326 | "Failed to set timing policy to %d\n", |
162 | 298 | conf.policy); | 327 | conf.policy); |
163 | 299 | goto err; | 328 | goto err; |
164 | 329 | } | ||
165 | 330 | setfragment = 0; | ||
166 | 331 | } | ||
167 | 300 | } | 332 | } |
168 | 301 | } | 333 | } |
169 | 302 | else | ||
170 | 303 | #endif | 334 | #endif |
172 | 304 | { | 335 | |
173 | 336 | if (setfragment) { | ||
174 | 305 | int mmmmssss = (req->nfrags << 16) | ctz32 (req->fragsize); | 337 | int mmmmssss = (req->nfrags << 16) | ctz32 (req->fragsize); |
175 | 306 | if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) { | 338 | if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) { |
176 | 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", |
177 | @@ -857,7 +889,7 @@ | |||
178 | 857 | .valp = &conf.exclusive, | 889 | .valp = &conf.exclusive, |
179 | 858 | .descr = "Open device in exclusive mode (vmix wont work)" | 890 | .descr = "Open device in exclusive mode (vmix wont work)" |
180 | 859 | }, | 891 | }, |
182 | 860 | #ifdef SNDCTL_DSP_POLICY | 892 | #ifdef USE_DSP_POLICY |
183 | 861 | { | 893 | { |
184 | 862 | .name = "POLICY", | 894 | .name = "POLICY", |
185 | 863 | .tag = AUD_OPT_INT, | 895 | .tag = AUD_OPT_INT, |
186 | 864 | 896 | ||
187 | === modified file 'block.c' | |||
188 | --- block.c 2010-02-26 16:26:00 +0000 | |||
189 | +++ block.c 2010-06-15 15:07:26 +0000 | |||
190 | @@ -1608,6 +1608,9 @@ | |||
191 | 1608 | 1608 | ||
192 | 1609 | for (i = 0; i < mcb->num_callbacks; i++) { | 1609 | for (i = 0; i < mcb->num_callbacks; i++) { |
193 | 1610 | mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error); | 1610 | mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error); |
194 | 1611 | if (mcb->callbacks[i].free_qiov) { | ||
195 | 1612 | qemu_iovec_destroy(mcb->callbacks[i].free_qiov); | ||
196 | 1613 | } | ||
197 | 1611 | qemu_free(mcb->callbacks[i].free_qiov); | 1614 | qemu_free(mcb->callbacks[i].free_qiov); |
198 | 1612 | qemu_vfree(mcb->callbacks[i].free_buf); | 1615 | qemu_vfree(mcb->callbacks[i].free_buf); |
199 | 1613 | } | 1616 | } |
200 | @@ -1617,7 +1620,7 @@ | |||
201 | 1617 | { | 1620 | { |
202 | 1618 | MultiwriteCB *mcb = opaque; | 1621 | MultiwriteCB *mcb = opaque; |
203 | 1619 | 1622 | ||
205 | 1620 | if (ret < 0) { | 1623 | if (ret < 0 && !mcb->error) { |
206 | 1621 | mcb->error = ret; | 1624 | mcb->error = ret; |
207 | 1622 | multiwrite_user_cb(mcb); | 1625 | multiwrite_user_cb(mcb); |
208 | 1623 | } | 1626 | } |
209 | @@ -1669,6 +1672,10 @@ | |||
210 | 1669 | merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]); | 1672 | merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]); |
211 | 1670 | } | 1673 | } |
212 | 1671 | 1674 | ||
213 | 1675 | if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) { | ||
214 | 1676 | merge = 0; | ||
215 | 1677 | } | ||
216 | 1678 | |||
217 | 1672 | if (merge) { | 1679 | if (merge) { |
218 | 1673 | size_t size; | 1680 | size_t size; |
219 | 1674 | QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov)); | 1681 | QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov)); |
220 | @@ -1754,10 +1761,11 @@ | |||
221 | 1754 | // submitted yet. Otherwise we'll wait for the submitted AIOs to | 1761 | // submitted yet. Otherwise we'll wait for the submitted AIOs to |
222 | 1755 | // complete and report the error in the callback. | 1762 | // complete and report the error in the callback. |
223 | 1756 | if (mcb->num_requests == 0) { | 1763 | if (mcb->num_requests == 0) { |
225 | 1757 | reqs[i].error = EIO; | 1764 | reqs[i].error = -EIO; |
226 | 1758 | goto fail; | 1765 | goto fail; |
227 | 1759 | } else { | 1766 | } else { |
229 | 1760 | mcb->error = EIO; | 1767 | mcb->num_requests++; |
230 | 1768 | multiwrite_cb(mcb, -EIO); | ||
231 | 1761 | break; | 1769 | break; |
232 | 1762 | } | 1770 | } |
233 | 1763 | } else { | 1771 | } else { |
234 | 1764 | 1772 | ||
235 | === modified file 'block/qcow2-cluster.c' | |||
236 | --- block/qcow2-cluster.c 2010-02-26 16:26:00 +0000 | |||
237 | +++ block/qcow2-cluster.c 2010-06-15 15:07:26 +0000 | |||
238 | @@ -811,6 +811,7 @@ | |||
239 | 811 | 811 | ||
240 | 812 | cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s->cluster_size); | 812 | cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s->cluster_size); |
241 | 813 | if (cluster_offset < 0) { | 813 | if (cluster_offset < 0) { |
242 | 814 | QLIST_REMOVE(m, next_in_flight); | ||
243 | 814 | return cluster_offset; | 815 | return cluster_offset; |
244 | 815 | } | 816 | } |
245 | 816 | 817 | ||
246 | 817 | 818 | ||
247 | === modified file 'block/qcow2-refcount.c' | |||
248 | --- block/qcow2-refcount.c 2010-02-26 16:26:00 +0000 | |||
249 | +++ block/qcow2-refcount.c 2010-06-15 15:07:26 +0000 | |||
250 | @@ -27,7 +27,7 @@ | |||
251 | 27 | #include "block/qcow2.h" | 27 | #include "block/qcow2.h" |
252 | 28 | 28 | ||
253 | 29 | static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size); | 29 | static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size); |
255 | 30 | static int update_refcount(BlockDriverState *bs, | 30 | static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, |
256 | 31 | int64_t offset, int64_t length, | 31 | int64_t offset, int64_t length, |
257 | 32 | int addend); | 32 | int addend); |
258 | 33 | 33 | ||
259 | @@ -123,124 +123,266 @@ | |||
260 | 123 | return be16_to_cpu(s->refcount_block_cache[block_index]); | 123 | return be16_to_cpu(s->refcount_block_cache[block_index]); |
261 | 124 | } | 124 | } |
262 | 125 | 125 | ||
264 | 126 | static int grow_refcount_table(BlockDriverState *bs, int min_size) | 126 | /* |
265 | 127 | * Rounds the refcount table size up to avoid growing the table for each single | ||
266 | 128 | * refcount block that is allocated. | ||
267 | 129 | */ | ||
268 | 130 | static unsigned int next_refcount_table_size(BDRVQcowState *s, | ||
269 | 131 | unsigned int min_size) | ||
270 | 132 | { | ||
271 | 133 | unsigned int min_clusters = (min_size >> (s->cluster_bits - 3)) + 1; | ||
272 | 134 | unsigned int refcount_table_clusters = | ||
273 | 135 | MAX(1, s->refcount_table_size >> (s->cluster_bits - 3)); | ||
274 | 136 | |||
275 | 137 | while (min_clusters > refcount_table_clusters) { | ||
276 | 138 | refcount_table_clusters = (refcount_table_clusters * 3 + 1) / 2; | ||
277 | 139 | } | ||
278 | 140 | |||
279 | 141 | return refcount_table_clusters << (s->cluster_bits - 3); | ||
280 | 142 | } | ||
281 | 143 | |||
282 | 144 | |||
283 | 145 | /* Checks if two offsets are described by the same refcount block */ | ||
284 | 146 | static int in_same_refcount_block(BDRVQcowState *s, uint64_t offset_a, | ||
285 | 147 | uint64_t offset_b) | ||
286 | 148 | { | ||
287 | 149 | uint64_t block_a = offset_a >> (2 * s->cluster_bits - REFCOUNT_SHIFT); | ||
288 | 150 | uint64_t block_b = offset_b >> (2 * s->cluster_bits - REFCOUNT_SHIFT); | ||
289 | 151 | |||
290 | 152 | return (block_a == block_b); | ||
291 | 153 | } | ||
292 | 154 | |||
293 | 155 | /* | ||
294 | 156 | * Loads a refcount block. If it doesn't exist yet, it is allocated first | ||
295 | 157 | * (including growing the refcount table if needed). | ||
296 | 158 | * | ||
297 | 159 | * Returns the offset of the refcount block on success or -errno in error case | ||
298 | 160 | */ | ||
299 | 161 | static int64_t alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index) | ||
300 | 127 | { | 162 | { |
301 | 128 | BDRVQcowState *s = bs->opaque; | 163 | BDRVQcowState *s = bs->opaque; |
305 | 129 | int new_table_size, new_table_size2, refcount_table_clusters, i, ret; | 164 | unsigned int refcount_table_index; |
306 | 130 | uint64_t *new_table; | 165 | int ret; |
307 | 131 | int64_t table_offset; | 166 | |
308 | 167 | /* Find the refcount block for the given cluster */ | ||
309 | 168 | refcount_table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT); | ||
310 | 169 | |||
311 | 170 | if (refcount_table_index < s->refcount_table_size) { | ||
312 | 171 | |||
313 | 172 | uint64_t refcount_block_offset = | ||
314 | 173 | s->refcount_table[refcount_table_index]; | ||
315 | 174 | |||
316 | 175 | /* If it's already there, we're done */ | ||
317 | 176 | if (refcount_block_offset) { | ||
318 | 177 | if (refcount_block_offset != s->refcount_block_cache_offset) { | ||
319 | 178 | ret = load_refcount_block(bs, refcount_block_offset); | ||
320 | 179 | if (ret < 0) { | ||
321 | 180 | return ret; | ||
322 | 181 | } | ||
323 | 182 | } | ||
324 | 183 | return refcount_block_offset; | ||
325 | 184 | } | ||
326 | 185 | } | ||
327 | 186 | |||
328 | 187 | /* | ||
329 | 188 | * If we came here, we need to allocate something. Something is at least | ||
330 | 189 | * a cluster for the new refcount block. It may also include a new refcount | ||
331 | 190 | * table if the old refcount table is too small. | ||
332 | 191 | * | ||
333 | 192 | * Note that allocating clusters here needs some special care: | ||
334 | 193 | * | ||
335 | 194 | * - We can't use the normal qcow2_alloc_clusters(), it would try to | ||
336 | 195 | * increase the refcount and very likely we would end up with an endless | ||
337 | 196 | * recursion. Instead we must place the refcount blocks in a way that | ||
338 | 197 | * they can describe them themselves. | ||
339 | 198 | * | ||
340 | 199 | * - We need to consider that at this point we are inside update_refcounts | ||
341 | 200 | * and doing the initial refcount increase. This means that some clusters | ||
342 | 201 | * have already been allocated by the caller, but their refcount isn't | ||
343 | 202 | * accurate yet. free_cluster_index tells us where this allocation ends | ||
344 | 203 | * as long as we don't overwrite it by freeing clusters. | ||
345 | 204 | * | ||
346 | 205 | * - alloc_clusters_noref and qcow2_free_clusters may load a different | ||
347 | 206 | * refcount block into the cache | ||
348 | 207 | */ | ||
349 | 208 | |||
350 | 209 | if (cache_refcount_updates) { | ||
351 | 210 | ret = write_refcount_block(s); | ||
352 | 211 | if (ret < 0) { | ||
353 | 212 | return ret; | ||
354 | 213 | } | ||
355 | 214 | } | ||
356 | 215 | |||
357 | 216 | /* Allocate the refcount block itself and mark it as used */ | ||
358 | 217 | uint64_t new_block = alloc_clusters_noref(bs, s->cluster_size); | ||
359 | 218 | memset(s->refcount_block_cache, 0, s->cluster_size); | ||
360 | 219 | s->refcount_block_cache_offset = new_block; | ||
361 | 220 | |||
362 | 221 | #ifdef DEBUG_ALLOC2 | ||
363 | 222 | fprintf(stderr, "qcow2: Allocate refcount block %d for %" PRIx64 | ||
364 | 223 | " at %" PRIx64 "\n", | ||
365 | 224 | refcount_table_index, cluster_index << s->cluster_bits, new_block); | ||
366 | 225 | #endif | ||
367 | 226 | |||
368 | 227 | if (in_same_refcount_block(s, new_block, cluster_index << s->cluster_bits)) { | ||
369 | 228 | /* The block describes itself, need to update the cache */ | ||
370 | 229 | int block_index = (new_block >> s->cluster_bits) & | ||
371 | 230 | ((1 << (s->cluster_bits - REFCOUNT_SHIFT)) - 1); | ||
372 | 231 | s->refcount_block_cache[block_index] = cpu_to_be16(1); | ||
373 | 232 | } else { | ||
374 | 233 | /* Described somewhere else. This can recurse at most twice before we | ||
375 | 234 | * arrive at a block that describes itself. */ | ||
376 | 235 | ret = update_refcount(bs, new_block, s->cluster_size, 1); | ||
377 | 236 | if (ret < 0) { | ||
378 | 237 | goto fail_block; | ||
379 | 238 | } | ||
380 | 239 | } | ||
381 | 240 | |||
382 | 241 | /* Now the new refcount block needs to be written to disk */ | ||
383 | 242 | ret = bdrv_pwrite(s->hd, new_block, s->refcount_block_cache, | ||
384 | 243 | s->cluster_size); | ||
385 | 244 | if (ret < 0) { | ||
386 | 245 | goto fail_block; | ||
387 | 246 | } | ||
388 | 247 | |||
389 | 248 | /* If the refcount table is big enough, just hook the block up there */ | ||
390 | 249 | if (refcount_table_index < s->refcount_table_size) { | ||
391 | 250 | uint64_t data64 = cpu_to_be64(new_block); | ||
392 | 251 | ret = bdrv_pwrite(s->hd, | ||
393 | 252 | s->refcount_table_offset + refcount_table_index * sizeof(uint64_t), | ||
394 | 253 | &data64, sizeof(data64)); | ||
395 | 254 | if (ret < 0) { | ||
396 | 255 | goto fail_block; | ||
397 | 256 | } | ||
398 | 257 | |||
399 | 258 | s->refcount_table[refcount_table_index] = new_block; | ||
400 | 259 | return new_block; | ||
401 | 260 | } | ||
402 | 261 | |||
403 | 262 | /* | ||
404 | 263 | * If we come here, we need to grow the refcount table. Again, a new | ||
405 | 264 | * refcount table needs some space and we can't simply allocate to avoid | ||
406 | 265 | * endless recursion. | ||
407 | 266 | * | ||
408 | 267 | * Therefore let's grab new refcount blocks at the end of the image, which | ||
409 | 268 | * will describe themselves and the new refcount table. This way we can | ||
410 | 269 | * reference them only in the new table and do the switch to the new | ||
411 | 270 | * refcount table at once without producing an inconsistent state in | ||
412 | 271 | * between. | ||
413 | 272 | */ | ||
414 | 273 | /* Calculate the number of refcount blocks needed so far */ | ||
415 | 274 | uint64_t refcount_block_clusters = 1 << (s->cluster_bits - REFCOUNT_SHIFT); | ||
416 | 275 | uint64_t blocks_used = (s->free_cluster_index + | ||
417 | 276 | refcount_block_clusters - 1) / refcount_block_clusters; | ||
418 | 277 | |||
419 | 278 | /* And now we need at least one block more for the new metadata */ | ||
420 | 279 | uint64_t table_size = next_refcount_table_size(s, blocks_used + 1); | ||
421 | 280 | uint64_t last_table_size; | ||
422 | 281 | uint64_t blocks_clusters; | ||
423 | 282 | do { | ||
424 | 283 | uint64_t table_clusters = size_to_clusters(s, table_size); | ||
425 | 284 | blocks_clusters = 1 + | ||
426 | 285 | ((table_clusters + refcount_block_clusters - 1) | ||
427 | 286 | / refcount_block_clusters); | ||
428 | 287 | uint64_t meta_clusters = table_clusters + blocks_clusters; | ||
429 | 288 | |||
430 | 289 | last_table_size = table_size; | ||
431 | 290 | table_size = next_refcount_table_size(s, blocks_used + | ||
432 | 291 | ((meta_clusters + refcount_block_clusters - 1) | ||
433 | 292 | / refcount_block_clusters)); | ||
434 | 293 | |||
435 | 294 | } while (last_table_size != table_size); | ||
436 | 295 | |||
437 | 296 | #ifdef DEBUG_ALLOC2 | ||
438 | 297 | fprintf(stderr, "qcow2: Grow refcount table %" PRId32 " => %" PRId64 "\n", | ||
439 | 298 | s->refcount_table_size, table_size); | ||
440 | 299 | #endif | ||
441 | 300 | |||
442 | 301 | /* Create the new refcount table and blocks */ | ||
443 | 302 | uint64_t meta_offset = (blocks_used * refcount_block_clusters) * | ||
444 | 303 | s->cluster_size; | ||
445 | 304 | uint64_t table_offset = meta_offset + blocks_clusters * s->cluster_size; | ||
446 | 305 | uint16_t *new_blocks = qemu_mallocz(blocks_clusters * s->cluster_size); | ||
447 | 306 | uint64_t *new_table = qemu_mallocz(table_size * sizeof(uint64_t)); | ||
448 | 307 | |||
449 | 308 | assert(meta_offset >= (s->free_cluster_index * s->cluster_size)); | ||
450 | 309 | |||
451 | 310 | /* Fill the new refcount table */ | ||
452 | 311 | memcpy(new_table, s->refcount_table, | ||
453 | 312 | s->refcount_table_size * sizeof(uint64_t)); | ||
454 | 313 | new_table[refcount_table_index] = new_block; | ||
455 | 314 | |||
456 | 315 | int i; | ||
457 | 316 | for (i = 0; i < blocks_clusters; i++) { | ||
458 | 317 | new_table[blocks_used + i] = meta_offset + (i * s->cluster_size); | ||
459 | 318 | } | ||
460 | 319 | |||
461 | 320 | /* Fill the refcount blocks */ | ||
462 | 321 | uint64_t table_clusters = size_to_clusters(s, table_size * sizeof(uint64_t)); | ||
463 | 322 | int block = 0; | ||
464 | 323 | for (i = 0; i < table_clusters + blocks_clusters; i++) { | ||
465 | 324 | new_blocks[block++] = cpu_to_be16(1); | ||
466 | 325 | } | ||
467 | 326 | |||
468 | 327 | /* Write refcount blocks to disk */ | ||
469 | 328 | ret = bdrv_pwrite(s->hd, meta_offset, new_blocks, | ||
470 | 329 | blocks_clusters * s->cluster_size); | ||
471 | 330 | qemu_free(new_blocks); | ||
472 | 331 | if (ret < 0) { | ||
473 | 332 | goto fail_table; | ||
474 | 333 | } | ||
475 | 334 | |||
476 | 335 | /* Write refcount table to disk */ | ||
477 | 336 | for(i = 0; i < table_size; i++) { | ||
478 | 337 | cpu_to_be64s(&new_table[i]); | ||
479 | 338 | } | ||
480 | 339 | |||
481 | 340 | ret = bdrv_pwrite(s->hd, table_offset, new_table, | ||
482 | 341 | table_size * sizeof(uint64_t)); | ||
483 | 342 | if (ret < 0) { | ||
484 | 343 | goto fail_table; | ||
485 | 344 | } | ||
486 | 345 | |||
487 | 346 | for(i = 0; i < table_size; i++) { | ||
488 | 347 | cpu_to_be64s(&new_table[i]); | ||
489 | 348 | } | ||
490 | 349 | |||
491 | 350 | /* Hook up the new refcount table in the qcow2 header */ | ||
492 | 132 | uint8_t data[12]; | 351 | uint8_t data[12]; |
493 | 133 | int old_table_size; | ||
494 | 134 | int64_t old_table_offset; | ||
495 | 135 | |||
496 | 136 | if (min_size <= s->refcount_table_size) | ||
497 | 137 | return 0; | ||
498 | 138 | /* compute new table size */ | ||
499 | 139 | refcount_table_clusters = s->refcount_table_size >> (s->cluster_bits - 3); | ||
500 | 140 | for(;;) { | ||
501 | 141 | if (refcount_table_clusters == 0) { | ||
502 | 142 | refcount_table_clusters = 1; | ||
503 | 143 | } else { | ||
504 | 144 | refcount_table_clusters = (refcount_table_clusters * 3 + 1) / 2; | ||
505 | 145 | } | ||
506 | 146 | new_table_size = refcount_table_clusters << (s->cluster_bits - 3); | ||
507 | 147 | if (min_size <= new_table_size) | ||
508 | 148 | break; | ||
509 | 149 | } | ||
510 | 150 | #ifdef DEBUG_ALLOC2 | ||
511 | 151 | printf("grow_refcount_table from %d to %d\n", | ||
512 | 152 | s->refcount_table_size, | ||
513 | 153 | new_table_size); | ||
514 | 154 | #endif | ||
515 | 155 | new_table_size2 = new_table_size * sizeof(uint64_t); | ||
516 | 156 | new_table = qemu_mallocz(new_table_size2); | ||
517 | 157 | memcpy(new_table, s->refcount_table, | ||
518 | 158 | s->refcount_table_size * sizeof(uint64_t)); | ||
519 | 159 | for(i = 0; i < s->refcount_table_size; i++) | ||
520 | 160 | cpu_to_be64s(&new_table[i]); | ||
521 | 161 | /* Note: we cannot update the refcount now to avoid recursion */ | ||
522 | 162 | table_offset = alloc_clusters_noref(bs, new_table_size2); | ||
523 | 163 | ret = bdrv_pwrite(s->hd, table_offset, new_table, new_table_size2); | ||
524 | 164 | if (ret != new_table_size2) | ||
525 | 165 | goto fail; | ||
526 | 166 | for(i = 0; i < s->refcount_table_size; i++) | ||
527 | 167 | be64_to_cpus(&new_table[i]); | ||
528 | 168 | |||
529 | 169 | cpu_to_be64w((uint64_t*)data, table_offset); | 352 | cpu_to_be64w((uint64_t*)data, table_offset); |
531 | 170 | cpu_to_be32w((uint32_t*)(data + 8), refcount_table_clusters); | 353 | cpu_to_be32w((uint32_t*)(data + 8), table_clusters); |
532 | 171 | ret = bdrv_pwrite(s->hd, offsetof(QCowHeader, refcount_table_offset), | 354 | ret = bdrv_pwrite(s->hd, offsetof(QCowHeader, refcount_table_offset), |
536 | 172 | data, sizeof(data)); | 355 | data, sizeof(data)); |
537 | 173 | if (ret != sizeof(data)) { | 356 | if (ret < 0) { |
538 | 174 | goto fail; | 357 | goto fail_table; |
539 | 175 | } | 358 | } |
540 | 176 | 359 | ||
541 | 360 | /* And switch it in memory */ | ||
542 | 361 | uint64_t old_table_offset = s->refcount_table_offset; | ||
543 | 362 | uint64_t old_table_size = s->refcount_table_size; | ||
544 | 363 | |||
545 | 177 | qemu_free(s->refcount_table); | 364 | qemu_free(s->refcount_table); |
546 | 178 | old_table_offset = s->refcount_table_offset; | ||
547 | 179 | old_table_size = s->refcount_table_size; | ||
548 | 180 | s->refcount_table = new_table; | 365 | s->refcount_table = new_table; |
550 | 181 | s->refcount_table_size = new_table_size; | 366 | s->refcount_table_size = table_size; |
551 | 182 | s->refcount_table_offset = table_offset; | 367 | s->refcount_table_offset = table_offset; |
552 | 183 | 368 | ||
554 | 184 | update_refcount(bs, table_offset, new_table_size2, 1); | 369 | /* Free old table. Remember, we must not change free_cluster_index */ |
555 | 370 | uint64_t old_free_cluster_index = s->free_cluster_index; | ||
556 | 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)); |
559 | 186 | return 0; | 372 | s->free_cluster_index = old_free_cluster_index; |
560 | 187 | fail: | 373 | |
561 | 374 | ret = load_refcount_block(bs, new_block); | ||
562 | 375 | if (ret < 0) { | ||
563 | 376 | goto fail_block; | ||
564 | 377 | } | ||
565 | 378 | |||
566 | 379 | return new_block; | ||
567 | 380 | |||
568 | 381 | fail_table: | ||
569 | 188 | qemu_free(new_table); | 382 | qemu_free(new_table); |
625 | 189 | return ret < 0 ? ret : -EIO; | 383 | fail_block: |
626 | 190 | } | 384 | s->refcount_block_cache_offset = 0; |
627 | 191 | 385 | return ret; | |
573 | 192 | |||
574 | 193 | static int64_t alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index) | ||
575 | 194 | { | ||
576 | 195 | BDRVQcowState *s = bs->opaque; | ||
577 | 196 | int64_t offset, refcount_block_offset; | ||
578 | 197 | unsigned int refcount_table_index; | ||
579 | 198 | int ret; | ||
580 | 199 | uint64_t data64; | ||
581 | 200 | int cache = cache_refcount_updates; | ||
582 | 201 | |||
583 | 202 | /* Find L1 index and grow refcount table if needed */ | ||
584 | 203 | refcount_table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT); | ||
585 | 204 | if (refcount_table_index >= s->refcount_table_size) { | ||
586 | 205 | ret = grow_refcount_table(bs, refcount_table_index + 1); | ||
587 | 206 | if (ret < 0) | ||
588 | 207 | return ret; | ||
589 | 208 | } | ||
590 | 209 | |||
591 | 210 | /* Load or allocate the refcount block */ | ||
592 | 211 | refcount_block_offset = s->refcount_table[refcount_table_index]; | ||
593 | 212 | if (!refcount_block_offset) { | ||
594 | 213 | if (cache_refcount_updates) { | ||
595 | 214 | write_refcount_block(s); | ||
596 | 215 | cache_refcount_updates = 0; | ||
597 | 216 | } | ||
598 | 217 | /* create a new refcount block */ | ||
599 | 218 | /* Note: we cannot update the refcount now to avoid recursion */ | ||
600 | 219 | offset = alloc_clusters_noref(bs, s->cluster_size); | ||
601 | 220 | memset(s->refcount_block_cache, 0, s->cluster_size); | ||
602 | 221 | ret = bdrv_pwrite(s->hd, offset, s->refcount_block_cache, s->cluster_size); | ||
603 | 222 | if (ret != s->cluster_size) | ||
604 | 223 | return -EINVAL; | ||
605 | 224 | s->refcount_table[refcount_table_index] = offset; | ||
606 | 225 | data64 = cpu_to_be64(offset); | ||
607 | 226 | ret = bdrv_pwrite(s->hd, s->refcount_table_offset + | ||
608 | 227 | refcount_table_index * sizeof(uint64_t), | ||
609 | 228 | &data64, sizeof(data64)); | ||
610 | 229 | if (ret != sizeof(data64)) | ||
611 | 230 | return -EINVAL; | ||
612 | 231 | |||
613 | 232 | refcount_block_offset = offset; | ||
614 | 233 | s->refcount_block_cache_offset = offset; | ||
615 | 234 | update_refcount(bs, offset, s->cluster_size, 1); | ||
616 | 235 | cache_refcount_updates = cache; | ||
617 | 236 | } else { | ||
618 | 237 | if (refcount_block_offset != s->refcount_block_cache_offset) { | ||
619 | 238 | if (load_refcount_block(bs, refcount_block_offset) < 0) | ||
620 | 239 | return -EIO; | ||
621 | 240 | } | ||
622 | 241 | } | ||
623 | 242 | |||
624 | 243 | return refcount_block_offset; | ||
628 | 244 | } | 386 | } |
629 | 245 | 387 | ||
630 | 246 | #define REFCOUNTS_PER_SECTOR (512 >> REFCOUNT_SHIFT) | 388 | #define REFCOUNTS_PER_SECTOR (512 >> REFCOUNT_SHIFT) |
631 | 247 | 389 | ||
632 | === modified file 'block/qcow2.c' | |||
633 | --- block/qcow2.c 2010-02-26 16:26:00 +0000 | |||
634 | +++ block/qcow2.c 2010-06-15 15:07:26 +0000 | |||
635 | @@ -467,8 +467,10 @@ | |||
636 | 467 | acb->hd_aiocb = bdrv_aio_readv(s->hd, | 467 | acb->hd_aiocb = bdrv_aio_readv(s->hd, |
637 | 468 | (acb->cluster_offset >> 9) + index_in_cluster, | 468 | (acb->cluster_offset >> 9) + index_in_cluster, |
638 | 469 | &acb->hd_qiov, acb->n, qcow_aio_read_cb, acb); | 469 | &acb->hd_qiov, acb->n, qcow_aio_read_cb, acb); |
640 | 470 | if (acb->hd_aiocb == NULL) | 470 | if (acb->hd_aiocb == NULL) { |
641 | 471 | ret = -EIO; | ||
642 | 471 | goto done; | 472 | goto done; |
643 | 473 | } | ||
644 | 472 | } | 474 | } |
645 | 473 | 475 | ||
646 | 474 | return; | 476 | return; |
647 | @@ -620,11 +622,17 @@ | |||
648 | 620 | (acb->cluster_offset >> 9) + index_in_cluster, | 622 | (acb->cluster_offset >> 9) + index_in_cluster, |
649 | 621 | &acb->hd_qiov, acb->n, | 623 | &acb->hd_qiov, acb->n, |
650 | 622 | qcow_aio_write_cb, acb); | 624 | qcow_aio_write_cb, acb); |
653 | 623 | if (acb->hd_aiocb == NULL) | 625 | if (acb->hd_aiocb == NULL) { |
654 | 624 | goto done; | 626 | ret = -EIO; |
655 | 627 | goto fail; | ||
656 | 628 | } | ||
657 | 625 | 629 | ||
658 | 626 | return; | 630 | return; |
659 | 627 | 631 | ||
660 | 632 | fail: | ||
661 | 633 | if (acb->l2meta.nb_clusters != 0) { | ||
662 | 634 | QLIST_REMOVE(&acb->l2meta, next_in_flight); | ||
663 | 635 | } | ||
664 | 628 | done: | 636 | done: |
665 | 629 | if (acb->qiov->niov > 1) | 637 | if (acb->qiov->niov > 1) |
666 | 630 | qemu_vfree(acb->orig_buf); | 638 | qemu_vfree(acb->orig_buf); |
667 | 631 | 639 | ||
668 | === modified file 'debian/changelog' | |||
669 | --- debian/changelog 2010-04-23 18:45:55 +0000 | |||
670 | +++ debian/changelog 2010-06-15 15:07:26 +0000 | |||
671 | @@ -1,3 +1,14 @@ | |||
672 | 1 | qemu-kvm (0.12.4+noroms-0ubuntu1) maverick; urgency=low | ||
673 | 2 | |||
674 | 3 | * New upstream release. | ||
675 | 4 | * add block from kees to debian/rules to parallelize make | ||
676 | 5 | * Removed patches which have been merged. | ||
677 | 6 | * Removed the capslock patch because capslock isn't behaving | ||
678 | 7 | right for me in 0.12.3 with the patch anyway, probably bc the | ||
679 | 8 | underlying SDL has been fixed. Original patch was for LP#427612. | ||
680 | 9 | |||
681 | 10 | -- Serge Hallyn <serge.hallyn@canonical.com> Fri, 11 Jun 2010 11:58:47 -0500 | ||
682 | 11 | |||
683 | 1 | qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low | 12 | qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low |
684 | 2 | 13 | ||
685 | 3 | * Architecture-specific fixes (LP: #568904) | 14 | * Architecture-specific fixes (LP: #568904) |
686 | 4 | 15 | ||
687 | === removed file 'debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch' | |||
688 | --- debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch 2010-01-20 17:54:24 +0000 | |||
689 | +++ debian/patches/0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch 1970-01-01 00:00:00 +0000 | |||
690 | @@ -1,137 +0,0 @@ | |||
691 | 1 | http://lists.gnu.org/archive/html/qemu-devel/2010-01/msg01114.html | ||
692 | 2 | |||
693 | 3 | From: Loic Minier | ||
694 | 4 | Date: Tue, 29 Dec 2009 22:06:13 +0100 | ||
695 | 5 | Subject: [PATCH] linux-user: adapt uname machine to emulated CPU | ||
696 | 6 | |||
697 | 7 | --- | ||
698 | 8 | Makefile.target | 2 +- | ||
699 | 9 | linux-user/cpu-uname.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ | ||
700 | 10 | linux-user/cpu-uname.h | 1 + | ||
701 | 11 | linux-user/syscall.c | 3 +- | ||
702 | 12 | 4 files changed, 76 insertions(+), 2 deletions(-) | ||
703 | 13 | create mode 100644 linux-user/cpu-uname.c | ||
704 | 14 | create mode 100644 linux-user/cpu-uname.h | ||
705 | 15 | |||
706 | 16 | diff --git a/Makefile.target b/Makefile.target | ||
707 | 17 | index e661478..9f5bd17 100644 | ||
708 | 18 | --- a/Makefile.target | ||
709 | 19 | +++ b/Makefile.target | ||
710 | 20 | @@ -95,7 +95,7 @@ $(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR | ||
711 | 21 | |||
712 | 22 | QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) | ||
713 | 23 | obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \ | ||
714 | 24 | - elfload.o linuxload.o uaccess.o gdbstub.o | ||
715 | 25 | + elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o | ||
716 | 26 | |||
717 | 27 | obj-$(TARGET_HAS_BFLT) += flatload.o | ||
718 | 28 | obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o | ||
719 | 29 | diff --git a/linux-user/cpu-uname.c b/linux-user/cpu-uname.c | ||
720 | 30 | new file mode 100644 | ||
721 | 31 | index 0000000..ddc37be | ||
722 | 32 | --- /dev/null | ||
723 | 33 | +++ b/linux-user/cpu-uname.c | ||
724 | 34 | @@ -0,0 +1,72 @@ | ||
725 | 35 | +/* | ||
726 | 36 | + * cpu to uname machine name map | ||
727 | 37 | + * | ||
728 | 38 | + * Copyright (c) 2009 Loïc Minier | ||
729 | 39 | + * | ||
730 | 40 | + * This program is free software; you can redistribute it and/or modify | ||
731 | 41 | + * it under the terms of the GNU General Public License as published by | ||
732 | 42 | + * the Free Software Foundation; either version 2 of the License, or | ||
733 | 43 | + * (at your option) any later version. | ||
734 | 44 | + * | ||
735 | 45 | + * This program is distributed in the hope that it will be useful, | ||
736 | 46 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
737 | 47 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
738 | 48 | + * GNU General Public License for more details. | ||
739 | 49 | + * | ||
740 | 50 | + * You should have received a copy of the GNU General Public License | ||
741 | 51 | + * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
742 | 52 | + */ | ||
743 | 53 | + | ||
744 | 54 | +#include <stdio.h> | ||
745 | 55 | + | ||
746 | 56 | +#include "qemu.h" | ||
747 | 57 | +//#include "qemu-common.h" | ||
748 | 58 | +#include "cpu-uname.h" | ||
749 | 59 | + | ||
750 | 60 | +/* return highest utsname machine name for emulated instruction set | ||
751 | 61 | + * | ||
752 | 62 | + * NB: the default emulated CPU ("any") might not match any existing CPU, e.g. | ||
753 | 63 | + * on ARM it has all features turned on, so there is no perfect arch string to | ||
754 | 64 | + * return here */ | ||
755 | 65 | +const char *cpu_to_uname_machine(void *cpu_env) | ||
756 | 66 | +{ | ||
757 | 67 | +#ifdef TARGET_ARM | ||
758 | 68 | + /* utsname machine name on linux arm is CPU arch name + endianness, e.g. | ||
759 | 69 | + * armv7l; to get a list of CPU arch names from the linux source, use: | ||
760 | 70 | + * grep arch_name: -A1 linux/arch/arm/mm/proc-*.S | ||
761 | 71 | + * see arch/arm/kernel/setup.c: setup_processor() | ||
762 | 72 | + * | ||
763 | 73 | + * to test by CPU id, compare cpu_env->cp15.c0_cpuid to ARM_CPUID_* | ||
764 | 74 | + * defines and to test by CPU feature, use arm_feature(cpu_env, | ||
765 | 75 | + * ARM_FEATURE_*) */ | ||
766 | 76 | + | ||
767 | 77 | + /* in theory, endianness is configurable on some ARM CPUs, but this isn't | ||
768 | 78 | + * used in user mode emulation */ | ||
769 | 79 | +#ifdef TARGET_WORDS_BIGENDIAN | ||
770 | 80 | +#define utsname_suffix "b" | ||
771 | 81 | +#else | ||
772 | 82 | +#define utsname_suffix "l" | ||
773 | 83 | +#endif | ||
774 | 84 | + if (arm_feature(cpu_env, ARM_FEATURE_V7)) | ||
775 | 85 | + return "armv7" utsname_suffix; | ||
776 | 86 | + if (arm_feature(cpu_env, ARM_FEATURE_V6)) | ||
777 | 87 | + return "armv6" utsname_suffix; | ||
778 | 88 | + /* earliest emulated CPU is ARMv5TE; qemu can emulate the 1026, but not its | ||
779 | 89 | + * Jazelle support */ | ||
780 | 90 | + return "armv5te" utsname_suffix; | ||
781 | 91 | +#elif defined(TARGET_X86_64) | ||
782 | 92 | + return "x86-64"; | ||
783 | 93 | +#elif defined(TARGET_I386) | ||
784 | 94 | + /* see arch/x86/kernel/cpu/bugs.c: check_bugs(), 386, 486, 586, 686 */ | ||
785 | 95 | + uint32_t cpuid_version = ((CPUX86State *)cpu_env)->cpuid_version; | ||
786 | 96 | + int family = ((cpuid_version >> 8) & 0x0f) + ((cpuid_version >> 20) & 0xff); | ||
787 | 97 | + if (family == 4) | ||
788 | 98 | + return "i486"; | ||
789 | 99 | + if (family == 5) | ||
790 | 100 | + return "i586"; | ||
791 | 101 | + return "i686"; | ||
792 | 102 | +#else | ||
793 | 103 | + /* default is #define-d in each arch/ subdir */ | ||
794 | 104 | + return UNAME_MACHINE; | ||
795 | 105 | +#endif | ||
796 | 106 | +} | ||
797 | 107 | diff --git a/linux-user/cpu-uname.h b/linux-user/cpu-uname.h | ||
798 | 108 | new file mode 100644 | ||
799 | 109 | index 0000000..32492de | ||
800 | 110 | --- /dev/null | ||
801 | 111 | +++ b/linux-user/cpu-uname.h | ||
802 | 112 | @@ -0,0 +1 @@ | ||
803 | 113 | +const char *cpu_to_uname_machine(void *cpu_env); | ||
804 | 114 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
805 | 115 | index f2dd39e..9fb493f 100644 | ||
806 | 116 | --- a/linux-user/syscall.c | ||
807 | 117 | +++ b/linux-user/syscall.c | ||
808 | 118 | @@ -82,6 +82,7 @@ | ||
809 | 119 | #include <linux/fb.h> | ||
810 | 120 | #include <linux/vt.h> | ||
811 | 121 | #include "linux_loop.h" | ||
812 | 122 | +#include "cpu-uname.h" | ||
813 | 123 | |||
814 | 124 | #include "qemu.h" | ||
815 | 125 | #include "qemu-common.h" | ||
816 | 126 | @@ -5739,7 +5740,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, | ||
817 | 127 | if (!is_error(ret)) { | ||
818 | 128 | /* Overrite the native machine name with whatever is being | ||
819 | 129 | emulated. */ | ||
820 | 130 | - strcpy (buf->machine, UNAME_MACHINE); | ||
821 | 131 | + strcpy (buf->machine, cpu_to_uname_machine(cpu_env)); | ||
822 | 132 | /* Allow the user to override the reported release. */ | ||
823 | 133 | if (qemu_uname_release && *qemu_uname_release) | ||
824 | 134 | strcpy (buf->release, qemu_uname_release); | ||
825 | 135 | -- | ||
826 | 136 | 1.6.5 | ||
827 | 137 | |||
828 | 138 | 0 | ||
829 | === removed file 'debian/patches/05_improve-qemu-img-errors.patch' | |||
830 | --- debian/patches/05_improve-qemu-img-errors.patch 2009-09-10 22:58:09 +0000 | |||
831 | +++ debian/patches/05_improve-qemu-img-errors.patch 1970-01-01 00:00:00 +0000 | |||
832 | @@ -1,20 +0,0 @@ | |||
833 | 1 | qemu-img: improve error reporting | ||
834 | 2 | |||
835 | 3 | Use strerror to provide a better error message when qemu-img fails. | ||
836 | 4 | |||
837 | 5 | https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/418112 | ||
838 | 6 | |||
839 | 7 | Signed-off-by: Dustin Kirkland <kirkland@canonical.com> | ||
840 | 8 | |||
841 | 9 | diff -uprN qemu-kvm-0.11.0~rc2/qemu-img.c qemu-kvm-0.11.0~rc2.new/qemu-img.c | ||
842 | 10 | --- qemu-kvm-0.11.0~rc2/qemu-img.c 2009-08-30 04:10:59.000000000 -0500 | ||
843 | 11 | +++ qemu-kvm-0.11.0~rc2.new/qemu-img.c 2009-09-10 22:30:32.572211443 -0500 | ||
844 | 12 | @@ -368,7 +368,7 @@ static int img_create(int argc, char **a | ||
845 | 13 | } else if (ret == -EFBIG) { | ||
846 | 14 | error("The image size is too large for file format '%s'", fmt); | ||
847 | 15 | } else { | ||
848 | 16 | - error("Error while formatting"); | ||
849 | 17 | + error("Error while formatting (%s)", strerror(-ret)); | ||
850 | 18 | } | ||
851 | 19 | } | ||
852 | 20 | return 0; | ||
853 | 21 | 0 | ||
854 | === removed file 'debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch' | |||
855 | --- debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch 2010-02-18 14:08:33 +0000 | |||
856 | +++ debian/patches/Detect-and-use-GCC-atomic-builtins-for-locking.patch 1970-01-01 00:00:00 +0000 | |||
857 | @@ -1,87 +0,0 @@ | |||
858 | 1 | From de01f17a2cb88dc5ff53cc321342b888c33b120a Mon Sep 17 00:00:00 2001 | ||
859 | 2 | From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org> | ||
860 | 3 | Date: Thu, 11 Feb 2010 17:42:33 +0100 | ||
861 | 4 | Subject: [PATCH] Detect and use GCC atomic builtins for locking | ||
862 | 5 | |||
863 | 6 | --- | ||
864 | 7 | configure | 17 +++++++++++++++++ | ||
865 | 8 | qemu-lock.h | 13 +++++++++++++ | ||
866 | 9 | 2 files changed, 30 insertions(+), 0 deletions(-) | ||
867 | 10 | |||
868 | 11 | diff --git a/configure b/configure | ||
869 | 12 | index 0a84b0e..b33f045 100755 | ||
870 | 13 | --- a/configure | ||
871 | 14 | +++ b/configure | ||
872 | 15 | @@ -1823,6 +1823,20 @@ if compile_prog "" ""; then | ||
873 | 16 | fi | ||
874 | 17 | |||
875 | 18 | ########################################## | ||
876 | 19 | +# check if we have gcc atomic built-ins | ||
877 | 20 | +gcc_atomic_builtins=no | ||
878 | 21 | +cat > $TMPC << EOF | ||
879 | 22 | +int main(void) { | ||
880 | 23 | + int i; | ||
881 | 24 | + __sync_lock_test_and_set(&i, 1); | ||
882 | 25 | + __sync_lock_release(&i); | ||
883 | 26 | +} | ||
884 | 27 | +EOF | ||
885 | 28 | +if compile_prog "" ""; then | ||
886 | 29 | + gcc_atomic_builtins=yes | ||
887 | 30 | +fi | ||
888 | 31 | + | ||
889 | 32 | +########################################## | ||
890 | 33 | # check if we have fdatasync | ||
891 | 34 | |||
892 | 35 | fdatasync=no | ||
893 | 36 | @@ -2168,6 +2182,9 @@ fi | ||
894 | 37 | if test "$gcc_attribute_warn_unused_result" = "yes" ; then | ||
895 | 38 | echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak | ||
896 | 39 | fi | ||
897 | 40 | +if test "$gcc_atomic_builtins" = "yes" ; then | ||
898 | 41 | + echo "CONFIG_GCC_ATOMIC_BUILTINS=y" >> $config_host_mak | ||
899 | 42 | +fi | ||
900 | 43 | if test "$fdatasync" = "yes" ; then | ||
901 | 44 | echo "CONFIG_FDATASYNC=y" >> $config_host_mak | ||
902 | 45 | fi | ||
903 | 46 | diff --git a/qemu-lock.h b/qemu-lock.h | ||
904 | 47 | index 9a3e6ac..5c8eb34 100644 | ||
905 | 48 | --- a/qemu-lock.h | ||
906 | 49 | +++ b/qemu-lock.h | ||
907 | 50 | @@ -33,6 +33,14 @@ | ||
908 | 51 | |||
909 | 52 | #else | ||
910 | 53 | |||
911 | 54 | +#ifdef CONFIG_GCC_ATOMIC_BUILTINS | ||
912 | 55 | +typedef int spinlock_t; | ||
913 | 56 | + | ||
914 | 57 | +#define SPIN_LOCK_UNLOCKED 0 | ||
915 | 58 | + | ||
916 | 59 | +#define resetlock(p) __sync_lock_release((p)) | ||
917 | 60 | +#else /* CONFIG_GCC_ATOMIC_BUILTINS */ | ||
918 | 61 | + | ||
919 | 62 | #if defined(__hppa__) | ||
920 | 63 | |||
921 | 64 | typedef int spinlock_t[4]; | ||
922 | 65 | @@ -56,7 +64,11 @@ static inline void resetlock (spinlock_t *p) | ||
923 | 66 | } | ||
924 | 67 | |||
925 | 68 | #endif | ||
926 | 69 | +#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */ | ||
927 | 70 | |||
928 | 71 | +#ifdef CONFIG_GCC_ATOMIC_BUILTINS | ||
929 | 72 | +#define testandset(p) __sync_lock_test_and_set((p), 1) | ||
930 | 73 | +#else /* CONFIG_GCC_ATOMIC_BUILTINS */ | ||
931 | 74 | #if defined(_ARCH_PPC) | ||
932 | 75 | static inline int testandset (int *p) | ||
933 | 76 | { | ||
934 | 77 | @@ -213,6 +225,7 @@ static inline int testandset (int *p) | ||
935 | 78 | #else | ||
936 | 79 | #error unimplemented CPU support | ||
937 | 80 | #endif | ||
938 | 81 | +#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */ | ||
939 | 82 | |||
940 | 83 | #if defined(CONFIG_USER_ONLY) | ||
941 | 84 | static inline void spin_lock(spinlock_t *lock) | ||
942 | 85 | -- | ||
943 | 86 | 1.6.6.1 | ||
944 | 87 | |||
945 | 88 | 0 | ||
946 | === removed file 'debian/patches/SDL-wrong-behaviour-of-caps-lock.patch' | |||
947 | --- debian/patches/SDL-wrong-behaviour-of-caps-lock.patch 2010-04-01 00:22:02 +0000 | |||
948 | +++ debian/patches/SDL-wrong-behaviour-of-caps-lock.patch 1970-01-01 00:00:00 +0000 | |||
949 | @@ -1,31 +0,0 @@ | |||
950 | 1 | From bb212d2b23bee1abe52db53231caccc1a6a27791 Mon Sep 17 00:00:00 2001 | ||
951 | 2 | From: Shahar Havivi <shaharh@redhat.com> | ||
952 | 3 | Date: Fri, 12 Feb 2010 00:00:44 +0200 | ||
953 | 4 | Subject: [PATCH] Qemu does not pass pressed capslock to client | ||
954 | 5 | |||
955 | 6 | --- | ||
956 | 7 | sdl.c | 8 +++++--- | ||
957 | 8 | 1 files changed, 5 insertions(+), 3 deletions(-) | ||
958 | 9 | |||
959 | 10 | diff --git a/sdl.c b/sdl.c | ||
960 | 11 | index cf27ad2..9074641 100644 | ||
961 | 12 | --- a/sdl.c | ||
962 | 13 | +++ b/sdl.c | ||
963 | 14 | @@ -390,9 +390,11 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) | ||
964 | 15 | break; | ||
965 | 16 | case 0x45: /* num lock */ | ||
966 | 17 | case 0x3a: /* caps lock */ | ||
967 | 18 | - /* SDL does not send the key up event, so we generate it */ | ||
968 | 19 | - kbd_put_keycode(keycode); | ||
969 | 20 | - kbd_put_keycode(keycode | 0x80); | ||
970 | 21 | + if (ev->type == SDL_KEYUP) { | ||
971 | 22 | + kbd_put_keycode(keycode | 0x80); | ||
972 | 23 | + } else { | ||
973 | 24 | + kbd_put_keycode(keycode); | ||
974 | 25 | + } | ||
975 | 26 | return; | ||
976 | 27 | } | ||
977 | 28 | |||
978 | 29 | -- | ||
979 | 30 | 1.6.3.3 | ||
980 | 31 | |||
981 | 32 | 0 | ||
982 | === removed file 'debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch' | |||
983 | --- debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch 2010-02-18 14:08:33 +0000 | |||
984 | +++ debian/patches/This-patch-adds-support-for-the-pselect-syscall-in-l.patch 1970-01-01 00:00:00 +0000 | |||
985 | @@ -1,171 +0,0 @@ | |||
986 | 1 | From 2c28192f9eb4a23cda0787c97cdb78c33735803e Mon Sep 17 00:00:00 2001 | ||
987 | 2 | From: Michael Casadevall <mcasadevall@ubuntu.com> | ||
988 | 3 | Date: Tue, 16 Feb 2010 05:31:19 -0500 | ||
989 | 4 | Subject: [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. | ||
990 | 5 | |||
991 | 6 | Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com> | ||
992 | 7 | --- | ||
993 | 8 | linux-user/arm/syscall_nr.h | 2 +- | ||
994 | 9 | linux-user/syscall.c | 119 +++++++++++++++++++++++++++++++++++++++++++ | ||
995 | 10 | 2 files changed, 120 insertions(+), 1 deletions(-) | ||
996 | 11 | |||
997 | 12 | diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h | ||
998 | 13 | index b1db341..79a216a 100644 | ||
999 | 14 | --- a/linux-user/arm/syscall_nr.h | ||
1000 | 15 | +++ b/linux-user/arm/syscall_nr.h | ||
1001 | 16 | @@ -338,7 +338,7 @@ | ||
1002 | 17 | #define TARGET_NR_readlinkat (332) | ||
1003 | 18 | #define TARGET_NR_fchmodat (333) | ||
1004 | 19 | #define TARGET_NR_faccessat (334) | ||
1005 | 20 | - /* 335 for pselect6 */ | ||
1006 | 21 | +#define TARGET_NR_pselect6 (335) | ||
1007 | 22 | /* 336 for ppoll */ | ||
1008 | 23 | #define TARGET_NR_unshare (337) | ||
1009 | 24 | #define TARGET_NR_set_robust_list (338) | ||
1010 | 25 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
1011 | 26 | index 9fb493f..3663451 100644 | ||
1012 | 27 | --- a/linux-user/syscall.c | ||
1013 | 28 | +++ b/linux-user/syscall.c | ||
1014 | 29 | @@ -850,6 +850,38 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr, | ||
1015 | 30 | return 0; | ||
1016 | 31 | } | ||
1017 | 32 | |||
1018 | 33 | +static inline abi_long copy_from_user_timespec(struct timespec *ts, | ||
1019 | 34 | + abi_ulong target_ts_addr) | ||
1020 | 35 | +{ | ||
1021 | 36 | + struct target_timespec *target_ts; | ||
1022 | 37 | + | ||
1023 | 38 | + if (!lock_user_struct(VERIFY_READ, target_ts, target_ts_addr, 1)) | ||
1024 | 39 | + return -TARGET_EFAULT; | ||
1025 | 40 | + | ||
1026 | 41 | + __get_user(ts->tv_sec, &target_ts->tv_sec); | ||
1027 | 42 | + __get_user(ts->tv_nsec, &target_ts->tv_nsec); | ||
1028 | 43 | + | ||
1029 | 44 | + unlock_user_struct(target_ts, target_ts_addr, 0); | ||
1030 | 45 | + | ||
1031 | 46 | + return 0; | ||
1032 | 47 | +} | ||
1033 | 48 | + | ||
1034 | 49 | + | ||
1035 | 50 | +static inline abi_long copy_to_user_timespec(abi_ulong target_ts_addr, | ||
1036 | 51 | + const struct timespec *ts) | ||
1037 | 52 | +{ | ||
1038 | 53 | + struct target_timespec *target_ts; | ||
1039 | 54 | + | ||
1040 | 55 | + if (!lock_user_struct(VERIFY_WRITE, target_ts, target_ts_addr, 0)) | ||
1041 | 56 | + return -TARGET_EFAULT; | ||
1042 | 57 | + | ||
1043 | 58 | + __put_user(ts->tv_sec, &target_ts->tv_sec); | ||
1044 | 59 | + __put_user(ts->tv_nsec, &target_ts->tv_nsec); | ||
1045 | 60 | + | ||
1046 | 61 | + unlock_user_struct(target_ts, target_ts_addr, 1); | ||
1047 | 62 | + | ||
1048 | 63 | + return 0; | ||
1049 | 64 | +} | ||
1050 | 65 | #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open) | ||
1051 | 66 | #include <mqueue.h> | ||
1052 | 67 | |||
1053 | 68 | @@ -949,6 +981,75 @@ static abi_long do_select(int n, | ||
1054 | 69 | return ret; | ||
1055 | 70 | } | ||
1056 | 71 | |||
1057 | 72 | +#ifdef TARGET_NR_pselect6 | ||
1058 | 73 | +/* do_pselect() must return target values and target errnos. */ | ||
1059 | 74 | +static abi_long do_pselect(int n, | ||
1060 | 75 | + abi_ulong rfd_addr, abi_ulong wfd_addr, | ||
1061 | 76 | + abi_ulong efd_addr, abi_ulong target_tv_addr, | ||
1062 | 77 | + abi_ulong set_addr) | ||
1063 | 78 | +{ | ||
1064 | 79 | + fd_set rfds, wfds, efds; | ||
1065 | 80 | + fd_set *rfds_ptr, *wfds_ptr, *efds_ptr; | ||
1066 | 81 | + struct timespec tv, *tv_ptr; | ||
1067 | 82 | + sigset_t set, *set_ptr; | ||
1068 | 83 | + abi_long ret; | ||
1069 | 84 | + | ||
1070 | 85 | + if (rfd_addr) { | ||
1071 | 86 | + if (copy_from_user_fdset(&rfds, rfd_addr, n)) | ||
1072 | 87 | + return -TARGET_EFAULT; | ||
1073 | 88 | + rfds_ptr = &rfds; | ||
1074 | 89 | + } else { | ||
1075 | 90 | + rfds_ptr = NULL; | ||
1076 | 91 | + } | ||
1077 | 92 | + if (wfd_addr) { | ||
1078 | 93 | + if (copy_from_user_fdset(&wfds, wfd_addr, n)) | ||
1079 | 94 | + return -TARGET_EFAULT; | ||
1080 | 95 | + wfds_ptr = &wfds; | ||
1081 | 96 | + } else { | ||
1082 | 97 | + wfds_ptr = NULL; | ||
1083 | 98 | + } | ||
1084 | 99 | + if (efd_addr) { | ||
1085 | 100 | + if (copy_from_user_fdset(&efds, efd_addr, n)) | ||
1086 | 101 | + return -TARGET_EFAULT; | ||
1087 | 102 | + efds_ptr = &efds; | ||
1088 | 103 | + } else { | ||
1089 | 104 | + efds_ptr = NULL; | ||
1090 | 105 | + } | ||
1091 | 106 | + | ||
1092 | 107 | + if (target_tv_addr) { | ||
1093 | 108 | + if (copy_from_user_timespec(&tv, target_tv_addr)) | ||
1094 | 109 | + return -TARGET_EFAULT; | ||
1095 | 110 | + tv_ptr = &tv; | ||
1096 | 111 | + } else { | ||
1097 | 112 | + tv_ptr = NULL; | ||
1098 | 113 | + } | ||
1099 | 114 | + | ||
1100 | 115 | + /* We don't need to return sigmask to target */ | ||
1101 | 116 | + if (set_addr) { | ||
1102 | 117 | + target_to_host_old_sigset(&set, &set_addr); | ||
1103 | 118 | + set_ptr = &set; | ||
1104 | 119 | + } else { | ||
1105 | 120 | + set_ptr = NULL; | ||
1106 | 121 | + } | ||
1107 | 122 | + | ||
1108 | 123 | + ret = get_errno(pselect(n, rfds_ptr, wfds_ptr, efds_ptr, tv_ptr, set_ptr)); | ||
1109 | 124 | + | ||
1110 | 125 | + if (!is_error(ret)) { | ||
1111 | 126 | + if (rfd_addr && copy_to_user_fdset(rfd_addr, &rfds, n)) | ||
1112 | 127 | + return -TARGET_EFAULT; | ||
1113 | 128 | + if (wfd_addr && copy_to_user_fdset(wfd_addr, &wfds, n)) | ||
1114 | 129 | + return -TARGET_EFAULT; | ||
1115 | 130 | + if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n)) | ||
1116 | 131 | + return -TARGET_EFAULT; | ||
1117 | 132 | + | ||
1118 | 133 | + if (target_tv_addr && copy_to_user_timespec(target_tv_addr, &tv)) | ||
1119 | 134 | + return -TARGET_EFAULT; | ||
1120 | 135 | + } | ||
1121 | 136 | + | ||
1122 | 137 | + return ret; | ||
1123 | 138 | +} | ||
1124 | 139 | +#endif | ||
1125 | 140 | + | ||
1126 | 141 | static abi_long do_pipe2(int host_pipe[], int flags) | ||
1127 | 142 | { | ||
1128 | 143 | #ifdef CONFIG_PIPE2 | ||
1129 | 144 | @@ -5136,6 +5237,24 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, | ||
1130 | 145 | } | ||
1131 | 146 | break; | ||
1132 | 147 | #endif | ||
1133 | 148 | + | ||
1134 | 149 | +#ifdef TARGET_NR_pselect6 | ||
1135 | 150 | + case TARGET_NR_pselect6: | ||
1136 | 151 | + { | ||
1137 | 152 | + abi_ulong inp, outp, exp, tvp, set; | ||
1138 | 153 | + long nsel; | ||
1139 | 154 | + | ||
1140 | 155 | + nsel = tswapl(arg1); | ||
1141 | 156 | + inp = tswapl(arg2); | ||
1142 | 157 | + outp = tswapl(arg3); | ||
1143 | 158 | + exp = tswapl(arg4); | ||
1144 | 159 | + tvp = tswapl(arg5); | ||
1145 | 160 | + set = tswapl(arg6); | ||
1146 | 161 | + | ||
1147 | 162 | + ret = do_pselect(nsel, inp, outp, exp, tvp, set); | ||
1148 | 163 | + } | ||
1149 | 164 | + break; | ||
1150 | 165 | +#endif | ||
1151 | 166 | case TARGET_NR_symlink: | ||
1152 | 167 | { | ||
1153 | 168 | void *p2; | ||
1154 | 169 | -- | ||
1155 | 170 | 1.6.6.1 | ||
1156 | 171 | |||
1157 | 172 | 0 | ||
1158 | === removed file 'debian/patches/arm-host-fix-compiler-warning.patch' | |||
1159 | --- debian/patches/arm-host-fix-compiler-warning.patch 2010-02-27 11:59:10 +0000 | |||
1160 | +++ debian/patches/arm-host-fix-compiler-warning.patch 1970-01-01 00:00:00 +0000 | |||
1161 | @@ -1,90 +0,0 @@ | |||
1162 | 1 | From bc4347b883e8175dadef77ed9e02ccaa5e8eba94 Mon Sep 17 00:00:00 2001 | ||
1163 | 2 | From: Stefan Weil <weil@mail.berlios.de> | ||
1164 | 3 | Date: Wed, 20 Jan 2010 19:43:25 +0100 | ||
1165 | 4 | Subject: [PATCH] arm host: fix compiler warning | ||
1166 | 5 | MIME-Version: 1.0 | ||
1167 | 6 | Content-Type: text/plain; charset=UTF-8 | ||
1168 | 7 | Content-Transfer-Encoding: 8bit | ||
1169 | 8 | |||
1170 | 9 | Compilation for arm (native or cross) results in this | ||
1171 | 10 | warning: | ||
1172 | 11 | |||
1173 | 12 | fpu/softfloat-native.c: In function ‘float64_round_to_int’: | ||
1174 | 13 | fpu/softfloat-native.c:387: error: control reaches end of non-void function | ||
1175 | 14 | |||
1176 | 15 | float64_round_to_int uses special assembler code for arm | ||
1177 | 16 | and has no explicit return value. | ||
1178 | 17 | |||
1179 | 18 | As there is no obvious reason why arm should need special | ||
1180 | 19 | code, all fpu related conditionals were removed. | ||
1181 | 20 | The remaining code is standard (C99) and compiles for arm, | ||
1182 | 21 | too. | ||
1183 | 22 | |||
1184 | 23 | Signed-off-by: Stefan Weil <weil@mail.berlios.de> | ||
1185 | 24 | Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
1186 | 25 | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> | ||
1187 | 26 | --- | ||
1188 | 27 | fpu/softfloat-native.c | 20 -------------------- | ||
1189 | 28 | fpu/softfloat-native.h | 7 ------- | ||
1190 | 29 | 2 files changed, 0 insertions(+), 27 deletions(-) | ||
1191 | 30 | |||
1192 | 31 | diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c | ||
1193 | 32 | index 8d64f4e..049c830 100644 | ||
1194 | 33 | --- a/fpu/softfloat-native.c | ||
1195 | 34 | +++ b/fpu/softfloat-native.c | ||
1196 | 35 | @@ -12,8 +12,6 @@ void set_float_rounding_mode(int val STATUS_PARAM) | ||
1197 | 36 | #if (defined(CONFIG_BSD) && !defined(__APPLE__) && !defined(__GLIBC__)) || \ | ||
1198 | 37 | (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10) | ||
1199 | 38 | fpsetround(val); | ||
1200 | 39 | -#elif defined(__arm__) | ||
1201 | 40 | - /* nothing to do */ | ||
1202 | 41 | #else | ||
1203 | 42 | fesetround(val); | ||
1204 | 43 | #endif | ||
1205 | 44 | @@ -365,25 +363,7 @@ float64 float64_trunc_to_int( float64 a STATUS_PARAM ) | ||
1206 | 45 | |||
1207 | 46 | float64 float64_round_to_int( float64 a STATUS_PARAM ) | ||
1208 | 47 | { | ||
1209 | 48 | -#if defined(__arm__) | ||
1210 | 49 | - switch(STATUS(float_rounding_mode)) { | ||
1211 | 50 | - default: | ||
1212 | 51 | - case float_round_nearest_even: | ||
1213 | 52 | - asm("rndd %0, %1" : "=f" (a) : "f"(a)); | ||
1214 | 53 | - break; | ||
1215 | 54 | - case float_round_down: | ||
1216 | 55 | - asm("rnddm %0, %1" : "=f" (a) : "f"(a)); | ||
1217 | 56 | - break; | ||
1218 | 57 | - case float_round_up: | ||
1219 | 58 | - asm("rnddp %0, %1" : "=f" (a) : "f"(a)); | ||
1220 | 59 | - break; | ||
1221 | 60 | - case float_round_to_zero: | ||
1222 | 61 | - asm("rnddz %0, %1" : "=f" (a) : "f"(a)); | ||
1223 | 62 | - break; | ||
1224 | 63 | - } | ||
1225 | 64 | -#else | ||
1226 | 65 | return rint(a); | ||
1227 | 66 | -#endif | ||
1228 | 67 | } | ||
1229 | 68 | |||
1230 | 69 | float64 float64_rem( float64 a, float64 b STATUS_PARAM) | ||
1231 | 70 | diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h | ||
1232 | 71 | index fe737b3..6da0bcb 100644 | ||
1233 | 72 | --- a/fpu/softfloat-native.h | ||
1234 | 73 | +++ b/fpu/softfloat-native.h | ||
1235 | 74 | @@ -126,13 +126,6 @@ enum { | ||
1236 | 75 | float_round_up = FP_RP, | ||
1237 | 76 | float_round_to_zero = FP_RZ | ||
1238 | 77 | }; | ||
1239 | 78 | -#elif defined(__arm__) | ||
1240 | 79 | -enum { | ||
1241 | 80 | - float_round_nearest_even = 0, | ||
1242 | 81 | - float_round_down = 1, | ||
1243 | 82 | - float_round_up = 2, | ||
1244 | 83 | - float_round_to_zero = 3 | ||
1245 | 84 | -}; | ||
1246 | 85 | #else | ||
1247 | 86 | enum { | ||
1248 | 87 | float_round_nearest_even = FE_TONEAREST, | ||
1249 | 88 | -- | ||
1250 | 89 | 1.7.0 | ||
1251 | 90 | |||
1252 | 91 | 0 | ||
1253 | === removed file 'debian/patches/better_describe_-net_options.patch' | |||
1254 | --- debian/patches/better_describe_-net_options.patch 2010-03-05 18:39:19 +0000 | |||
1255 | +++ debian/patches/better_describe_-net_options.patch 1970-01-01 00:00:00 +0000 | |||
1256 | @@ -1,60 +0,0 @@ | |||
1257 | 1 | [PATCH] better describe -net options | ||
1258 | 2 | |||
1259 | 3 | The manpage reflects that multiple -net user calls may be made, | ||
1260 | 4 | but if this is done, it can cause the program to hang. Instead, | ||
1261 | 5 | multiple -net calls can be combined into one, and this patch adds | ||
1262 | 6 | that information to qemu-options.hx. Also, -net user may only | ||
1263 | 7 | be used in conjunction with -net nic. This is already implcitly | ||
1264 | 8 | stated, but this patch makes that statement more explicit. | ||
1265 | 9 | |||
1266 | 10 | https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/474969 | ||
1267 | 11 | https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/453617 | ||
1268 | 12 | |||
1269 | 13 | Signed-off-by: Brian Thomason <brian.thomason@canonical.com> | ||
1270 | 14 | --- | ||
1271 | 15 | qemu-options.hx | 15 +++++++++++++-- | ||
1272 | 16 | 1 files changed, 13 insertions(+), 2 deletions(-) | ||
1273 | 17 | |||
1274 | 18 | diff --git a/qemu-options.hx b/qemu-options.hx | ||
1275 | 19 | index fd50add..724f434 100644 | ||
1276 | 20 | --- a/qemu-options.hx | ||
1277 | 21 | +++ b/qemu-options.hx | ||
1278 | 22 | @@ -952,7 +952,8 @@ for a list of available devices for your target. | ||
1279 | 23 | |||
1280 | 24 | @item -net user[,@var{option}][,@var{option}][,...] | ||
1281 | 25 | Use the user mode network stack which requires no administrator | ||
1282 | 26 | -privilege to run. Valid options are: | ||
1283 | 27 | +privilege to run. Please note that this can be used only in conjunction with | ||
1284 | 28 | +@option{-net nic}. Valid options are: | ||
1285 | 29 | |||
1286 | 30 | @table @option | ||
1287 | 31 | @item vlan=@var{n} | ||
1288 | 32 | @@ -1028,7 +1029,8 @@ the guest IP address @var{guestaddr} on guest port @var{guestport}. If | ||
1289 | 33 | @var{guestaddr} is not specified, its value is x.x.x.15 (default first address | ||
1290 | 34 | given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can | ||
1291 | 35 | be bound to a specific host interface. If no connection type is set, TCP is | ||
1292 | 36 | -used. This option can be given multiple times. | ||
1293 | 37 | +used. This option can not be given multiple times, but multiple rules may | ||
1294 | 38 | +be combined. | ||
1295 | 39 | |||
1296 | 40 | For example, to redirect host X11 connection from screen 1 to guest | ||
1297 | 41 | screen 0, use the following: | ||
1298 | 42 | @@ -1052,6 +1054,15 @@ telnet localhost 5555 | ||
1299 | 43 | Then when you use on the host @code{telnet localhost 5555}, you | ||
1300 | 44 | connect to the guest telnet server. | ||
1301 | 45 | |||
1302 | 46 | +To combine two or more hostfwd rules, simply use a comma as a delimiter. For | ||
1303 | 47 | +example, to combine the two rules mentioned in the examples above, use the | ||
1304 | 48 | +following: | ||
1305 | 49 | + | ||
1306 | 50 | +@example | ||
1307 | 51 | +#on the host | ||
1308 | 52 | +qemu -net user,hostfwd=tcp:127.0.0.1:6001-:6000,hostfwd=tcp:5555-::23 [...] | ||
1309 | 53 | +@end example | ||
1310 | 54 | + | ||
1311 | 55 | @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev} | ||
1312 | 56 | Forward guest TCP connections to the IP address @var{server} on port @var{port} | ||
1313 | 57 | to the character device @var{dev}. This option can be given multiple times. | ||
1314 | 58 | -- | ||
1315 | 59 | 1.6.3.3 | ||
1316 | 60 | |||
1317 | 61 | 0 | ||
1318 | === removed file 'debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch' | |||
1319 | --- debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch 2010-03-12 13:30:30 +0000 | |||
1320 | +++ debian/patches/block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch 1970-01-01 00:00:00 +0000 | |||
1321 | @@ -1,53 +0,0 @@ | |||
1322 | 1 | From e2a305fb13ff0f5cf6ff805555aaa90a5ed5954c Mon Sep 17 00:00:00 2001 | ||
1323 | 2 | From: Christoph Hellwig <hch@lst.de> | ||
1324 | 3 | Date: Tue, 26 Jan 2010 14:49:08 +0100 | ||
1325 | 4 | Subject: [PATCH] block: avoid creating too large iovecs in multiwrite_merge | ||
1326 | 5 | |||
1327 | 6 | If we go over the maximum number of iovecs support by syscall we get | ||
1328 | 7 | back EINVAL from the kernel which translate to I/O errors for the guest. | ||
1329 | 8 | |||
1330 | 9 | Add a MAX_IOV defintion for platforms that don't have it. For now we use | ||
1331 | 10 | the same 1024 define that's used on Linux and various other platforms, | ||
1332 | 11 | but until the windows block backend implements some kind of vectored I/O | ||
1333 | 12 | it doesn't matter. | ||
1334 | 13 | |||
1335 | 14 | Signed-off-by: Christoph Hellwig <hch@lst.de> | ||
1336 | 15 | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> | ||
1337 | 16 | --- | ||
1338 | 17 | block.c | 4 ++++ | ||
1339 | 18 | qemu-common.h | 4 ++++ | ||
1340 | 19 | 2 files changed, 8 insertions(+), 0 deletions(-) | ||
1341 | 20 | |||
1342 | 21 | diff --git a/block.c b/block.c | ||
1343 | 22 | index 9c106a8..1919d19 100644 | ||
1344 | 23 | --- a/block.c | ||
1345 | 24 | +++ b/block.c | ||
1346 | 25 | @@ -1691,6 +1691,10 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs, | ||
1347 | 26 | merge = bs->drv->bdrv_merge_requests(bs, &reqs[outidx], &reqs[i]); | ||
1348 | 27 | } | ||
1349 | 28 | |||
1350 | 29 | + if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) { | ||
1351 | 30 | + merge = 0; | ||
1352 | 31 | + } | ||
1353 | 32 | + | ||
1354 | 33 | if (merge) { | ||
1355 | 34 | size_t size; | ||
1356 | 35 | QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov)); | ||
1357 | 36 | diff --git a/qemu-common.h b/qemu-common.h | ||
1358 | 37 | index ae4f23b..b09f717 100644 | ||
1359 | 38 | --- a/qemu-common.h | ||
1360 | 39 | +++ b/qemu-common.h | ||
1361 | 40 | @@ -54,6 +54,10 @@ struct iovec { | ||
1362 | 41 | void *iov_base; | ||
1363 | 42 | size_t iov_len; | ||
1364 | 43 | }; | ||
1365 | 44 | +/* | ||
1366 | 45 | + * Use the same value as Linux for now. | ||
1367 | 46 | + */ | ||
1368 | 47 | +#define IOV_MAX 1024 | ||
1369 | 48 | #else | ||
1370 | 49 | #include <sys/uio.h> | ||
1371 | 50 | #endif | ||
1372 | 51 | -- | ||
1373 | 52 | 1.7.0.2 | ||
1374 | 53 | |||
1375 | 54 | 0 | ||
1376 | === modified file 'debian/patches/series' | |||
1377 | --- debian/patches/series 2010-04-01 00:22:02 +0000 | |||
1378 | +++ debian/patches/series 2010-06-15 15:07:26 +0000 | |||
1379 | @@ -1,11 +1,3 @@ | |||
1380 | 1 | 05_improve-qemu-img-errors.patch | ||
1381 | 2 | 0001-linux-user-adapt-uname-machine-to-emulated-CPU.patch | ||
1382 | 3 | 0001-Fix-missing-symbols-in-.rel-.rela.plt-sections.patch | 1 | 0001-Fix-missing-symbols-in-.rel-.rela.plt-sections.patch |
1383 | 4 | Detect-and-use-GCC-atomic-builtins-for-locking.patch | ||
1384 | 5 | This-patch-adds-support-for-the-pselect-syscall-in-l.patch | ||
1385 | 6 | arm-host-fix-compiler-warning.patch | ||
1386 | 7 | better_describe_-net_options.patch | ||
1387 | 8 | block_avoid_creating_too_large_iovecs_in_multiwrite_merge.patch | ||
1388 | 9 | arm-higher-initrd-load-address.patch | 2 | arm-higher-initrd-load-address.patch |
1389 | 10 | larger_default_ram_size.patch | 3 | larger_default_ram_size.patch |
1390 | 11 | SDL-wrong-behaviour-of-caps-lock.patch | ||
1391 | 12 | 4 | ||
1392 | === modified file 'debian/rules' | |||
1393 | --- debian/rules 2010-04-23 18:45:55 +0000 | |||
1394 | +++ debian/rules 2010-06-15 15:07:26 +0000 | |||
1395 | @@ -7,6 +7,17 @@ | |||
1396 | 7 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | 7 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
1397 | 8 | DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) | 8 | DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
1398 | 9 | 9 | ||
1399 | 10 | ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) | ||
1400 | 11 | INSTALL_PROGRAM += -s | ||
1401 | 12 | endif | ||
1402 | 13 | |||
1403 | 14 | # Handle DEB_BUILD_OPTIONS=parallel=N | ||
1404 | 15 | , := , | ||
1405 | 16 | ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS)))) | ||
1406 | 17 | NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS)))) | ||
1407 | 18 | MAKEFLAGS += -j$(NUMJOBS) | ||
1408 | 19 | endif | ||
1409 | 20 | |||
1410 | 10 | ifeq ($(DEB_HOST_ARCH_OS),linux) | 21 | ifeq ($(DEB_HOST_ARCH_OS),linux) |
1411 | 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. |
1412 | 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. |
1413 | 13 | 24 | ||
1414 | === modified file 'default-configs/sh4-softmmu.mak' | |||
1415 | --- default-configs/sh4-softmmu.mak 2010-01-20 17:54:24 +0000 | |||
1416 | +++ default-configs/sh4-softmmu.mak 2010-06-15 15:07:26 +0000 | |||
1417 | @@ -2,3 +2,4 @@ | |||
1418 | 2 | 2 | ||
1419 | 3 | CONFIG_USB_OHCI=y | 3 | CONFIG_USB_OHCI=y |
1420 | 4 | CONFIG_PTIMER=y | 4 | CONFIG_PTIMER=y |
1421 | 5 | CONFIG_ISA_MMIO=y | ||
1422 | 5 | 6 | ||
1423 | === modified file 'default-configs/sh4eb-softmmu.mak' | |||
1424 | --- default-configs/sh4eb-softmmu.mak 2010-01-20 17:54:24 +0000 | |||
1425 | +++ default-configs/sh4eb-softmmu.mak 2010-06-15 15:07:26 +0000 | |||
1426 | @@ -2,3 +2,4 @@ | |||
1427 | 2 | 2 | ||
1428 | 3 | CONFIG_USB_OHCI=y | 3 | CONFIG_USB_OHCI=y |
1429 | 4 | CONFIG_PTIMER=y | 4 | CONFIG_PTIMER=y |
1430 | 5 | CONFIG_ISA_MMIO=y | ||
1431 | 5 | 6 | ||
1432 | === modified file 'dyngen-exec.h' | |||
1433 | --- dyngen-exec.h 2010-01-20 17:54:24 +0000 | |||
1434 | +++ dyngen-exec.h 2010-06-15 15:07:26 +0000 | |||
1435 | @@ -69,9 +69,9 @@ | |||
1436 | 69 | #define AREG1 "r14" | 69 | #define AREG1 "r14" |
1437 | 70 | #define AREG2 "r15" | 70 | #define AREG2 "r15" |
1438 | 71 | #elif defined(__mips__) | 71 | #elif defined(__mips__) |
1442 | 72 | #define AREG0 "fp" | 72 | #define AREG0 "s0" |
1443 | 73 | #define AREG1 "s0" | 73 | #define AREG1 "s1" |
1444 | 74 | #define AREG2 "s1" | 74 | #define AREG2 "fp" |
1445 | 75 | #elif defined(__sparc__) | 75 | #elif defined(__sparc__) |
1446 | 76 | #ifdef CONFIG_SOLARIS | 76 | #ifdef CONFIG_SOLARIS |
1447 | 77 | #define AREG0 "g2" | 77 | #define AREG0 "g2" |
1448 | 78 | 78 | ||
1449 | === modified file 'hw/device-assignment.c' | |||
1450 | --- hw/device-assignment.c 2010-01-21 16:22:13 +0000 | |||
1451 | +++ hw/device-assignment.c 2010-06-15 15:07:26 +0000 | |||
1452 | @@ -1311,77 +1311,6 @@ | |||
1453 | 1311 | } | 1311 | } |
1454 | 1312 | } | 1312 | } |
1455 | 1313 | 1313 | ||
1456 | 1314 | /* Option ROM header */ | ||
1457 | 1315 | struct option_rom_header { | ||
1458 | 1316 | uint8_t signature[2]; | ||
1459 | 1317 | uint8_t rom_size; | ||
1460 | 1318 | uint32_t entry_point; | ||
1461 | 1319 | uint8_t reserved[17]; | ||
1462 | 1320 | uint16_t pci_header_offset; | ||
1463 | 1321 | uint16_t expansion_header_offset; | ||
1464 | 1322 | } __attribute__ ((packed)); | ||
1465 | 1323 | |||
1466 | 1324 | /* Option ROM PCI data structure */ | ||
1467 | 1325 | struct option_rom_pci_header { | ||
1468 | 1326 | uint8_t signature[4]; | ||
1469 | 1327 | uint16_t vendor_id; | ||
1470 | 1328 | uint16_t device_id; | ||
1471 | 1329 | uint16_t vital_product_data_offset; | ||
1472 | 1330 | uint16_t structure_length; | ||
1473 | 1331 | uint8_t structure_revision; | ||
1474 | 1332 | uint8_t class_code[3]; | ||
1475 | 1333 | uint16_t image_length; | ||
1476 | 1334 | uint16_t image_revision; | ||
1477 | 1335 | uint8_t code_type; | ||
1478 | 1336 | uint8_t indicator; | ||
1479 | 1337 | uint16_t reserved; | ||
1480 | 1338 | } __attribute__ ((packed)); | ||
1481 | 1339 | |||
1482 | 1340 | /* | ||
1483 | 1341 | * Scan the list of Option ROMs at roms. If a suitable Option ROM is found, | ||
1484 | 1342 | * allocate a ram space and copy it there. Then return its size aligned to | ||
1485 | 1343 | * both 2KB and target page size. | ||
1486 | 1344 | */ | ||
1487 | 1345 | #define OPTION_ROM_ALIGN(x) (((x) + 2047) & ~2047) | ||
1488 | 1346 | static void scan_option_rom(const char *name, uint8_t devfn, void *roms) | ||
1489 | 1347 | { | ||
1490 | 1348 | int i, size; | ||
1491 | 1349 | uint8_t csum; | ||
1492 | 1350 | struct option_rom_header *rom; | ||
1493 | 1351 | struct option_rom_pci_header *pcih; | ||
1494 | 1352 | |||
1495 | 1353 | rom = roms; | ||
1496 | 1354 | |||
1497 | 1355 | for ( ; ; ) { | ||
1498 | 1356 | /* Invalid signature means we're out of option ROMs. */ | ||
1499 | 1357 | if (strncmp((char *)rom->signature, "\x55\xaa", 2) || | ||
1500 | 1358 | (rom->rom_size == 0)) | ||
1501 | 1359 | break; | ||
1502 | 1360 | |||
1503 | 1361 | size = rom->rom_size * 512; | ||
1504 | 1362 | /* Invalid checksum means we're out of option ROMs. */ | ||
1505 | 1363 | csum = 0; | ||
1506 | 1364 | for (i = 0; i < size; i++) | ||
1507 | 1365 | csum += ((uint8_t *)rom)[i]; | ||
1508 | 1366 | if (csum != 0) | ||
1509 | 1367 | break; | ||
1510 | 1368 | |||
1511 | 1369 | /* Check the PCI header (if any) for a match. */ | ||
1512 | 1370 | pcih = (struct option_rom_pci_header *) | ||
1513 | 1371 | ((char *)rom + rom->pci_header_offset); | ||
1514 | 1372 | if ((rom->pci_header_offset != 0) && | ||
1515 | 1373 | !strncmp((char *)pcih->signature, "PCIR", 4)) | ||
1516 | 1374 | goto found; | ||
1517 | 1375 | |||
1518 | 1376 | rom = (struct option_rom_header *)((char *)rom + size); | ||
1519 | 1377 | } | ||
1520 | 1378 | return; | ||
1521 | 1379 | |||
1522 | 1380 | found: | ||
1523 | 1381 | rom_add_blob(name ? name : "assigned device", rom, size, 0); | ||
1524 | 1382 | return; | ||
1525 | 1383 | } | ||
1526 | 1384 | |||
1527 | 1385 | /* | 1314 | /* |
1528 | 1386 | * Scan the assigned devices for the devices that have an option ROM, and then | 1315 | * Scan the assigned devices for the devices that have an option ROM, and then |
1529 | 1387 | * load the corresponding ROM data to RAM. If an error occurs while loading an | 1316 | * load the corresponding ROM data to RAM. If an error occurs while loading an |
1530 | @@ -1445,9 +1374,5 @@ | |||
1531 | 1445 | size, PROT_READ); | 1374 | size, PROT_READ); |
1532 | 1446 | } | 1375 | } |
1533 | 1447 | 1376 | ||
1534 | 1448 | if (!dev->dev.qdev.hotplugged) { | ||
1535 | 1449 | /* Scan the buffer for suitable ROMs and increase the offset */ | ||
1536 | 1450 | scan_option_rom(dev->dev.qdev.id, dev->dev.devfn, buf); | ||
1537 | 1451 | } | ||
1538 | 1452 | free(buf); | 1377 | free(buf); |
1539 | 1453 | } | 1378 | } |
1540 | 1454 | 1379 | ||
1541 | === modified file 'hw/fdc.c' | |||
1542 | --- hw/fdc.c 2010-01-20 17:54:24 +0000 | |||
1543 | +++ hw/fdc.c 2010-06-15 15:07:26 +0000 | |||
1544 | @@ -1860,8 +1860,12 @@ | |||
1545 | 1860 | ISADevice *dev; | 1860 | ISADevice *dev; |
1546 | 1861 | 1861 | ||
1547 | 1862 | dev = isa_create("isa-fdc"); | 1862 | dev = isa_create("isa-fdc"); |
1550 | 1863 | qdev_prop_set_drive(&dev->qdev, "driveA", fds[0]); | 1863 | if (fds[0]) { |
1551 | 1864 | qdev_prop_set_drive(&dev->qdev, "driveB", fds[1]); | 1864 | qdev_prop_set_drive(&dev->qdev, "driveA", fds[0]); |
1552 | 1865 | } | ||
1553 | 1866 | if (fds[1]) { | ||
1554 | 1867 | qdev_prop_set_drive(&dev->qdev, "driveB", fds[1]); | ||
1555 | 1868 | } | ||
1556 | 1865 | if (qdev_init(&dev->qdev) < 0) | 1869 | if (qdev_init(&dev->qdev) < 0) |
1557 | 1866 | return NULL; | 1870 | return NULL; |
1558 | 1867 | return &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state); | 1871 | return &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state); |
1559 | @@ -1879,8 +1883,12 @@ | |||
1560 | 1879 | sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev); | 1883 | sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev); |
1561 | 1880 | fdctrl = &sys->state; | 1884 | fdctrl = &sys->state; |
1562 | 1881 | fdctrl->dma_chann = dma_chann; /* FIXME */ | 1885 | fdctrl->dma_chann = dma_chann; /* FIXME */ |
1565 | 1882 | qdev_prop_set_drive(dev, "driveA", fds[0]); | 1886 | if (fds[0]) { |
1566 | 1883 | qdev_prop_set_drive(dev, "driveB", fds[1]); | 1887 | qdev_prop_set_drive(dev, "driveA", fds[0]); |
1567 | 1888 | } | ||
1568 | 1889 | if (fds[1]) { | ||
1569 | 1890 | qdev_prop_set_drive(dev, "driveB", fds[1]); | ||
1570 | 1891 | } | ||
1571 | 1884 | qdev_init_nofail(dev); | 1892 | qdev_init_nofail(dev); |
1572 | 1885 | sysbus_connect_irq(&sys->busdev, 0, irq); | 1893 | sysbus_connect_irq(&sys->busdev, 0, irq); |
1573 | 1886 | sysbus_mmio_map(&sys->busdev, 0, mmio_base); | 1894 | sysbus_mmio_map(&sys->busdev, 0, mmio_base); |
1574 | @@ -1896,7 +1904,9 @@ | |||
1575 | 1896 | fdctrl_t *fdctrl; | 1904 | fdctrl_t *fdctrl; |
1576 | 1897 | 1905 | ||
1577 | 1898 | dev = qdev_create(NULL, "SUNW,fdtwo"); | 1906 | dev = qdev_create(NULL, "SUNW,fdtwo"); |
1579 | 1899 | qdev_prop_set_drive(dev, "drive", fds[0]); | 1907 | if (fds[0]) { |
1580 | 1908 | qdev_prop_set_drive(dev, "drive", fds[0]); | ||
1581 | 1909 | } | ||
1582 | 1900 | qdev_init_nofail(dev); | 1910 | qdev_init_nofail(dev); |
1583 | 1901 | sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev); | 1911 | sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev); |
1584 | 1902 | fdctrl = &sys->state; | 1912 | fdctrl = &sys->state; |
1585 | 1903 | 1913 | ||
1586 | === modified file 'hw/fw_cfg.c' | |||
1587 | --- hw/fw_cfg.c 2010-01-21 16:22:13 +0000 | |||
1588 | +++ hw/fw_cfg.c 2010-06-15 15:07:26 +0000 | |||
1589 | @@ -179,7 +179,7 @@ | |||
1590 | 179 | 179 | ||
1591 | 180 | static void put_unused(QEMUFile *f, void *pv, size_t size) | 180 | static void put_unused(QEMUFile *f, void *pv, size_t size) |
1592 | 181 | { | 181 | { |
1594 | 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"); |
1595 | 183 | fprintf(stderr, "This functions shouldn't be called.\n"); | 183 | fprintf(stderr, "This functions shouldn't be called.\n"); |
1596 | 184 | } | 184 | } |
1597 | 185 | 185 | ||
1598 | 186 | 186 | ||
1599 | === modified file 'hw/ide/cmd646.c' | |||
1600 | --- hw/ide/cmd646.c 2010-01-20 17:54:24 +0000 | |||
1601 | +++ hw/ide/cmd646.c 2010-06-15 15:07:26 +0000 | |||
1602 | @@ -70,11 +70,7 @@ | |||
1603 | 70 | 70 | ||
1604 | 71 | static PCIIDEState *pci_from_bm(BMDMAState *bm) | 71 | static PCIIDEState *pci_from_bm(BMDMAState *bm) |
1605 | 72 | { | 72 | { |
1611 | 73 | if (bm->unit == 0) { | 73 | return bm->pci_dev; |
1607 | 74 | return container_of(bm, PCIIDEState, bmdma[0]); | ||
1608 | 75 | } else { | ||
1609 | 76 | return container_of(bm, PCIIDEState, bmdma[1]); | ||
1610 | 77 | } | ||
1612 | 78 | } | 74 | } |
1613 | 79 | 75 | ||
1614 | 80 | static uint32_t bmdma_readb(void *opaque, uint32_t addr) | 76 | static uint32_t bmdma_readb(void *opaque, uint32_t addr) |
1615 | @@ -145,6 +141,7 @@ | |||
1616 | 145 | BMDMAState *bm = &d->bmdma[i]; | 141 | BMDMAState *bm = &d->bmdma[i]; |
1617 | 146 | d->bus[i].bmdma = bm; | 142 | d->bus[i].bmdma = bm; |
1618 | 147 | bm->bus = d->bus+i; | 143 | bm->bus = d->bus+i; |
1619 | 144 | bm->pci_dev = d; | ||
1620 | 148 | qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); | 145 | qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); |
1621 | 149 | 146 | ||
1622 | 150 | register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); | 147 | register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); |
1623 | 151 | 148 | ||
1624 | === modified file 'hw/ide/internal.h' | |||
1625 | --- hw/ide/internal.h 2010-02-26 16:26:00 +0000 | |||
1626 | +++ hw/ide/internal.h 2010-06-15 15:07:26 +0000 | |||
1627 | @@ -481,6 +481,7 @@ | |||
1628 | 481 | uint8_t status; | 481 | uint8_t status; |
1629 | 482 | uint32_t addr; | 482 | uint32_t addr; |
1630 | 483 | 483 | ||
1631 | 484 | struct PCIIDEState *pci_dev; | ||
1632 | 484 | IDEBus *bus; | 485 | IDEBus *bus; |
1633 | 485 | /* current transfer state */ | 486 | /* current transfer state */ |
1634 | 486 | uint32_t cur_addr; | 487 | uint32_t cur_addr; |
1635 | 487 | 488 | ||
1636 | === modified file 'hw/ide/piix.c' | |||
1637 | --- hw/ide/piix.c 2010-01-20 17:54:24 +0000 | |||
1638 | +++ hw/ide/piix.c 2010-06-15 15:07:26 +0000 | |||
1639 | @@ -78,6 +78,7 @@ | |||
1640 | 78 | BMDMAState *bm = &d->bmdma[i]; | 78 | BMDMAState *bm = &d->bmdma[i]; |
1641 | 79 | d->bus[i].bmdma = bm; | 79 | d->bus[i].bmdma = bm; |
1642 | 80 | bm->bus = d->bus+i; | 80 | bm->bus = d->bus+i; |
1643 | 81 | bm->pci_dev = d; | ||
1644 | 81 | qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); | 82 | qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); |
1645 | 82 | 83 | ||
1646 | 83 | register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); | 84 | register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); |
1647 | 84 | 85 | ||
1648 | === modified file 'hw/lsi53c895a.c' | |||
1649 | --- hw/lsi53c895a.c 2010-01-20 17:54:24 +0000 | |||
1650 | +++ hw/lsi53c895a.c 2010-06-15 15:07:26 +0000 | |||
1651 | @@ -173,11 +173,15 @@ | |||
1652 | 173 | /* Flag set if this is a tagged command. */ | 173 | /* Flag set if this is a tagged command. */ |
1653 | 174 | #define LSI_TAG_VALID (1 << 16) | 174 | #define LSI_TAG_VALID (1 << 16) |
1654 | 175 | 175 | ||
1656 | 176 | typedef struct { | 176 | typedef struct lsi_request { |
1657 | 177 | uint32_t tag; | 177 | uint32_t tag; |
1658 | 178 | SCSIDevice *dev; | ||
1659 | 179 | uint32_t dma_len; | ||
1660 | 180 | uint8_t *dma_buf; | ||
1661 | 178 | uint32_t pending; | 181 | uint32_t pending; |
1662 | 179 | int out; | 182 | int out; |
1664 | 180 | } lsi_queue; | 183 | QTAILQ_ENTRY(lsi_request) next; |
1665 | 184 | } lsi_request; | ||
1666 | 181 | 185 | ||
1667 | 182 | typedef struct { | 186 | typedef struct { |
1668 | 183 | PCIDevice dev; | 187 | PCIDevice dev; |
1669 | @@ -198,16 +202,13 @@ | |||
1670 | 198 | * 3 if a DMA operation is in progress. */ | 202 | * 3 if a DMA operation is in progress. */ |
1671 | 199 | int waiting; | 203 | int waiting; |
1672 | 200 | SCSIBus bus; | 204 | SCSIBus bus; |
1674 | 201 | SCSIDevice *current_dev; | 205 | SCSIDevice *select_dev; |
1675 | 202 | int current_lun; | 206 | int current_lun; |
1676 | 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. */ |
1679 | 204 | uint32_t current_tag; | 208 | uint32_t select_tag; |
1678 | 205 | uint32_t current_dma_len; | ||
1680 | 206 | int command_complete; | 209 | int command_complete; |
1685 | 207 | uint8_t *dma_buf; | 210 | QTAILQ_HEAD(, lsi_request) queue; |
1686 | 208 | lsi_queue *queue; | 211 | lsi_request *current; |
1683 | 209 | int queue_len; | ||
1684 | 210 | int active_commands; | ||
1687 | 211 | 212 | ||
1688 | 212 | uint32_t dsa; | 213 | uint32_t dsa; |
1689 | 213 | uint32_t temp; | 214 | uint32_t temp; |
1690 | @@ -370,7 +371,7 @@ | |||
1691 | 370 | static uint8_t lsi_reg_readb(LSIState *s, int offset); | 371 | static uint8_t lsi_reg_readb(LSIState *s, int offset); |
1692 | 371 | static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val); | 372 | static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val); |
1693 | 372 | static void lsi_execute_script(LSIState *s); | 373 | static void lsi_execute_script(LSIState *s); |
1695 | 373 | static void lsi_reselect(LSIState *s, uint32_t tag); | 374 | static void lsi_reselect(LSIState *s, lsi_request *p); |
1696 | 374 | 375 | ||
1697 | 375 | static inline uint32_t read_dword(LSIState *s, uint32_t addr) | 376 | static inline uint32_t read_dword(LSIState *s, uint32_t addr) |
1698 | 376 | { | 377 | { |
1699 | @@ -391,9 +392,9 @@ | |||
1700 | 391 | 392 | ||
1701 | 392 | static void lsi_update_irq(LSIState *s) | 393 | static void lsi_update_irq(LSIState *s) |
1702 | 393 | { | 394 | { |
1703 | 394 | int i; | ||
1704 | 395 | int level; | 395 | int level; |
1705 | 396 | static int last_level; | 396 | static int last_level; |
1706 | 397 | lsi_request *p; | ||
1707 | 397 | 398 | ||
1708 | 398 | /* It's unclear whether the DIP/SIP bits should be cleared when the | 399 | /* It's unclear whether the DIP/SIP bits should be cleared when the |
1709 | 399 | Interrupt Status Registers are cleared or when istat0 is read. | 400 | Interrupt Status Registers are cleared or when istat0 is read. |
1710 | @@ -427,9 +428,9 @@ | |||
1711 | 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)) { |
1712 | 428 | DPRINTF("Handled IRQs & disconnected, looking for pending " | 429 | DPRINTF("Handled IRQs & disconnected, looking for pending " |
1713 | 429 | "processes\n"); | 430 | "processes\n"); |
1717 | 430 | for (i = 0; i < s->active_commands; i++) { | 431 | QTAILQ_FOREACH(p, &s->queue, next) { |
1718 | 431 | if (s->queue[i].pending) { | 432 | if (p->pending) { |
1719 | 432 | lsi_reselect(s, s->queue[i].tag); | 433 | lsi_reselect(s, p); |
1720 | 433 | break; | 434 | break; |
1721 | 434 | } | 435 | } |
1722 | 435 | } | 436 | } |
1723 | @@ -508,15 +509,16 @@ | |||
1724 | 508 | uint32_t count; | 509 | uint32_t count; |
1725 | 509 | target_phys_addr_t addr; | 510 | target_phys_addr_t addr; |
1726 | 510 | 511 | ||
1728 | 511 | if (!s->current_dma_len) { | 512 | assert(s->current); |
1729 | 513 | if (!s->current->dma_len) { | ||
1730 | 512 | /* Wait until data is available. */ | 514 | /* Wait until data is available. */ |
1731 | 513 | DPRINTF("DMA no data available\n"); | 515 | DPRINTF("DMA no data available\n"); |
1732 | 514 | return; | 516 | return; |
1733 | 515 | } | 517 | } |
1734 | 516 | 518 | ||
1735 | 517 | count = s->dbc; | 519 | count = s->dbc; |
1738 | 518 | if (count > s->current_dma_len) | 520 | if (count > s->current->dma_len) |
1739 | 519 | count = s->current_dma_len; | 521 | count = s->current->dma_len; |
1740 | 520 | 522 | ||
1741 | 521 | addr = s->dnad; | 523 | addr = s->dnad; |
1742 | 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 */ |
1743 | @@ -532,29 +534,29 @@ | |||
1744 | 532 | s->dnad += count; | 534 | s->dnad += count; |
1745 | 533 | s->dbc -= count; | 535 | s->dbc -= count; |
1746 | 534 | 536 | ||
1750 | 535 | if (s->dma_buf == NULL) { | 537 | if (s->current->dma_buf == NULL) { |
1751 | 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, |
1752 | 537 | s->current_tag); | 539 | s->current->tag); |
1753 | 538 | } | 540 | } |
1754 | 539 | 541 | ||
1755 | 540 | /* ??? Set SFBR to first data byte. */ | 542 | /* ??? Set SFBR to first data byte. */ |
1756 | 541 | if (out) { | 543 | if (out) { |
1758 | 542 | cpu_physical_memory_read(addr, s->dma_buf, count); | 544 | cpu_physical_memory_read(addr, s->current->dma_buf, count); |
1759 | 543 | } else { | 545 | } else { |
1761 | 544 | cpu_physical_memory_write(addr, s->dma_buf, count); | 546 | cpu_physical_memory_write(addr, s->current->dma_buf, count); |
1762 | 545 | } | 547 | } |
1766 | 546 | s->current_dma_len -= count; | 548 | s->current->dma_len -= count; |
1767 | 547 | if (s->current_dma_len == 0) { | 549 | if (s->current->dma_len == 0) { |
1768 | 548 | s->dma_buf = NULL; | 550 | s->current->dma_buf = NULL; |
1769 | 549 | if (out) { | 551 | if (out) { |
1770 | 550 | /* Write the data. */ | 552 | /* Write the data. */ |
1772 | 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); |
1773 | 552 | } else { | 554 | } else { |
1774 | 553 | /* Request any remaining data. */ | 555 | /* Request any remaining data. */ |
1776 | 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); |
1777 | 555 | } | 557 | } |
1778 | 556 | } else { | 558 | } else { |
1780 | 557 | s->dma_buf += count; | 559 | s->current->dma_buf += count; |
1781 | 558 | lsi_resume_script(s); | 560 | lsi_resume_script(s); |
1782 | 559 | } | 561 | } |
1783 | 560 | } | 562 | } |
1784 | @@ -563,15 +565,14 @@ | |||
1785 | 563 | /* Add a command to the queue. */ | 565 | /* Add a command to the queue. */ |
1786 | 564 | static void lsi_queue_command(LSIState *s) | 566 | static void lsi_queue_command(LSIState *s) |
1787 | 565 | { | 567 | { |
1789 | 566 | lsi_queue *p; | 568 | lsi_request *p = s->current; |
1790 | 567 | 569 | ||
1791 | 568 | DPRINTF("Queueing tag=0x%x\n", s->current_tag); | 570 | DPRINTF("Queueing tag=0x%x\n", s->current_tag); |
1798 | 569 | if (s->queue_len == s->active_commands) { | 571 | assert(s->current != NULL); |
1799 | 570 | s->queue_len++; | 572 | assert(s->current->dma_len == 0); |
1800 | 571 | s->queue = qemu_realloc(s->queue, s->queue_len * sizeof(lsi_queue)); | 573 | QTAILQ_INSERT_TAIL(&s->queue, s->current, next); |
1801 | 572 | } | 574 | s->current = NULL; |
1802 | 573 | p = &s->queue[s->active_commands++]; | 575 | |
1797 | 574 | p->tag = s->current_tag; | ||
1803 | 575 | p->pending = 0; | 576 | p->pending = 0; |
1804 | 576 | p->out = (s->sstat1 & PHASE_MASK) == PHASE_DO; | 577 | p->out = (s->sstat1 & PHASE_MASK) == PHASE_DO; |
1805 | 577 | } | 578 | } |
1806 | @@ -588,45 +589,29 @@ | |||
1807 | 588 | } | 589 | } |
1808 | 589 | 590 | ||
1809 | 590 | /* Perform reselection to continue a command. */ | 591 | /* Perform reselection to continue a command. */ |
1811 | 591 | static void lsi_reselect(LSIState *s, uint32_t tag) | 592 | static void lsi_reselect(LSIState *s, lsi_request *p) |
1812 | 592 | { | 593 | { |
1813 | 593 | lsi_queue *p; | ||
1814 | 594 | int n; | ||
1815 | 595 | int id; | 594 | int id; |
1816 | 596 | 595 | ||
1828 | 597 | p = NULL; | 596 | assert(s->current == NULL); |
1829 | 598 | for (n = 0; n < s->active_commands; n++) { | 597 | QTAILQ_REMOVE(&s->queue, p, next); |
1830 | 599 | p = &s->queue[n]; | 598 | s->current = p; |
1831 | 600 | if (p->tag == tag) | 599 | |
1832 | 601 | break; | 600 | id = (p->tag >> 8) & 0xf; |
1822 | 602 | } | ||
1823 | 603 | if (n == s->active_commands) { | ||
1824 | 604 | BADF("Reselected non-existant command tag=0x%x\n", tag); | ||
1825 | 605 | return; | ||
1826 | 606 | } | ||
1827 | 607 | id = (tag >> 8) & 0xf; | ||
1833 | 608 | s->ssid = id | 0x80; | 601 | s->ssid = id | 0x80; |
1834 | 609 | /* LSI53C700 Family Compatibility, see LSI53C895A 4-73 */ | 602 | /* LSI53C700 Family Compatibility, see LSI53C895A 4-73 */ |
1835 | 610 | if (!s->dcntl & LSI_DCNTL_COM) { | 603 | if (!s->dcntl & LSI_DCNTL_COM) { |
1836 | 611 | s->sfbr = 1 << (id & 0x7); | 604 | s->sfbr = 1 << (id & 0x7); |
1837 | 612 | } | 605 | } |
1838 | 613 | DPRINTF("Reselected target %d\n", id); | 606 | DPRINTF("Reselected target %d\n", id); |
1839 | 614 | s->current_dev = s->bus.devs[id]; | ||
1840 | 615 | s->current_tag = tag; | ||
1841 | 616 | s->scntl1 |= LSI_SCNTL1_CON; | 607 | s->scntl1 |= LSI_SCNTL1_CON; |
1842 | 617 | lsi_set_phase(s, PHASE_MI); | 608 | lsi_set_phase(s, PHASE_MI); |
1843 | 618 | s->msg_action = p->out ? 2 : 3; | 609 | s->msg_action = p->out ? 2 : 3; |
1846 | 619 | s->current_dma_len = p->pending; | 610 | s->current->dma_len = p->pending; |
1845 | 620 | s->dma_buf = NULL; | ||
1847 | 621 | lsi_add_msg_byte(s, 0x80); | 611 | lsi_add_msg_byte(s, 0x80); |
1849 | 622 | if (s->current_tag & LSI_TAG_VALID) { | 612 | if (s->current->tag & LSI_TAG_VALID) { |
1850 | 623 | lsi_add_msg_byte(s, 0x20); | 613 | lsi_add_msg_byte(s, 0x20); |
1857 | 624 | lsi_add_msg_byte(s, tag & 0xff); | 614 | lsi_add_msg_byte(s, p->tag & 0xff); |
1852 | 625 | } | ||
1853 | 626 | |||
1854 | 627 | s->active_commands--; | ||
1855 | 628 | if (n != s->active_commands) { | ||
1856 | 629 | s->queue[n] = s->queue[s->active_commands]; | ||
1858 | 630 | } | 615 | } |
1859 | 631 | 616 | ||
1860 | 632 | if (lsi_irq_on_rsl(s)) { | 617 | if (lsi_irq_on_rsl(s)) { |
1861 | @@ -638,10 +623,9 @@ | |||
1862 | 638 | the device was reselected, nonzero if the IO is deferred. */ | 623 | the device was reselected, nonzero if the IO is deferred. */ |
1863 | 639 | static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg) | 624 | static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg) |
1864 | 640 | { | 625 | { |
1869 | 641 | lsi_queue *p; | 626 | lsi_request *p; |
1870 | 642 | int i; | 627 | |
1871 | 643 | for (i = 0; i < s->active_commands; i++) { | 628 | QTAILQ_FOREACH(p, &s->queue, next) { |
1868 | 644 | p = &s->queue[i]; | ||
1872 | 645 | if (p->tag == tag) { | 629 | if (p->tag == tag) { |
1873 | 646 | if (p->pending) { | 630 | if (p->pending) { |
1874 | 647 | BADF("Multiple IO pending for tag %d\n", tag); | 631 | BADF("Multiple IO pending for tag %d\n", tag); |
1875 | @@ -656,10 +640,10 @@ | |||
1876 | 656 | (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON) && | 640 | (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON) && |
1877 | 657 | !(s->istat0 & (LSI_ISTAT0_SIP | LSI_ISTAT0_DIP)))) { | 641 | !(s->istat0 & (LSI_ISTAT0_SIP | LSI_ISTAT0_DIP)))) { |
1878 | 658 | /* Reselect device. */ | 642 | /* Reselect device. */ |
1880 | 659 | lsi_reselect(s, tag); | 643 | lsi_reselect(s, p); |
1881 | 660 | return 0; | 644 | return 0; |
1882 | 661 | } else { | 645 | } else { |
1884 | 662 | DPRINTF("Queueing IO tag=0x%x\n", tag); | 646 | DPRINTF("Queueing IO tag=0x%x\n", tag); |
1885 | 663 | p->pending = arg; | 647 | p->pending = arg; |
1886 | 664 | return 1; | 648 | return 1; |
1887 | 665 | } | 649 | } |
1888 | @@ -687,11 +671,15 @@ | |||
1889 | 687 | } else { | 671 | } else { |
1890 | 688 | lsi_set_phase(s, PHASE_ST); | 672 | lsi_set_phase(s, PHASE_ST); |
1891 | 689 | } | 673 | } |
1892 | 674 | |||
1893 | 675 | qemu_free(s->current); | ||
1894 | 676 | s->current = NULL; | ||
1895 | 677 | |||
1896 | 690 | lsi_resume_script(s); | 678 | lsi_resume_script(s); |
1897 | 691 | return; | 679 | return; |
1898 | 692 | } | 680 | } |
1899 | 693 | 681 | ||
1901 | 694 | if (s->waiting == 1 || tag != s->current_tag || | 682 | if (s->waiting == 1 || !s->current || tag != s->current->tag || |
1902 | 695 | (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) { | 683 | (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) { |
1903 | 696 | if (lsi_queue_tag(s, tag, arg)) | 684 | if (lsi_queue_tag(s, tag, arg)) |
1904 | 697 | return; | 685 | return; |
1905 | @@ -699,7 +687,7 @@ | |||
1906 | 699 | 687 | ||
1907 | 700 | /* host adapter (re)connected */ | 688 | /* host adapter (re)connected */ |
1908 | 701 | DPRINTF("Data ready tag=0x%x len=%d\n", tag, arg); | 689 | DPRINTF("Data ready tag=0x%x len=%d\n", tag, arg); |
1910 | 702 | s->current_dma_len = arg; | 690 | s->current->dma_len = arg; |
1911 | 703 | s->command_complete = 1; | 691 | s->command_complete = 1; |
1912 | 704 | if (!s->waiting) | 692 | if (!s->waiting) |
1913 | 705 | return; | 693 | return; |
1914 | @@ -721,14 +709,20 @@ | |||
1915 | 721 | cpu_physical_memory_read(s->dnad, buf, s->dbc); | 709 | cpu_physical_memory_read(s->dnad, buf, s->dbc); |
1916 | 722 | s->sfbr = buf[0]; | 710 | s->sfbr = buf[0]; |
1917 | 723 | s->command_complete = 0; | 711 | s->command_complete = 0; |
1920 | 724 | n = s->current_dev->info->send_command(s->current_dev, s->current_tag, buf, | 712 | |
1921 | 725 | s->current_lun); | 713 | assert(s->current == NULL); |
1922 | 714 | s->current = qemu_mallocz(sizeof(lsi_request)); | ||
1923 | 715 | s->current->tag = s->select_tag; | ||
1924 | 716 | s->current->dev = s->select_dev; | ||
1925 | 717 | |||
1926 | 718 | n = s->current->dev->info->send_command(s->current->dev, s->current->tag, buf, | ||
1927 | 719 | s->current_lun); | ||
1928 | 726 | if (n > 0) { | 720 | if (n > 0) { |
1929 | 727 | lsi_set_phase(s, PHASE_DI); | 721 | lsi_set_phase(s, PHASE_DI); |
1931 | 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); |
1932 | 729 | } else if (n < 0) { | 723 | } else if (n < 0) { |
1933 | 730 | lsi_set_phase(s, PHASE_DO); | 724 | lsi_set_phase(s, PHASE_DO); |
1935 | 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); |
1936 | 732 | } | 726 | } |
1937 | 733 | 727 | ||
1938 | 734 | if (!s->command_complete) { | 728 | if (!s->command_complete) { |
1939 | @@ -851,16 +845,16 @@ | |||
1940 | 851 | } | 845 | } |
1941 | 852 | break; | 846 | break; |
1942 | 853 | case 0x20: /* SIMPLE queue */ | 847 | case 0x20: /* SIMPLE queue */ |
1944 | 854 | s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; | 848 | s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; |
1945 | 855 | DPRINTF("SIMPLE queue tag=0x%x\n", s->current_tag & 0xff); | 849 | DPRINTF("SIMPLE queue tag=0x%x\n", s->current_tag & 0xff); |
1946 | 856 | break; | 850 | break; |
1947 | 857 | case 0x21: /* HEAD of queue */ | 851 | case 0x21: /* HEAD of queue */ |
1948 | 858 | BADF("HEAD queue not implemented\n"); | 852 | BADF("HEAD queue not implemented\n"); |
1950 | 859 | s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; | 853 | s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; |
1951 | 860 | break; | 854 | break; |
1952 | 861 | case 0x22: /* ORDERED queue */ | 855 | case 0x22: /* ORDERED queue */ |
1953 | 862 | BADF("ORDERED queue not implemented\n"); | 856 | BADF("ORDERED queue not implemented\n"); |
1955 | 863 | s->current_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; | 857 | s->select_tag |= lsi_get_msgbyte(s) | LSI_TAG_VALID; |
1956 | 864 | break; | 858 | break; |
1957 | 865 | default: | 859 | default: |
1958 | 866 | if ((msg & 0x80) == 0) { | 860 | if ((msg & 0x80) == 0) { |
1959 | @@ -905,17 +899,17 @@ | |||
1960 | 905 | 899 | ||
1961 | 906 | static void lsi_wait_reselect(LSIState *s) | 900 | static void lsi_wait_reselect(LSIState *s) |
1962 | 907 | { | 901 | { |
1964 | 908 | int i; | 902 | lsi_request *p; |
1965 | 903 | |||
1966 | 909 | DPRINTF("Wait Reselect\n"); | 904 | DPRINTF("Wait Reselect\n"); |
1972 | 910 | if (s->current_dma_len) | 905 | |
1973 | 911 | BADF("Reselect with pending DMA\n"); | 906 | QTAILQ_FOREACH(p, &s->queue, next) { |
1974 | 912 | for (i = 0; i < s->active_commands; i++) { | 907 | if (p->pending) { |
1975 | 913 | if (s->queue[i].pending) { | 908 | lsi_reselect(s, p); |
1971 | 914 | lsi_reselect(s, s->queue[i].tag); | ||
1976 | 915 | break; | 909 | break; |
1977 | 916 | } | 910 | } |
1978 | 917 | } | 911 | } |
1980 | 918 | if (s->current_dma_len == 0) { | 912 | if (s->current == NULL) { |
1981 | 919 | s->waiting = 1; | 913 | s->waiting = 1; |
1982 | 920 | } | 914 | } |
1983 | 921 | } | 915 | } |
1984 | @@ -1093,8 +1087,8 @@ | |||
1985 | 1093 | /* ??? Linux drivers compain when this is set. Maybe | 1087 | /* ??? Linux drivers compain when this is set. Maybe |
1986 | 1094 | it only applies in low-level mode (unimplemented). | 1088 | it only applies in low-level mode (unimplemented). |
1987 | 1095 | lsi_script_scsi_interrupt(s, LSI_SIST0_CMP, 0); */ | 1089 | lsi_script_scsi_interrupt(s, LSI_SIST0_CMP, 0); */ |
1990 | 1096 | s->current_dev = s->bus.devs[id]; | 1090 | s->select_dev = s->bus.devs[id]; |
1991 | 1097 | s->current_tag = id << 8; | 1091 | s->select_tag = id << 8; |
1992 | 1098 | s->scntl1 |= LSI_SCNTL1_CON; | 1092 | s->scntl1 |= LSI_SCNTL1_CON; |
1993 | 1099 | if (insn & (1 << 3)) { | 1093 | if (insn & (1 << 3)) { |
1994 | 1100 | s->socl |= LSI_SOCL_ATN; | 1094 | s->socl |= LSI_SOCL_ATN; |
1995 | @@ -2006,9 +2000,11 @@ | |||
1996 | 2006 | { | 2000 | { |
1997 | 2007 | LSIState *s = opaque; | 2001 | LSIState *s = opaque; |
1998 | 2008 | 2002 | ||
2002 | 2009 | assert(s->dma_buf == NULL); | 2003 | if (s->current) { |
2003 | 2010 | assert(s->current_dma_len == 0); | 2004 | assert(s->current->dma_buf == NULL); |
2004 | 2011 | assert(s->active_commands == 0); | 2005 | assert(s->current->dma_len == 0); |
2005 | 2006 | } | ||
2006 | 2007 | assert(QTAILQ_EMPTY(&s->queue)); | ||
2007 | 2012 | } | 2008 | } |
2008 | 2013 | 2009 | ||
2009 | 2014 | static const VMStateDescription vmstate_lsi_scsi = { | 2010 | static const VMStateDescription vmstate_lsi_scsi = { |
2010 | @@ -2101,8 +2097,6 @@ | |||
2011 | 2101 | cpu_unregister_io_memory(s->mmio_io_addr); | 2097 | cpu_unregister_io_memory(s->mmio_io_addr); |
2012 | 2102 | cpu_unregister_io_memory(s->ram_io_addr); | 2098 | cpu_unregister_io_memory(s->ram_io_addr); |
2013 | 2103 | 2099 | ||
2014 | 2104 | qemu_free(s->queue); | ||
2015 | 2105 | |||
2016 | 2106 | return 0; | 2100 | return 0; |
2017 | 2107 | } | 2101 | } |
2018 | 2108 | 2102 | ||
2019 | @@ -2138,9 +2132,7 @@ | |||
2020 | 2138 | PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_mmio_mapfunc); | 2132 | PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_mmio_mapfunc); |
2021 | 2139 | pci_register_bar((struct PCIDevice *)s, 2, 0x2000, | 2133 | pci_register_bar((struct PCIDevice *)s, 2, 0x2000, |
2022 | 2140 | PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc); | 2134 | PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc); |
2026 | 2141 | s->queue = qemu_malloc(sizeof(lsi_queue)); | 2135 | QTAILQ_INIT(&s->queue); |
2024 | 2142 | s->queue_len = 1; | ||
2025 | 2143 | s->active_commands = 0; | ||
2027 | 2144 | 2136 | ||
2028 | 2145 | lsi_soft_reset(s); | 2137 | lsi_soft_reset(s); |
2029 | 2146 | 2138 | ||
2030 | 2147 | 2139 | ||
2031 | === modified file 'hw/scsi-disk.c' | |||
2032 | --- hw/scsi-disk.c 2010-02-26 16:26:00 +0000 | |||
2033 | +++ hw/scsi-disk.c 2010-06-15 15:07:26 +0000 | |||
2034 | @@ -434,7 +434,9 @@ | |||
2035 | 434 | memcpy(&outbuf[16], "QEMU HARDDISK ", 16); | 434 | memcpy(&outbuf[16], "QEMU HARDDISK ", 16); |
2036 | 435 | } | 435 | } |
2037 | 436 | memcpy(&outbuf[8], "QEMU ", 8); | 436 | memcpy(&outbuf[8], "QEMU ", 8); |
2039 | 437 | memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION, 4); | 437 | memset(&outbuf[32], 0, 4); |
2040 | 438 | memcpy(&outbuf[32], s->version ? s->version : QEMU_VERSION, | ||
2041 | 439 | MIN(4, strlen(s->version ? s->version : QEMU_VERSION))); | ||
2042 | 438 | /* Identify device as SCSI-3 rev 1. | 440 | /* Identify device as SCSI-3 rev 1. |
2043 | 439 | Some later commands are also implemented. */ | 441 | Some later commands are also implemented. */ |
2044 | 440 | outbuf[2] = 3; | 442 | outbuf[2] = 3; |
2045 | 441 | 443 | ||
2046 | === modified file 'hw/sh7750.c' | |||
2047 | --- hw/sh7750.c 2010-01-20 17:54:24 +0000 | |||
2048 | +++ hw/sh7750.c 2010-06-15 15:07:26 +0000 | |||
2049 | @@ -396,8 +396,11 @@ | |||
2050 | 396 | portb_changed(s, temp); | 396 | portb_changed(s, temp); |
2051 | 397 | return; | 397 | return; |
2052 | 398 | case SH7750_MMUCR_A7: | 398 | case SH7750_MMUCR_A7: |
2055 | 399 | s->cpu->mmucr = mem_value; | 399 | if (mem_value & MMUCR_TI) { |
2056 | 400 | return; | 400 | cpu_sh4_invalidate_tlb(s->cpu); |
2057 | 401 | } | ||
2058 | 402 | s->cpu->mmucr = mem_value & ~MMUCR_TI; | ||
2059 | 403 | return; | ||
2060 | 401 | case SH7750_PTEH_A7: | 404 | case SH7750_PTEH_A7: |
2061 | 402 | /* If asid changes, clear all registered tlb entries. */ | 405 | /* If asid changes, clear all registered tlb entries. */ |
2062 | 403 | if ((s->cpu->pteh & 0xff) != (mem_value & 0xff)) | 406 | if ((s->cpu->pteh & 0xff) != (mem_value & 0xff)) |
2063 | 404 | 407 | ||
2064 | === modified file 'hw/sh_pci.c' | |||
2065 | --- hw/sh_pci.c 2010-01-20 17:54:24 +0000 | |||
2066 | +++ hw/sh_pci.c 2010-06-15 15:07:26 +0000 | |||
2067 | @@ -47,10 +47,15 @@ | |||
2068 | 47 | pcic->par = val; | 47 | pcic->par = val; |
2069 | 48 | break; | 48 | break; |
2070 | 49 | case 0x1c4: | 49 | case 0x1c4: |
2072 | 50 | pcic->mbr = val; | 50 | pcic->mbr = val & 0xff000001; |
2073 | 51 | break; | 51 | break; |
2074 | 52 | case 0x1c8: | 52 | case 0x1c8: |
2076 | 53 | pcic->iobr = val; | 53 | if ((val & 0xfffc0000) != (pcic->iobr & 0xfffc0000)) { |
2077 | 54 | cpu_register_physical_memory(pcic->iobr & 0xfffc0000, 0x40000, | ||
2078 | 55 | IO_MEM_UNASSIGNED); | ||
2079 | 56 | pcic->iobr = val & 0xfffc0001; | ||
2080 | 57 | isa_mmio_init(pcic->iobr & 0xfffc0000, 0x40000); | ||
2081 | 58 | } | ||
2082 | 54 | break; | 59 | break; |
2083 | 55 | case 0x220: | 60 | case 0x220: |
2084 | 56 | pci_data_write(pcic->bus, pcic->par, val, 4); | 61 | pci_data_write(pcic->bus, pcic->par, val, 4); |
2085 | @@ -66,89 +71,16 @@ | |||
2086 | 66 | return le32_to_cpup((uint32_t*)(pcic->dev->config + addr)); | 71 | return le32_to_cpup((uint32_t*)(pcic->dev->config + addr)); |
2087 | 67 | case 0x1c0: | 72 | case 0x1c0: |
2088 | 68 | return pcic->par; | 73 | return pcic->par; |
2089 | 74 | case 0x1c4: | ||
2090 | 75 | return pcic->mbr; | ||
2091 | 76 | case 0x1c8: | ||
2092 | 77 | return pcic->iobr; | ||
2093 | 69 | case 0x220: | 78 | case 0x220: |
2094 | 70 | return pci_data_read(pcic->bus, pcic->par, 4); | 79 | return pci_data_read(pcic->bus, pcic->par, 4); |
2095 | 71 | } | 80 | } |
2096 | 72 | return 0; | 81 | return 0; |
2097 | 73 | } | 82 | } |
2098 | 74 | 83 | ||
2099 | 75 | static void sh_pci_data_write (SHPCIC *pcic, target_phys_addr_t addr, | ||
2100 | 76 | uint32_t val, int size) | ||
2101 | 77 | { | ||
2102 | 78 | pci_data_write(pcic->bus, addr + pcic->mbr, val, size); | ||
2103 | 79 | } | ||
2104 | 80 | |||
2105 | 81 | static uint32_t sh_pci_mem_read (SHPCIC *pcic, target_phys_addr_t addr, | ||
2106 | 82 | int size) | ||
2107 | 83 | { | ||
2108 | 84 | return pci_data_read(pcic->bus, addr + pcic->mbr, size); | ||
2109 | 85 | } | ||
2110 | 86 | |||
2111 | 87 | static void sh_pci_writeb (void *p, target_phys_addr_t addr, uint32_t val) | ||
2112 | 88 | { | ||
2113 | 89 | sh_pci_data_write(p, addr, val, 1); | ||
2114 | 90 | } | ||
2115 | 91 | |||
2116 | 92 | static void sh_pci_writew (void *p, target_phys_addr_t addr, uint32_t val) | ||
2117 | 93 | { | ||
2118 | 94 | sh_pci_data_write(p, addr, val, 2); | ||
2119 | 95 | } | ||
2120 | 96 | |||
2121 | 97 | static void sh_pci_writel (void *p, target_phys_addr_t addr, uint32_t val) | ||
2122 | 98 | { | ||
2123 | 99 | sh_pci_data_write(p, addr, val, 4); | ||
2124 | 100 | } | ||
2125 | 101 | |||
2126 | 102 | static uint32_t sh_pci_readb (void *p, target_phys_addr_t addr) | ||
2127 | 103 | { | ||
2128 | 104 | return sh_pci_mem_read(p, addr, 1); | ||
2129 | 105 | } | ||
2130 | 106 | |||
2131 | 107 | static uint32_t sh_pci_readw (void *p, target_phys_addr_t addr) | ||
2132 | 108 | { | ||
2133 | 109 | return sh_pci_mem_read(p, addr, 2); | ||
2134 | 110 | } | ||
2135 | 111 | |||
2136 | 112 | static uint32_t sh_pci_readl (void *p, target_phys_addr_t addr) | ||
2137 | 113 | { | ||
2138 | 114 | return sh_pci_mem_read(p, addr, 4); | ||
2139 | 115 | } | ||
2140 | 116 | |||
2141 | 117 | static int sh_pci_addr2port(SHPCIC *pcic, target_phys_addr_t addr) | ||
2142 | 118 | { | ||
2143 | 119 | return addr + pcic->iobr; | ||
2144 | 120 | } | ||
2145 | 121 | |||
2146 | 122 | static void sh_pci_outb (void *p, target_phys_addr_t addr, uint32_t val) | ||
2147 | 123 | { | ||
2148 | 124 | cpu_outb(sh_pci_addr2port(p, addr), val); | ||
2149 | 125 | } | ||
2150 | 126 | |||
2151 | 127 | static void sh_pci_outw (void *p, target_phys_addr_t addr, uint32_t val) | ||
2152 | 128 | { | ||
2153 | 129 | cpu_outw(sh_pci_addr2port(p, addr), val); | ||
2154 | 130 | } | ||
2155 | 131 | |||
2156 | 132 | static void sh_pci_outl (void *p, target_phys_addr_t addr, uint32_t val) | ||
2157 | 133 | { | ||
2158 | 134 | cpu_outl(sh_pci_addr2port(p, addr), val); | ||
2159 | 135 | } | ||
2160 | 136 | |||
2161 | 137 | static uint32_t sh_pci_inb (void *p, target_phys_addr_t addr) | ||
2162 | 138 | { | ||
2163 | 139 | return cpu_inb(sh_pci_addr2port(p, addr)); | ||
2164 | 140 | } | ||
2165 | 141 | |||
2166 | 142 | static uint32_t sh_pci_inw (void *p, target_phys_addr_t addr) | ||
2167 | 143 | { | ||
2168 | 144 | return cpu_inw(sh_pci_addr2port(p, addr)); | ||
2169 | 145 | } | ||
2170 | 146 | |||
2171 | 147 | static uint32_t sh_pci_inl (void *p, target_phys_addr_t addr) | ||
2172 | 148 | { | ||
2173 | 149 | return cpu_inl(sh_pci_addr2port(p, addr)); | ||
2174 | 150 | } | ||
2175 | 151 | |||
2176 | 152 | typedef struct { | 84 | typedef struct { |
2177 | 153 | CPUReadMemoryFunc * const r[3]; | 85 | CPUReadMemoryFunc * const r[3]; |
2178 | 154 | CPUWriteMemoryFunc * const w[3]; | 86 | CPUWriteMemoryFunc * const w[3]; |
2179 | @@ -159,21 +91,11 @@ | |||
2180 | 159 | { NULL, NULL, sh_pci_reg_write }, | 91 | { NULL, NULL, sh_pci_reg_write }, |
2181 | 160 | }; | 92 | }; |
2182 | 161 | 93 | ||
2183 | 162 | static MemOp sh_pci_mem = { | ||
2184 | 163 | { sh_pci_readb, sh_pci_readw, sh_pci_readl }, | ||
2185 | 164 | { sh_pci_writeb, sh_pci_writew, sh_pci_writel }, | ||
2186 | 165 | }; | ||
2187 | 166 | |||
2188 | 167 | static MemOp sh_pci_iop = { | ||
2189 | 168 | { sh_pci_inb, sh_pci_inw, sh_pci_inl }, | ||
2190 | 169 | { sh_pci_outb, sh_pci_outw, sh_pci_outl }, | ||
2191 | 170 | }; | ||
2192 | 171 | |||
2193 | 172 | PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, | 94 | PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, |
2194 | 173 | void *opaque, int devfn_min, int nirq) | 95 | void *opaque, int devfn_min, int nirq) |
2195 | 174 | { | 96 | { |
2196 | 175 | SHPCIC *p; | 97 | SHPCIC *p; |
2198 | 176 | int mem, reg, iop; | 98 | int reg; |
2199 | 177 | 99 | ||
2200 | 178 | p = qemu_mallocz(sizeof(SHPCIC)); | 100 | p = qemu_mallocz(sizeof(SHPCIC)); |
2201 | 179 | p->bus = pci_register_bus(NULL, "pci", | 101 | p->bus = pci_register_bus(NULL, "pci", |
2202 | @@ -182,14 +104,11 @@ | |||
2203 | 182 | p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice), | 104 | p->dev = pci_register_device(p->bus, "SH PCIC", sizeof(PCIDevice), |
2204 | 183 | -1, NULL, NULL); | 105 | -1, NULL, NULL); |
2205 | 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); |
2206 | 185 | iop = cpu_register_io_memory(sh_pci_iop.r, sh_pci_iop.w, p); | ||
2207 | 186 | mem = cpu_register_io_memory(sh_pci_mem.r, sh_pci_mem.w, p); | ||
2208 | 187 | cpu_register_physical_memory(0x1e200000, 0x224, reg); | 107 | cpu_register_physical_memory(0x1e200000, 0x224, reg); |
2209 | 188 | cpu_register_physical_memory(0x1e240000, 0x40000, iop); | ||
2210 | 189 | cpu_register_physical_memory(0x1d000000, 0x1000000, mem); | ||
2211 | 190 | cpu_register_physical_memory(0xfe200000, 0x224, reg); | 108 | cpu_register_physical_memory(0xfe200000, 0x224, reg); |
2214 | 191 | cpu_register_physical_memory(0xfe240000, 0x40000, iop); | 109 | |
2215 | 192 | cpu_register_physical_memory(0xfd000000, 0x1000000, mem); | 110 | p->iobr = 0xfe240000; |
2216 | 111 | isa_mmio_init(p->iobr, 0x40000); | ||
2217 | 193 | 112 | ||
2218 | 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); |
2219 | 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); |
2220 | 196 | 115 | ||
2221 | === modified file 'hw/usb-uhci.c' | |||
2222 | --- hw/usb-uhci.c 2010-01-20 17:54:24 +0000 | |||
2223 | +++ hw/usb-uhci.c 2010-06-15 15:07:26 +0000 | |||
2224 | @@ -677,9 +677,6 @@ | |||
2225 | 677 | 677 | ||
2226 | 678 | ret = async->packet.len; | 678 | ret = async->packet.len; |
2227 | 679 | 679 | ||
2228 | 680 | if (td->ctrl & TD_CTRL_IOC) | ||
2229 | 681 | *int_mask |= 0x01; | ||
2230 | 682 | |||
2231 | 683 | if (td->ctrl & TD_CTRL_IOS) | 680 | if (td->ctrl & TD_CTRL_IOS) |
2232 | 684 | td->ctrl &= ~TD_CTRL_ACTIVE; | 681 | td->ctrl &= ~TD_CTRL_ACTIVE; |
2233 | 685 | 682 | ||
2234 | @@ -693,6 +690,8 @@ | |||
2235 | 693 | here. The docs are somewhat unclear, but win2k relies on this | 690 | here. The docs are somewhat unclear, but win2k relies on this |
2236 | 694 | behavior. */ | 691 | behavior. */ |
2237 | 695 | td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK); | 692 | td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK); |
2238 | 693 | if (td->ctrl & TD_CTRL_IOC) | ||
2239 | 694 | *int_mask |= 0x01; | ||
2240 | 696 | 695 | ||
2241 | 697 | if (pid == USB_TOKEN_IN) { | 696 | if (pid == USB_TOKEN_IN) { |
2242 | 698 | if (len > max_len) { | 697 | if (len > max_len) { |
2243 | @@ -750,6 +749,8 @@ | |||
2244 | 750 | if (err == 0) { | 749 | if (err == 0) { |
2245 | 751 | td->ctrl &= ~TD_CTRL_ACTIVE; | 750 | td->ctrl &= ~TD_CTRL_ACTIVE; |
2246 | 752 | s->status |= UHCI_STS_USBERR; | 751 | s->status |= UHCI_STS_USBERR; |
2247 | 752 | if (td->ctrl & TD_CTRL_IOC) | ||
2248 | 753 | *int_mask |= 0x01; | ||
2249 | 753 | uhci_update_irq(s); | 754 | uhci_update_irq(s); |
2250 | 754 | } | 755 | } |
2251 | 755 | } | 756 | } |
2252 | 756 | 757 | ||
2253 | === modified file 'json-parser.c' | |||
2254 | --- json-parser.c 2010-02-26 16:26:00 +0000 | |||
2255 | +++ json-parser.c 2010-06-15 15:07:26 +0000 | |||
2256 | @@ -266,7 +266,7 @@ | |||
2257 | 266 | 266 | ||
2258 | 267 | peek = qlist_peek(working); | 267 | peek = qlist_peek(working); |
2259 | 268 | key = parse_value(ctxt, &working, ap); | 268 | key = parse_value(ctxt, &working, ap); |
2261 | 269 | if (qobject_type(key) != QTYPE_QSTRING) { | 269 | if (!key || qobject_type(key) != QTYPE_QSTRING) { |
2262 | 270 | parse_error(ctxt, peek, "key is not a string in object"); | 270 | parse_error(ctxt, peek, "key is not a string in object"); |
2263 | 271 | goto out; | 271 | goto out; |
2264 | 272 | } | 272 | } |
2265 | 273 | 273 | ||
2266 | === modified file 'linux-user/main.c' | |||
2267 | --- linux-user/main.c 2010-01-20 17:54:24 +0000 | |||
2268 | +++ linux-user/main.c 2010-06-15 15:07:26 +0000 | |||
2269 | @@ -2684,7 +2684,7 @@ | |||
2270 | 2684 | #endif | 2684 | #endif |
2271 | 2685 | #elif defined(TARGET_PPC) | 2685 | #elif defined(TARGET_PPC) |
2272 | 2686 | #ifdef TARGET_PPC64 | 2686 | #ifdef TARGET_PPC64 |
2274 | 2687 | cpu_model = "970"; | 2687 | cpu_model = "970fx"; |
2275 | 2688 | #else | 2688 | #else |
2276 | 2689 | cpu_model = "750"; | 2689 | cpu_model = "750"; |
2277 | 2690 | #endif | 2690 | #endif |
2278 | 2691 | 2691 | ||
2279 | === modified file 'net.c' | |||
2280 | --- net.c 2010-02-26 16:26:00 +0000 | |||
2281 | +++ net.c 2010-06-15 15:07:26 +0000 | |||
2282 | @@ -1187,26 +1187,6 @@ | |||
2283 | 1187 | qemu_del_vlan_client(vc); | 1187 | qemu_del_vlan_client(vc); |
2284 | 1188 | } | 1188 | } |
2285 | 1189 | 1189 | ||
2286 | 1190 | void net_set_boot_mask(int net_boot_mask) | ||
2287 | 1191 | { | ||
2288 | 1192 | int i; | ||
2289 | 1193 | |||
2290 | 1194 | /* Only the first four NICs may be bootable */ | ||
2291 | 1195 | net_boot_mask = net_boot_mask & 0xF; | ||
2292 | 1196 | |||
2293 | 1197 | for (i = 0; i < nb_nics; i++) { | ||
2294 | 1198 | if (net_boot_mask & (1 << i)) { | ||
2295 | 1199 | nd_table[i].bootable = 1; | ||
2296 | 1200 | net_boot_mask &= ~(1 << i); | ||
2297 | 1201 | } | ||
2298 | 1202 | } | ||
2299 | 1203 | |||
2300 | 1204 | if (net_boot_mask) { | ||
2301 | 1205 | fprintf(stderr, "Cannot boot from non-existent NIC\n"); | ||
2302 | 1206 | exit(1); | ||
2303 | 1207 | } | ||
2304 | 1208 | } | ||
2305 | 1209 | |||
2306 | 1210 | void do_info_network(Monitor *mon) | 1190 | void do_info_network(Monitor *mon) |
2307 | 1211 | { | 1191 | { |
2308 | 1212 | VLANState *vlan; | 1192 | VLANState *vlan; |
2309 | 1213 | 1193 | ||
2310 | === modified file 'net.h' | |||
2311 | --- net.h 2010-02-26 16:26:00 +0000 | |||
2312 | +++ net.h 2010-06-15 15:07:26 +0000 | |||
2313 | @@ -163,7 +163,6 @@ | |||
2314 | 163 | int net_init_clients(void); | 163 | int net_init_clients(void); |
2315 | 164 | void net_check_clients(void); | 164 | void net_check_clients(void); |
2316 | 165 | void net_cleanup(void); | 165 | void net_cleanup(void); |
2317 | 166 | void net_set_boot_mask(int boot_mask); | ||
2318 | 167 | void net_host_device_add(Monitor *mon, const QDict *qdict); | 166 | void net_host_device_add(Monitor *mon, const QDict *qdict); |
2319 | 168 | void net_host_device_remove(Monitor *mon, const QDict *qdict); | 167 | void net_host_device_remove(Monitor *mon, const QDict *qdict); |
2320 | 169 | 168 | ||
2321 | 170 | 169 | ||
2322 | === modified file 'qemu-char.c' | |||
2323 | --- qemu-char.c 2010-02-26 16:26:00 +0000 | |||
2324 | +++ qemu-char.c 2010-06-15 15:07:26 +0000 | |||
2325 | @@ -2317,8 +2317,7 @@ | |||
2326 | 2317 | qemu_opt_set(opts, "backend", "udp"); | 2317 | qemu_opt_set(opts, "backend", "udp"); |
2327 | 2318 | if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) { | 2318 | if (sscanf(p, "%64[^:]:%32[^@,]%n", host, port, &pos) < 2) { |
2328 | 2319 | host[0] = 0; | 2319 | host[0] = 0; |
2331 | 2320 | if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) { | 2320 | if (sscanf(p, ":%32[^@,]%n", port, &pos) < 1) { |
2330 | 2321 | fprintf(stderr, "udp #1\n"); | ||
2332 | 2322 | goto fail; | 2321 | goto fail; |
2333 | 2323 | } | 2322 | } |
2334 | 2324 | } | 2323 | } |
2335 | @@ -2329,7 +2328,6 @@ | |||
2336 | 2329 | if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) { | 2328 | if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) { |
2337 | 2330 | host[0] = 0; | 2329 | host[0] = 0; |
2338 | 2331 | if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) { | 2330 | if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) { |
2339 | 2332 | fprintf(stderr, "udp #2\n"); | ||
2340 | 2333 | goto fail; | 2331 | goto fail; |
2341 | 2334 | } | 2332 | } |
2342 | 2335 | } | 2333 | } |
2343 | @@ -2357,7 +2355,6 @@ | |||
2344 | 2357 | } | 2355 | } |
2345 | 2358 | 2356 | ||
2346 | 2359 | fail: | 2357 | fail: |
2347 | 2360 | fprintf(stderr, "%s: fail on \"%s\"\n", __FUNCTION__, filename); | ||
2348 | 2361 | qemu_opts_del(opts); | 2358 | qemu_opts_del(opts); |
2349 | 2362 | return NULL; | 2359 | return NULL; |
2350 | 2363 | } | 2360 | } |
2351 | 2364 | 2361 | ||
2352 | === modified file 'qemu-common.h' | |||
2353 | --- qemu-common.h 2010-02-26 16:26:00 +0000 | |||
2354 | +++ qemu-common.h 2010-06-15 15:07:26 +0000 | |||
2355 | @@ -54,6 +54,10 @@ | |||
2356 | 54 | void *iov_base; | 54 | void *iov_base; |
2357 | 55 | size_t iov_len; | 55 | size_t iov_len; |
2358 | 56 | }; | 56 | }; |
2359 | 57 | /* | ||
2360 | 58 | * Use the same value as Linux for now. | ||
2361 | 59 | */ | ||
2362 | 60 | #define IOV_MAX 1024 | ||
2363 | 57 | #else | 61 | #else |
2364 | 58 | #include <sys/uio.h> | 62 | #include <sys/uio.h> |
2365 | 59 | #endif | 63 | #endif |
2366 | 60 | 64 | ||
2367 | === modified file 'qemu-kvm.c' | |||
2368 | --- qemu-kvm.c 2010-02-26 16:26:00 +0000 | |||
2369 | +++ qemu-kvm.c 2010-06-15 15:07:26 +0000 | |||
2370 | @@ -444,7 +444,8 @@ | |||
2371 | 444 | r = kvm_vm_ioctl(kvm_state, KVM_CREATE_VCPU, id); | 444 | r = kvm_vm_ioctl(kvm_state, KVM_CREATE_VCPU, id); |
2372 | 445 | if (r < 0) { | 445 | if (r < 0) { |
2373 | 446 | fprintf(stderr, "kvm_create_vcpu: %m\n"); | 446 | fprintf(stderr, "kvm_create_vcpu: %m\n"); |
2375 | 447 | return; | 447 | fprintf(stderr, "Failed to create vCPU. Check the -smp parameter.\n"); |
2376 | 448 | goto err; | ||
2377 | 448 | } | 449 | } |
2378 | 449 | 450 | ||
2379 | 450 | env->kvm_fd = r; | 451 | env->kvm_fd = r; |
2380 | @@ -466,6 +467,9 @@ | |||
2381 | 466 | return; | 467 | return; |
2382 | 467 | err_fd: | 468 | err_fd: |
2383 | 468 | close(env->kvm_fd); | 469 | close(env->kvm_fd); |
2384 | 470 | err: | ||
2385 | 471 | /* We're no good with semi-broken states. */ | ||
2386 | 472 | abort(); | ||
2387 | 469 | } | 473 | } |
2388 | 470 | 474 | ||
2389 | 471 | static int kvm_set_boot_vcpu_id(kvm_context_t kvm, uint32_t id) | 475 | static int kvm_set_boot_vcpu_id(kvm_context_t kvm, uint32_t id) |
2390 | 472 | 476 | ||
2391 | === modified file 'qemu-options.hx' | |||
2392 | --- qemu-options.hx 2010-02-26 16:26:00 +0000 | |||
2393 | +++ qemu-options.hx 2010-06-15 15:07:26 +0000 | |||
2394 | @@ -969,7 +969,7 @@ | |||
2395 | 969 | 969 | ||
2396 | 970 | @example | 970 | @example |
2397 | 971 | # on the host | 971 | # on the host |
2399 | 972 | qemu -net user,hostfwd=tcp:5555::23 [...] | 972 | qemu -net user,hostfwd=tcp::5555-:23 [...] |
2400 | 973 | telnet localhost 5555 | 973 | telnet localhost 5555 |
2401 | 974 | @end example | 974 | @end example |
2402 | 975 | 975 | ||
2403 | 976 | 976 | ||
2404 | === modified file 'target-i386/translate.c' | |||
2405 | --- target-i386/translate.c 2010-01-21 16:22:13 +0000 | |||
2406 | +++ target-i386/translate.c 2010-06-15 15:07:26 +0000 | |||
2407 | @@ -2047,8 +2047,8 @@ | |||
2408 | 2047 | gen_op_movl_A0_im(disp); | 2047 | gen_op_movl_A0_im(disp); |
2409 | 2048 | } | 2048 | } |
2410 | 2049 | } | 2049 | } |
2413 | 2050 | /* XXX: index == 4 is always invalid */ | 2050 | /* index == 4 means no index */ |
2414 | 2051 | if (havesib && (index != 4 || scale != 0)) { | 2051 | if (havesib && (index != 4)) { |
2415 | 2052 | #ifdef TARGET_X86_64 | 2052 | #ifdef TARGET_X86_64 |
2416 | 2053 | if (s->aflag == 2) { | 2053 | if (s->aflag == 2) { |
2417 | 2054 | gen_op_addq_A0_reg_sN(scale, index); | 2054 | gen_op_addq_A0_reg_sN(scale, index); |
2418 | @@ -3165,11 +3165,16 @@ | |||
2419 | 3165 | case 0x1e7: /* movntdq */ | 3165 | case 0x1e7: /* movntdq */ |
2420 | 3166 | case 0x02b: /* movntps */ | 3166 | case 0x02b: /* movntps */ |
2421 | 3167 | case 0x12b: /* movntps */ | 3167 | case 0x12b: /* movntps */ |
2422 | 3168 | if (mod == 3) | ||
2423 | 3169 | goto illegal_op; | ||
2424 | 3170 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); | ||
2425 | 3171 | gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg])); | ||
2426 | 3172 | break; | ||
2427 | 3168 | case 0x3f0: /* lddqu */ | 3173 | case 0x3f0: /* lddqu */ |
2428 | 3169 | if (mod == 3) | 3174 | if (mod == 3) |
2429 | 3170 | goto illegal_op; | 3175 | goto illegal_op; |
2430 | 3171 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); | 3176 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); |
2432 | 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])); |
2433 | 3173 | break; | 3178 | break; |
2434 | 3174 | case 0x22b: /* movntss */ | 3179 | case 0x22b: /* movntss */ |
2435 | 3175 | case 0x32b: /* movntsd */ | 3180 | case 0x32b: /* movntsd */ |
2436 | @@ -4591,9 +4596,7 @@ | |||
2437 | 4591 | /* operand size for jumps is 64 bit */ | 4596 | /* operand size for jumps is 64 bit */ |
2438 | 4592 | ot = OT_QUAD; | 4597 | ot = OT_QUAD; |
2439 | 4593 | } else if (op == 3 || op == 5) { | 4598 | } else if (op == 3 || op == 5) { |
2443 | 4594 | /* for call calls, the operand is 16 or 32 bit, even | 4599 | ot = dflag ? OT_LONG + (rex_w == 1) : OT_WORD; |
2441 | 4595 | in long mode */ | ||
2442 | 4596 | ot = dflag ? OT_LONG : OT_WORD; | ||
2444 | 4597 | } else if (op == 6) { | 4600 | } else if (op == 6) { |
2445 | 4598 | /* default push size is 64 bit */ | 4601 | /* default push size is 64 bit */ |
2446 | 4599 | ot = dflag ? OT_QUAD : OT_WORD; | 4602 | ot = dflag ? OT_QUAD : OT_WORD; |
2447 | 4600 | 4603 | ||
2448 | === modified file 'target-sh4/cpu.h' | |||
2449 | --- target-sh4/cpu.h 2010-01-20 17:54:24 +0000 | |||
2450 | +++ target-sh4/cpu.h 2010-06-15 15:07:26 +0000 | |||
2451 | @@ -167,6 +167,7 @@ | |||
2452 | 167 | void do_interrupt(CPUSH4State * env); | 167 | void do_interrupt(CPUSH4State * env); |
2453 | 168 | 168 | ||
2454 | 169 | void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); | 169 | void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); |
2455 | 170 | void cpu_sh4_invalidate_tlb(CPUSH4State *s); | ||
2456 | 170 | void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr, | 171 | void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr, |
2457 | 171 | uint32_t mem_value); | 172 | uint32_t mem_value); |
2458 | 172 | 173 | ||
2459 | @@ -222,6 +223,7 @@ | |||
2460 | 222 | /* MMU control register */ | 223 | /* MMU control register */ |
2461 | 223 | #define MMUCR 0x1F000010 | 224 | #define MMUCR 0x1F000010 |
2462 | 224 | #define MMUCR_AT (1<<0) | 225 | #define MMUCR_AT (1<<0) |
2463 | 226 | #define MMUCR_TI (1<<2) | ||
2464 | 225 | #define MMUCR_SV (1<<8) | 227 | #define MMUCR_SV (1<<8) |
2465 | 226 | #define MMUCR_URC_BITS (6) | 228 | #define MMUCR_URC_BITS (6) |
2466 | 227 | #define MMUCR_URC_OFFSET (10) | 229 | #define MMUCR_URC_OFFSET (10) |
2467 | 228 | 230 | ||
2468 | === modified file 'target-sh4/helper.c' | |||
2469 | --- target-sh4/helper.c 2009-08-04 12:36:50 +0000 | |||
2470 | +++ target-sh4/helper.c 2010-06-15 15:07:26 +0000 | |||
2471 | @@ -377,7 +377,7 @@ | |||
2472 | 377 | n = find_itlb_entry(env, address, use_asid, 1); | 377 | n = find_itlb_entry(env, address, use_asid, 1); |
2473 | 378 | if (n >= 0) { | 378 | if (n >= 0) { |
2474 | 379 | matching = &env->itlb[n]; | 379 | matching = &env->itlb[n]; |
2476 | 380 | if ((env->sr & SR_MD) & !(matching->pr & 2)) | 380 | if (!(env->sr & SR_MD) && !(matching->pr & 2)) |
2477 | 381 | n = MMU_ITLB_VIOLATION; | 381 | n = MMU_ITLB_VIOLATION; |
2478 | 382 | else | 382 | else |
2479 | 383 | *prot = PAGE_READ; | 383 | *prot = PAGE_READ; |
2480 | @@ -430,7 +430,7 @@ | |||
2481 | 430 | if ((address >= 0x80000000 && address < 0xc0000000) || | 430 | if ((address >= 0x80000000 && address < 0xc0000000) || |
2482 | 431 | address >= 0xe0000000) { | 431 | address >= 0xe0000000) { |
2483 | 432 | if (!(env->sr & SR_MD) | 432 | if (!(env->sr & SR_MD) |
2485 | 433 | && (address < 0xe0000000 || address > 0xe4000000)) { | 433 | && (address < 0xe0000000 || address >= 0xe4000000)) { |
2486 | 434 | /* Unauthorized access in user mode (only store queues are available) */ | 434 | /* Unauthorized access in user mode (only store queues are available) */ |
2487 | 435 | fprintf(stderr, "Unauthorized access\n"); | 435 | fprintf(stderr, "Unauthorized access\n"); |
2488 | 436 | if (rw == 0) | 436 | if (rw == 0) |
2489 | @@ -574,6 +574,24 @@ | |||
2490 | 574 | entry->tc = (uint8_t)cpu_ptea_tc(env->ptea); | 574 | entry->tc = (uint8_t)cpu_ptea_tc(env->ptea); |
2491 | 575 | } | 575 | } |
2492 | 576 | 576 | ||
2493 | 577 | void cpu_sh4_invalidate_tlb(CPUSH4State *s) | ||
2494 | 578 | { | ||
2495 | 579 | int i; | ||
2496 | 580 | |||
2497 | 581 | /* UTLB */ | ||
2498 | 582 | for (i = 0; i < UTLB_SIZE; i++) { | ||
2499 | 583 | tlb_t * entry = &s->utlb[i]; | ||
2500 | 584 | entry->v = 0; | ||
2501 | 585 | } | ||
2502 | 586 | /* ITLB */ | ||
2503 | 587 | for (i = 0; i < UTLB_SIZE; i++) { | ||
2504 | 588 | tlb_t * entry = &s->utlb[i]; | ||
2505 | 589 | entry->v = 0; | ||
2506 | 590 | } | ||
2507 | 591 | |||
2508 | 592 | tlb_flush(s, 1); | ||
2509 | 593 | } | ||
2510 | 594 | |||
2511 | 577 | void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr, | 595 | void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr, |
2512 | 578 | uint32_t mem_value) | 596 | uint32_t mem_value) |
2513 | 579 | { | 597 | { |
2514 | 580 | 598 | ||
2515 | === modified file 'target-sh4/translate.c' | |||
2516 | --- target-sh4/translate.c 2010-01-20 17:54:24 +0000 | |||
2517 | +++ target-sh4/translate.c 2010-06-15 15:07:26 +0000 | |||
2518 | @@ -1905,7 +1905,7 @@ | |||
2519 | 1905 | ctx.bstate = BS_NONE; | 1905 | ctx.bstate = BS_NONE; |
2520 | 1906 | ctx.sr = env->sr; | 1906 | ctx.sr = env->sr; |
2521 | 1907 | ctx.fpscr = env->fpscr; | 1907 | ctx.fpscr = env->fpscr; |
2523 | 1908 | ctx.memidx = (env->sr & SR_MD) ? 1 : 0; | 1908 | ctx.memidx = (env->sr & SR_MD) == 0 ? 1 : 0; |
2524 | 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, |
2525 | 1910 | so assume it is a dynamic branch. */ | 1910 | so assume it is a dynamic branch. */ |
2526 | 1911 | ctx.delayed_pc = -1; /* use delayed pc from env pointer */ | 1911 | ctx.delayed_pc = -1; /* use delayed pc from env pointer */ |
2527 | 1912 | 1912 | ||
2528 | === modified file 'tcg/arm/tcg-target.c' | |||
2529 | --- tcg/arm/tcg-target.c 2010-01-20 17:54:24 +0000 | |||
2530 | +++ tcg/arm/tcg-target.c 2010-06-15 15:07:26 +0000 | |||
2531 | @@ -1697,12 +1697,15 @@ | |||
2532 | 1697 | 1697 | ||
2533 | 1698 | void tcg_target_qemu_prologue(TCGContext *s) | 1698 | void tcg_target_qemu_prologue(TCGContext *s) |
2534 | 1699 | { | 1699 | { |
2537 | 1700 | /* stmdb sp!, { r9 - r11, lr } */ | 1700 | /* Theoretically there is no need to save r12, but an |
2538 | 1701 | tcg_out32(s, (COND_AL << 28) | 0x092d4e00); | 1701 | even number of registers to be saved as per EABI */ |
2539 | 1702 | |||
2540 | 1703 | /* stmdb sp!, { r4 - r12, lr } */ | ||
2541 | 1704 | tcg_out32(s, (COND_AL << 28) | 0x092d5ff0); | ||
2542 | 1702 | 1705 | ||
2543 | 1703 | tcg_out_bx(s, COND_AL, TCG_REG_R0); | 1706 | tcg_out_bx(s, COND_AL, TCG_REG_R0); |
2544 | 1704 | tb_ret_addr = s->code_ptr; | 1707 | tb_ret_addr = s->code_ptr; |
2545 | 1705 | 1708 | ||
2548 | 1706 | /* ldmia sp!, { r9 - r11, pc } */ | 1709 | /* ldmia sp!, { r4 - r12, pc } */ |
2549 | 1707 | tcg_out32(s, (COND_AL << 28) | 0x08bd8e00); | 1710 | tcg_out32(s, (COND_AL << 28) | 0x08bd9ff0); |
2550 | 1708 | } | 1711 | } |
2551 | 1709 | 1712 | ||
2552 | === modified file 'tcg/mips/tcg-target.c' | |||
2553 | --- tcg/mips/tcg-target.c 2010-02-26 16:26:00 +0000 | |||
2554 | +++ tcg/mips/tcg-target.c 2010-06-15 15:07:26 +0000 | |||
2555 | @@ -340,6 +340,17 @@ | |||
2556 | 340 | } | 340 | } |
2557 | 341 | 341 | ||
2558 | 342 | /* | 342 | /* |
2559 | 343 | * Type branch | ||
2560 | 344 | */ | ||
2561 | 345 | static inline void tcg_out_opc_br(TCGContext *s, int opc, int rt, int rs) | ||
2562 | 346 | { | ||
2563 | 347 | /* We need to keep the offset unchanged for retranslation */ | ||
2564 | 348 | uint16_t offset = (uint16_t)(*(uint32_t *) &s->code_ptr); | ||
2565 | 349 | |||
2566 | 350 | tcg_out_opc_imm(s, opc, rt, rs, offset); | ||
2567 | 351 | } | ||
2568 | 352 | |||
2569 | 353 | /* | ||
2570 | 343 | * Type sa | 354 | * Type sa |
2571 | 344 | */ | 355 | */ |
2572 | 345 | static inline void tcg_out_opc_sa(TCGContext *s, int opc, int rd, int rt, int sa) | 356 | static inline void tcg_out_opc_sa(TCGContext *s, int opc, int rd, int rt, int sa) |
2573 | @@ -469,42 +480,42 @@ | |||
2574 | 469 | 480 | ||
2575 | 470 | switch (cond) { | 481 | switch (cond) { |
2576 | 471 | case TCG_COND_EQ: | 482 | case TCG_COND_EQ: |
2578 | 472 | tcg_out_opc_imm(s, OPC_BEQ, arg1, arg2, 0); | 483 | tcg_out_opc_br(s, OPC_BEQ, arg1, arg2); |
2579 | 473 | break; | 484 | break; |
2580 | 474 | case TCG_COND_NE: | 485 | case TCG_COND_NE: |
2582 | 475 | tcg_out_opc_imm(s, OPC_BNE, arg1, arg2, 0); | 486 | tcg_out_opc_br(s, OPC_BNE, arg1, arg2); |
2583 | 476 | break; | 487 | break; |
2584 | 477 | case TCG_COND_LT: | 488 | case TCG_COND_LT: |
2585 | 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); |
2587 | 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); |
2588 | 480 | break; | 491 | break; |
2589 | 481 | case TCG_COND_LTU: | 492 | case TCG_COND_LTU: |
2590 | 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); |
2592 | 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); |
2593 | 484 | break; | 495 | break; |
2594 | 485 | case TCG_COND_GE: | 496 | case TCG_COND_GE: |
2595 | 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); |
2597 | 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); |
2598 | 488 | break; | 499 | break; |
2599 | 489 | case TCG_COND_GEU: | 500 | case TCG_COND_GEU: |
2600 | 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); |
2602 | 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); |
2603 | 492 | break; | 503 | break; |
2604 | 493 | case TCG_COND_LE: | 504 | case TCG_COND_LE: |
2605 | 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); |
2607 | 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); |
2608 | 496 | break; | 507 | break; |
2609 | 497 | case TCG_COND_LEU: | 508 | case TCG_COND_LEU: |
2610 | 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); |
2612 | 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); |
2613 | 500 | break; | 511 | break; |
2614 | 501 | case TCG_COND_GT: | 512 | case TCG_COND_GT: |
2615 | 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); |
2617 | 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); |
2618 | 504 | break; | 515 | break; |
2619 | 505 | case TCG_COND_GTU: | 516 | case TCG_COND_GTU: |
2620 | 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); |
2622 | 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); |
2623 | 508 | break; | 519 | break; |
2624 | 509 | default: | 520 | default: |
2625 | 510 | tcg_abort(); | 521 | tcg_abort(); |
2626 | @@ -553,7 +564,7 @@ | |||
2627 | 553 | } | 564 | } |
2628 | 554 | 565 | ||
2629 | 555 | label_ptr = s->code_ptr; | 566 | label_ptr = s->code_ptr; |
2631 | 556 | tcg_out_opc_imm(s, OPC_BNE, arg2, arg4, 0); | 567 | tcg_out_opc_br(s, OPC_BNE, arg2, arg4); |
2632 | 557 | tcg_out_nop(s); | 568 | tcg_out_nop(s); |
2633 | 558 | 569 | ||
2634 | 559 | switch(cond) { | 570 | switch(cond) { |
2635 | @@ -670,20 +681,20 @@ | |||
2636 | 670 | 681 | ||
2637 | 671 | # if TARGET_LONG_BITS == 64 | 682 | # if TARGET_LONG_BITS == 64 |
2638 | 672 | label3_ptr = s->code_ptr; | 683 | label3_ptr = s->code_ptr; |
2640 | 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); |
2641 | 674 | tcg_out_nop(s); | 685 | tcg_out_nop(s); |
2642 | 675 | 686 | ||
2643 | 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, |
2644 | 677 | offsetof(CPUState, tlb_table[mem_index][0].addr_read) + addr_memh); | 688 | offsetof(CPUState, tlb_table[mem_index][0].addr_read) + addr_memh); |
2645 | 678 | 689 | ||
2646 | 679 | label1_ptr = s->code_ptr; | 690 | label1_ptr = s->code_ptr; |
2648 | 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); |
2649 | 681 | tcg_out_nop(s); | 692 | tcg_out_nop(s); |
2650 | 682 | 693 | ||
2651 | 683 | reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr); | 694 | reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr); |
2652 | 684 | # else | 695 | # else |
2653 | 685 | label1_ptr = s->code_ptr; | 696 | label1_ptr = s->code_ptr; |
2655 | 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); |
2656 | 687 | tcg_out_nop(s); | 698 | tcg_out_nop(s); |
2657 | 688 | # endif | 699 | # endif |
2658 | 689 | 700 | ||
2659 | @@ -725,7 +736,7 @@ | |||
2660 | 725 | } | 736 | } |
2661 | 726 | 737 | ||
2662 | 727 | label2_ptr = s->code_ptr; | 738 | label2_ptr = s->code_ptr; |
2664 | 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); |
2665 | 729 | tcg_out_nop(s); | 740 | tcg_out_nop(s); |
2666 | 730 | 741 | ||
2667 | 731 | /* label1: fast path */ | 742 | /* label1: fast path */ |
2668 | @@ -857,20 +868,20 @@ | |||
2669 | 857 | 868 | ||
2670 | 858 | # if TARGET_LONG_BITS == 64 | 869 | # if TARGET_LONG_BITS == 64 |
2671 | 859 | label3_ptr = s->code_ptr; | 870 | label3_ptr = s->code_ptr; |
2673 | 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); |
2674 | 861 | tcg_out_nop(s); | 872 | tcg_out_nop(s); |
2675 | 862 | 873 | ||
2676 | 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, |
2677 | 864 | offsetof(CPUState, tlb_table[mem_index][0].addr_write) + addr_memh); | 875 | offsetof(CPUState, tlb_table[mem_index][0].addr_write) + addr_memh); |
2678 | 865 | 876 | ||
2679 | 866 | label1_ptr = s->code_ptr; | 877 | label1_ptr = s->code_ptr; |
2681 | 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); |
2682 | 868 | tcg_out_nop(s); | 879 | tcg_out_nop(s); |
2683 | 869 | 880 | ||
2684 | 870 | reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr); | 881 | reloc_pc16(label3_ptr, (tcg_target_long) s->code_ptr); |
2685 | 871 | # else | 882 | # else |
2686 | 872 | label1_ptr = s->code_ptr; | 883 | label1_ptr = s->code_ptr; |
2688 | 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); |
2689 | 874 | tcg_out_nop(s); | 885 | tcg_out_nop(s); |
2690 | 875 | # endif | 886 | # endif |
2691 | 876 | 887 | ||
2692 | @@ -911,7 +922,7 @@ | |||
2693 | 911 | tcg_out_nop(s); | 922 | tcg_out_nop(s); |
2694 | 912 | 923 | ||
2695 | 913 | label2_ptr = s->code_ptr; | 924 | label2_ptr = s->code_ptr; |
2697 | 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); |
2698 | 915 | tcg_out_nop(s); | 926 | tcg_out_nop(s); |
2699 | 916 | 927 | ||
2700 | 917 | /* label1: fast path */ | 928 | /* label1: fast path */ |
2701 | @@ -1262,7 +1273,9 @@ | |||
2702 | 1262 | }; | 1273 | }; |
2703 | 1263 | 1274 | ||
2704 | 1264 | static int tcg_target_callee_save_regs[] = { | 1275 | static int tcg_target_callee_save_regs[] = { |
2705 | 1276 | #if 0 /* used for the global env (TCG_AREG0), so no need to save */ | ||
2706 | 1265 | TCG_REG_S0, | 1277 | TCG_REG_S0, |
2707 | 1278 | #endif | ||
2708 | 1266 | TCG_REG_S1, | 1279 | TCG_REG_S1, |
2709 | 1267 | TCG_REG_S2, | 1280 | TCG_REG_S2, |
2710 | 1268 | TCG_REG_S3, | 1281 | TCG_REG_S3, |
2711 | @@ -1271,8 +1284,7 @@ | |||
2712 | 1271 | TCG_REG_S6, | 1284 | TCG_REG_S6, |
2713 | 1272 | TCG_REG_S7, | 1285 | TCG_REG_S7, |
2714 | 1273 | TCG_REG_GP, | 1286 | TCG_REG_GP, |
2717 | 1274 | /* TCG_REG_FP, */ /* currently used for the global env, so np | 1287 | TCG_REG_FP, |
2716 | 1275 | need to save */ | ||
2718 | 1276 | TCG_REG_RA, /* should be last for ABI compliance */ | 1288 | TCG_REG_RA, /* should be last for ABI compliance */ |
2719 | 1277 | }; | 1289 | }; |
2720 | 1278 | 1290 | ||
2721 | 1279 | 1291 | ||
2722 | === modified file 'tcg/mips/tcg-target.h' | |||
2723 | --- tcg/mips/tcg-target.h 2010-01-20 17:54:24 +0000 | |||
2724 | +++ tcg/mips/tcg-target.h 2010-06-15 15:07:26 +0000 | |||
2725 | @@ -92,9 +92,9 @@ | |||
2726 | 92 | #undef TCG_TARGET_HAS_ext16u_i32 /* andi rt, rs, 0xffff */ | 92 | #undef TCG_TARGET_HAS_ext16u_i32 /* andi rt, rs, 0xffff */ |
2727 | 93 | 93 | ||
2728 | 94 | /* Note: must be synced with dyngen-exec.h */ | 94 | /* Note: must be synced with dyngen-exec.h */ |
2732 | 95 | #define TCG_AREG0 TCG_REG_FP | 95 | #define TCG_AREG0 TCG_REG_S0 |
2733 | 96 | #define TCG_AREG1 TCG_REG_S0 | 96 | #define TCG_AREG1 TCG_REG_S1 |
2734 | 97 | #define TCG_AREG2 TCG_REG_S1 | 97 | #define TCG_AREG2 TCG_REG_FP |
2735 | 98 | 98 | ||
2736 | 99 | #include <sys/cachectl.h> | 99 | #include <sys/cachectl.h> |
2737 | 100 | 100 | ||
2738 | 101 | 101 | ||
2739 | === modified file 'vl.c' | |||
2740 | --- vl.c 2010-02-26 16:26:00 +0000 | |||
2741 | +++ vl.c 2010-06-15 15:07:26 +0000 | |||
2742 | @@ -2597,9 +2597,9 @@ | |||
2743 | 2597 | fprintf(stderr, | 2597 | fprintf(stderr, |
2744 | 2598 | "only 63 CPUs in NUMA mode supported.\n"); | 2598 | "only 63 CPUs in NUMA mode supported.\n"); |
2745 | 2599 | } | 2599 | } |
2747 | 2600 | value = (1 << (endvalue + 1)) - (1 << value); | 2600 | value = (2ULL << endvalue) - (1ULL << value); |
2748 | 2601 | } else { | 2601 | } else { |
2750 | 2602 | value = 1 << value; | 2602 | value = 1ULL << value; |
2751 | 2603 | } | 2603 | } |
2752 | 2604 | } | 2604 | } |
2753 | 2605 | node_cpumask[nodenr] = value; | 2605 | node_cpumask[nodenr] = value; |
2754 | @@ -3515,6 +3515,8 @@ | |||
2755 | 3515 | return 0; | 3515 | return 0; |
2756 | 3516 | if (env->stopped) | 3516 | if (env->stopped) |
2757 | 3517 | return 0; | 3517 | return 0; |
2758 | 3518 | if (!vm_running) | ||
2759 | 3519 | return 0; | ||
2760 | 3518 | return 1; | 3520 | return 1; |
2761 | 3519 | } | 3521 | } |
2762 | 3520 | 3522 | ||
2763 | @@ -4909,7 +4911,7 @@ | |||
2764 | 4909 | const char *gdbstub_dev = NULL; | 4911 | const char *gdbstub_dev = NULL; |
2765 | 4910 | uint32_t boot_devices_bitmap = 0; | 4912 | uint32_t boot_devices_bitmap = 0; |
2766 | 4911 | int i; | 4913 | int i; |
2768 | 4912 | int snapshot, linux_boot, net_boot; | 4914 | int snapshot, linux_boot; |
2769 | 4913 | const char *initrd_filename; | 4915 | const char *initrd_filename; |
2770 | 4914 | const char *kernel_filename, *kernel_cmdline; | 4916 | const char *kernel_filename, *kernel_cmdline; |
2771 | 4915 | char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */ | 4917 | char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */ |
2772 | @@ -5428,6 +5430,9 @@ | |||
2773 | 5428 | case QEMU_OPTION_serial: | 5430 | case QEMU_OPTION_serial: |
2774 | 5429 | add_device_config(DEV_SERIAL, optarg); | 5431 | add_device_config(DEV_SERIAL, optarg); |
2775 | 5430 | default_serial = 0; | 5432 | default_serial = 0; |
2776 | 5433 | if (strncmp(optarg, "mon:", 4) == 0) { | ||
2777 | 5434 | default_monitor = 0; | ||
2778 | 5435 | } | ||
2779 | 5431 | break; | 5436 | break; |
2780 | 5432 | case QEMU_OPTION_watchdog: | 5437 | case QEMU_OPTION_watchdog: |
2781 | 5433 | if (watchdog) { | 5438 | if (watchdog) { |
2782 | @@ -5446,10 +5451,16 @@ | |||
2783 | 5446 | case QEMU_OPTION_virtiocon: | 5451 | case QEMU_OPTION_virtiocon: |
2784 | 5447 | add_device_config(DEV_VIRTCON, optarg); | 5452 | add_device_config(DEV_VIRTCON, optarg); |
2785 | 5448 | default_virtcon = 0; | 5453 | default_virtcon = 0; |
2786 | 5454 | if (strncmp(optarg, "mon:", 4) == 0) { | ||
2787 | 5455 | default_monitor = 0; | ||
2788 | 5456 | } | ||
2789 | 5449 | break; | 5457 | break; |
2790 | 5450 | case QEMU_OPTION_parallel: | 5458 | case QEMU_OPTION_parallel: |
2791 | 5451 | add_device_config(DEV_PARALLEL, optarg); | 5459 | add_device_config(DEV_PARALLEL, optarg); |
2792 | 5452 | default_parallel = 0; | 5460 | default_parallel = 0; |
2793 | 5461 | if (strncmp(optarg, "mon:", 4) == 0) { | ||
2794 | 5462 | default_monitor = 0; | ||
2795 | 5463 | } | ||
2796 | 5453 | break; | 5464 | break; |
2797 | 5454 | case QEMU_OPTION_loadvm: | 5465 | case QEMU_OPTION_loadvm: |
2798 | 5455 | loadvm = optarg; | 5466 | loadvm = optarg; |
2799 | @@ -5905,6 +5916,12 @@ | |||
2800 | 5905 | fprintf(stderr, "Could not initialize KVM, will disable KVM support\n"); | 5916 | fprintf(stderr, "Could not initialize KVM, will disable KVM support\n"); |
2801 | 5906 | kvm_allowed = 0; | 5917 | kvm_allowed = 0; |
2802 | 5907 | } | 5918 | } |
2803 | 5919 | } else { | ||
2804 | 5920 | /* without kvm enabled, we can only support 4095 MB RAM */ | ||
2805 | 5921 | if (ram_size > (4095UL << 20)) { | ||
2806 | 5922 | fprintf(stderr, "qemu: without kvm support at most 4095 MB RAM can be simulated\n"); | ||
2807 | 5923 | exit(1); | ||
2808 | 5924 | } | ||
2809 | 5908 | } | 5925 | } |
2810 | 5909 | 5926 | ||
2811 | 5910 | if (qemu_init_main_loop()) { | 5927 | if (qemu_init_main_loop()) { |
2812 | @@ -5948,9 +5965,6 @@ | |||
2813 | 5948 | exit(1); | 5965 | exit(1); |
2814 | 5949 | } | 5966 | } |
2815 | 5950 | 5967 | ||
2816 | 5951 | net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF; | ||
2817 | 5952 | net_set_boot_mask(net_boot); | ||
2818 | 5953 | |||
2819 | 5954 | /* init the bluetooth world */ | 5968 | /* init the bluetooth world */ |
2820 | 5955 | if (foreach_device_config(DEV_BT, bt_parse)) | 5969 | if (foreach_device_config(DEV_BT, bt_parse)) |
2821 | 5956 | exit(1); | 5970 | exit(1); |
2822 | 5957 | 5971 | ||
2823 | === modified file 'vnc.c' | |||
2824 | --- vnc.c 2010-02-26 16:26:00 +0000 | |||
2825 | +++ vnc.c 2010-06-15 15:07:26 +0000 | |||
2826 | @@ -1421,8 +1421,10 @@ | |||
2827 | 1421 | dz = 1; | 1421 | dz = 1; |
2828 | 1422 | 1422 | ||
2829 | 1423 | if (vs->absolute) { | 1423 | if (vs->absolute) { |
2832 | 1424 | kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1), | 1424 | kbd_mouse_event(ds_get_width(vs->ds) > 1 ? |
2833 | 1425 | y * 0x7FFF / (ds_get_height(vs->ds) - 1), | 1425 | x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000, |
2834 | 1426 | ds_get_height(vs->ds) > 1 ? | ||
2835 | 1427 | y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000, | ||
2836 | 1426 | dz, buttons); | 1428 | dz, buttons); |
2837 | 1427 | } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) { | 1429 | } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) { |
2838 | 1428 | x -= 0x7FFF; | 1430 | x -= 0x7FFF; |
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?:
, := ,