summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-09-10target-xtensa: implement unaligned exception optionMax Filippov3-4/+73
See ISA, 4.4.4 for details. Correct (aligned as per ISA) address for unaligned access is generated in case this option is not enabled. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement extended L32RMax Filippov3-4/+40
See ISA, 4.3.3 for details. TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement loop optionMax Filippov4-9/+93
See ISA, 4.3.2 for details. Operations that change LEND SR value invalidate TBs at the old and at the new LEND. LEND value at TB compilation time is considered constant and loop instruction is generated based on this value. Invalidation may be avoided for the TB at the old LEND address, since looping code verifies actual LEND value. Invalidation may be avoided for the TB at the new LEND address if there's a way to associate LEND address with TB at compilation time and later verify that it doesn't change. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement windowed registersMax Filippov5-9/+345
See ISA, 4.7.1 for details. Physical registers and currently visible window are separate fields in CPUEnv. Only current window is accessible to TCG. On operations that change window base helpers copy current window to and from physical registers. Window overflow check described in 4.7.1.3 is in separate patch. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement RST2 group (32 bit mul/div/rem)Max Filippov1-1/+76
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement exceptionsMax Filippov6-6/+242
- mark privileged opcodes with ring check; - make debug exception on exception handler entry. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: add PS register and access controlMax Filippov3-6/+77
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement CACHE groupMax Filippov1-1/+94
All operations in this group are no-ops, because cache ought to be transparent to applications. However cache may be abused, then we'll need to actually implement these opcodes. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement SYNC groupMax Filippov1-1/+30
All operations in this group are no-ops, because there are no delayed side effects. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: mark reserved and TBD opcodesMax Filippov1-1/+109
Reserved opcodes must generate illegal instruction exception. Usually they signal emulation quality problems. Not implemented opcodes are good to see. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement LSAI groupMax Filippov2-0/+90
- base + offset load/store operations for 1/2/4 byte values; - cache operations (not implemented); - multiprocessor synchronization operations. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement shifts (ST1 and RST1 groups)Max Filippov4-0/+262
- ST1: SAR (shift amount special register) manipulation, NSA(U); - RST1: shifts, 16-bit multiplication. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement RST3 groupMax Filippov1-0/+161
- access to Special Registers (wsr, rsr); - access to User Registers (wur, rur); - misc. operations option (value clamp, sign extension, min, max); - conditional moves. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: add special and user registersMax Filippov2-2/+54
Special Registers hold the majority of the state added to the processor by the options. See ISA, 5.3 for details. User Registers hold state added in support of designer's TIE and in some cases of options that Tensilica provides. See ISA, 5.4 for details. Only registers mapped in sregnames or uregnames are considered valid. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement JX/RET0/CALLXMax Filippov1-0/+43
Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement conditional jumpsMax Filippov1-0/+164
- BZ (comparison to zero); - BI0 (comparison to signed immediate); - BI1 (comparison to unsigned immediate); - B (two registers comparison, bit sets comparison); - BEQZ.N/BNEZ.N (narrow comparison to zero). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: add sample boardMax Filippov2-0/+107
Sample board and sample CPU core are used for debug and may be used for development of custom SoC emulators. This board has two fixed size memory regions for DTCM and ITCM and variable length SRAM region. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement RT0 groupMax Filippov1-0/+19
NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement narrow instructionsMax Filippov1-0/+54
Instructions with op0 >= 8 are 2 bytes long, others are 3 bytes long. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: implement disas_xtensa_insnMax Filippov5-2/+556
Set up disas_xtensa_insn switch structure, mark required options on high level groups. Implement arithmetic/bit logic/jump/call0. Implement code generation loop with single step/breakpoint checking. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: add target to the configure scriptMax Filippov3-1/+13
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10target-xtensa: add target stubsMax Filippov11-0/+373
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10mipsnet: use trace frameworkHervé Poussineau2-20/+13
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10mipsnet: convert to qdevHervé Poussineau3-36/+65
Move mipsnet_init() function to mipssim machine Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10PCI: delete unused mem_base and pci_to_cpu_addrBlue Swirl2-15/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10Sparc64: remove useless variableBlue Swirl1-4/+2
Remove a useless variable, spotted by clang analyzer: /src/qemu/target-sparc/op_helper.c:3904:18: warning: unused variable 'tmp' [-Wunused-variable] target_ulong tmp = val; The error message is actually incorrect since the variable is used. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10lsi53c895a: avoid a warning from clang analyzerBlue Swirl1-4/+1
Avoid this warning from clang analyzer by deleting the variable: /src/qemu/hw/lsi53c895a.c:895:5: warning: Value stored to 'id' is never read id = (current_tag >> 8) & 0xf; Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10cpu-exec: remove unnecessary assignmentBlue Swirl1-2/+3
Avoid this warning from clang analyzer: /src/qemu/cpu-exec.c:97:5: warning: Value stored to 'phys_page2' is never read phys_page2 = -1; Adjust the scope of the variable while at it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10kvm: remove unnecessary assignmentsBlue Swirl1-1/+1
Avoid these warnings from clang analyzer: /src/qemu/target-i386/kvm.c:772:5: warning: Value stored to 'cwd' is never read cwd = swd = twd = 0; /src/qemu/target-i386/kvm.c:772:11: warning: Although the value stored to 'swd' is used in the enclosing expression, the value is never actually read from 'swd' cwd = swd = twd = 0; Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10hid: fix misassignmentBlue Swirl1-1/+1
The code does not have any effect as is, fix it. Spotted by clang analyzer: /src/qemu/hw/hid.c:99:13: warning: Value stored to 'x1' is never read x1 = 1; Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10scsi-bus: remove duplicate table entriesBlue Swirl1-3/+1
Remove duplicate entries from SCSI command table, spotted by clang analyzer: /src/qemu/hw/scsi-bus.c:979:40: warning: initializer overrides prior initialization of this subobject [ ERASE_16 ] = "ERASE_16", /src/qemu/hw/scsi-bus.c:978:40: note: previous initialization is here [ WRITE_SAME_16 ] = "WRITE_SAME_16", /src/qemu/hw/scsi-bus.c:984:40: warning: initializer overrides prior initialization of this subobject [ MAINTENANCE_IN ] = "MAINTENANCE_IN", /src/qemu/hw/scsi-bus.c:917:40: note: previous initialization is here [ MAINTENANCE_IN ] = "MAINTENANCE_IN", /src/qemu/hw/scsi-bus.c:985:40: warning: initializer overrides prior initialization of this subobject [ MAINTENANCE_OUT ] = "MAINTENANCE_OUT", /src/qemu/hw/scsi-bus.c:918:40: note: previous initialization is here [ MAINTENANCE_OUT ] = "MAINTENANCE_OUT", Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10qemu-io: remove unnecessary assignmentBlue Swirl1-1/+0
Remove an unnecessary assignment, spotted by clang analyzer: /src/qemu/qemu-io.c:995:9: warning: Value stored to 'offset' is never read offset += reqs[i].qiov->size; Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10win32: improve version.o dependencyBlue Swirl1-1/+1
Actually, version.rc doesn't need config-host.mak but config-host.h, fix it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-10g364fb: compile in hwlibBlue Swirl7-8/+15
Compile g364fb in hwlib. Two compilations less for the full build. Acked-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-09Merge remote-tracking branch 'sstabellini/xen-next' into stagingAnthony Liguori8-26/+85
2011-09-09Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori11-17/+15
2011-09-09build: fix missing trace dep on GENERATED_HEADERSMichael Roth1-0/+2
fc764105 added an include for qemu-common.h to trace/control.h, which made all users of this header file dependent on GENERATED_HEADERS. Since it's used by pretty much all the trace backends now, make trace-obj-y dependent on GENERATED_HEADERS. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09vns/tls: don't use depricated gnutls functionsGerd Hoffmann1-19/+49
Avoid using deprecated gnutls functions with recent gnutls versions. Fixes build failure on Fedora 16. Keep the old way for compatibility with old installations such as RHEL-5 (gnutls 1.4.x). Based on a patch from Raghavendra D Prabhu <raghu.prabhu13@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09Use hex instead of binary.Gerd Hoffmann1-8/+8
Older gcc versions don't understand 0b<bits>, use hex representation instead. Fixes build failure on RHEL-5. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09Don't use g_thread_get_initialized.Gerd Hoffmann2-4/+1
Initialize glib threads unconditionally in main() instead of using g_thread_get_initialized in the 9p code. Fixes a build failure on RHEL-5, which ships glib 2.12. g_thread_get_initialized was added in 2.20. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09qemu_vmalloc: align properly for transparent hugepages and KVMAvi Kivity1-1/+13
To make good use of transparent hugepages, KVM requires that guest-physical and host-virtual addresses share the low 21 bits (as opposed to just the low 12 bits normally required). Adjust qemu_vmalloc() to honor that requirement. Ignore it for small regions to avoid fragmentation. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09curses: fix garbling when chtype != longDevin J. Pohly2-0/+7
Qemu currently assumes that chtype is typedef'd to unsigned long, but this is not necessarily the case (ncurses, for instance, can configure this at build-time). This patch uses the predefined chtype if qemu is configured for curses support and falls back to unsigned long otherwise. Fixes bug 568614. Signed-off-by: Devin J. Pohly <djpohly+launchpad@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09virtio-balloon: Disassociate from the balloon handlers on unplugAmit Shah1-0/+2
Adding a 2nd balloon device after unplugging the first one doesn't work. Also, the 'info balloon' command should indicate an error mentioning no balloon device is registered after unplug. Reproduction steps given by Shaolong Hu: (qemu) info balloon Device 'balloon' has not been activated by the guest (qemu) device_add virtio-balloon-pci,id=balloon1 (qemu) info balloon balloon: actual=4096 (qemu) balloon 2048 (qemu) info balloon balloon: actual=2048 (qemu) device_del balloon1 (qemu) info balloon balloon: actual=4096 (qemu) balloon 2048 (qemu) info balloon balloon: actual=4096 (qemu) device_del balloon1 Device 'balloon1' not found (qemu) device_add virtio-balloon-pci,id=balloon1 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized (qemu) device_add virtio-balloon-pci,id=balloon2 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized Reported-by: Shaolong Hu <shu@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09balloon: Disassociate handlers from balloon device on unplugAmit Shah2-0/+11
When a balloon device gets unplugged, allow the balloon handlers to be freed. Reported-by: Shaolong Hu <shu@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-09tcg/ppc64: Fix zero extension code generation bug for ppc64 hostThomas Huth1-1/+1
The ppc64 code generation backend uses an rldicr (Rotate Left Double Immediate and Clear Right) instruction to implement zero extension of a 32 bit quantity to a 64 bit quantity (INDEX_op_ext32u_i64). However this is wrong - this instruction clears specified low bits of the value, instead of high bits as we require for a zero extension. It should instead use an rldicl (Rotate Left Double Immediate and Clear Left) instruction. Presumably amongst other things, this causes the SLOF firmware image used with -M pseries to not boot on a ppc64 host. It appears this bug was exposed by commit 0bf1dbdcc935dfc220a93cd990e947e90706aec6 (tcg/ppc64: fix 16/32 mixup) which enabled the use of the op_ext32u_i64 operation on the ppc64 backend. Signed-off-by: Thomas Huth <thuth@de.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: malc <av1474@comtv.ru>
2011-09-09xen-mapcache: Fix rlimit set size.Anthony PERARD1-5/+24
Previously, the address space soft limit was set mcache_max_size. So, before the mcache_max_size was reached by the mapcache, QEMU was killed for overuse of the virtual address space. This patch fix that by setting the soft limit the maximum than can have QEMU. So the soft and hard limit are always set to RLIM_INFINITY if QEMU is privileged. In case QEMU is not run as root and the limit is too low, the maximum mapcache size will be set the rlim_max - 80MB because observed that QEMU use 75MB more than the maximum mapcache size after several empirical tests. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-09xen: use uint64_t instead of target_ulong in cpu_ioreq_moveStefano Stabellini1-1/+1
cpu_ioreq_move might move 8 bytes at a time so we must make sure that the temporary variable can hold 8 bytes. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-09Move the xenfb pointer handler to the connected methodJohn Haxby1-5/+16
Ensure that we read "request-abs-pointer" after the frontend has written it. This means that we will correctly set up an ansolute or relative pointer handler correctly. Signed-off-by: John Haxby <john.haxby@oracle.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-09Introduce a new 'connected' xendev op called when Connected.John Haxby6-15/+44
Rename the existing xendev 'connect' op to 'initialised' and introduce a new 'connected' op. This new op, if defined, is called when the backend is connected. Note that since there is no state transition this may be called more than once. Signed-off-by: John Haxby <john.haxby@oracle.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-09Fix include statements for qemu-common.hStefan Weil5-6/+5
* qemu-common.h is not a system include file, so it should be included with "" instead of <>. Otherwise incremental builds might fail because only local include files are checked for changes. * linux-user/syscall.c included the file twice. Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>