aurel32 [Thu, 18 Dec 2008 22:42:23 +0000 (22:42 +0000)]
target-ppc: fix fres, fsqrte and remove useless code
- fres and fsqrte should not assign a float32 number to a float64 value.
- fre, fres and fsqrte are checking for cases already taken into account
by softfloat and softfloat native. Remove those useless tests.
aliguori [Thu, 18 Dec 2008 01:56:22 +0000 (01:56 +0000)]
Fix the build for non-x86/ppc targets
Since pci.c creates network devices, anything that links against pci.c
(everything) has to link against all network devices. Since virtio-net
also requires virtio, we might as well link every target against all of
the virtio devices.
This suggests that the pci.c network device creation function needs some
refactoring.
aliguori [Wed, 17 Dec 2008 23:28:44 +0000 (23:28 +0000)]
Add HPET emulation to qemu (Beth Kon)
This patch adds HPET emulation. It can be disabled with -disable-hpet. An hpet
provides a more finely granular clocksource than otherwise available on PC.
This means that latency-dependent applications (e.g. multimedia) will generally
be smoother when using the HPET.
aliguori [Wed, 17 Dec 2008 21:35:49 +0000 (21:35 +0000)]
Update to the latest Bochs BIOS
Update the PC BIOS to the latest version, split out the patches into
patch series, and update the README to point to the new location of the
Bochs BIOS source tree.
Also update the gitignore to allow the patch queue directory to be used.
aliguori [Wed, 17 Dec 2008 19:13:11 +0000 (19:13 +0000)]
virtio-net support
This adds virtio-net support. This is based on the virtio-net driver
that exists in kvm-userspace. This also adds a new qemu_sendv_packet
which virtio-net requires.
aurel32 [Tue, 16 Dec 2008 10:44:14 +0000 (10:44 +0000)]
target-ppc: IBM PowerPC 440EP Bamboo reference board emulation
Since most IO devices are integrated into the 440EP chip, "Bamboo support"
mostly entails implementing the -kernel, -initrd, and -append options.
These options are implemented by loading the guest as if u-boot had done it,
i.e. loading a flat device tree, updating it to hold initrd addresses, ram
size, and command line, and passing the FDT address in r3.
Since we use it with KVM, we enable the virtio block driver and include hooks
necessary for KVM support.
aurel32 [Tue, 16 Dec 2008 10:44:06 +0000 (10:44 +0000)]
target-ppc: PowerPC 440EP SoC emulation
Wire up the system-on-chip devices present on 440EP chips.
This patch is a little unusual in that qemu doesn't actually emulate the 440
core, but we use this board code with KVM (which does). If/when 440 core
emulation is supported, the kvm_enabled() hack can be removed.
aurel32 [Tue, 16 Dec 2008 10:43:58 +0000 (10:43 +0000)]
target-ppc: Enable KVM for ppcemb.
Implement hooks called by generic KVM code.
Also add code that will copy the host's CPU and timebase frequencies to the
guest, which is necessary on KVM because the guest can directly access the
timebase.
aurel32 [Tue, 16 Dec 2008 10:43:48 +0000 (10:43 +0000)]
Implement device tree support needed for Bamboo emulation
To implement the -kernel, -initrd, and -append options, 4xx board emulation
must load the guest kernel as if firmware had loaded it. Where u-boot would be
the firmware, we must load the flat device tree into memory and set key fields
such as /chosen/bootargs.
This patch introduces a dependency on libfdt for flat device tree support.
aurel32 [Mon, 15 Dec 2008 23:15:56 +0000 (23:15 +0000)]
target-ppc: create a helper function to allow more flexible RAM allocation for PPC 4xx
The 4xx SDRAM controller supports a small number of banks, and each bank must
be one of a small set of sizes. The number of banks and the supported sizes
varies by SoC.
This function uses the user-specified RAM size to fill in the "ram_bases" and
"ram_sizes" arrays required by ppc4xx_sdram_init().
aurel32 [Mon, 15 Dec 2008 22:59:45 +0000 (22:59 +0000)]
target-ppc: rename ppc405_sdram_init() to ppc4xx_sdram_init()
The SDRAM controller is shared across almost all 405 and 440 embedded
processors, with some slight differences such as the sizes supported for each
memory bank.
aurel32 [Mon, 15 Dec 2008 22:59:34 +0000 (22:59 +0000)]
target-ppc: move PPC4xx SDRAM controller emulation from ppc405_uc.c to ppc4xx_devs.c
The SDRAM controller is shared across almost all 405 and 440 embedded
processors, with some slight differences such as the sizes supported for each
memory bank.
aliguori [Mon, 15 Dec 2008 22:20:42 +0000 (22:20 +0000)]
kvm: sync vcpu state during initialization (Hollis Blanchard)
Currently on x86, qemu initializes CPUState but KVM ignores it and does its
own vcpu initialization. However, PowerPC KVM needs to be able to set the
initial register state to support the -kernel and -append options.
aliguori [Sat, 13 Dec 2008 20:41:58 +0000 (20:41 +0000)]
Correctly initialize msr list in KVM
I believe this was spotted by Gerd Hoffman but I can't find his patch
now. This will cause very subtle corruption on the heap because we
don't allocate the appropriately sized buffer.
aurel32 [Sat, 13 Dec 2008 18:57:21 +0000 (18:57 +0000)]
TCG x86/x86-64: use move with zero-extend for loads/stores
Starting with version 4.3, gcc returns the result of a function in
rax/eax/ax/al instead of rax/eax, depending of the return type. As
a consequence we should use a zero extend moe in TCG loads/stores.
See http://gcc.gnu.org/ml/gcc/2008-01/msg00052.html for more details.
A big thanks to malc who founds the problem and wrote the x86 patch.
aurel32 [Sat, 13 Dec 2008 12:33:02 +0000 (12:33 +0000)]
target-i386: SVM: acknowledge interrupt only after it is taken
SVM specifies that the V_IRQ mask is only to be removed, if the
interrupt that is to be delivered actually is delivered.
As of the SVM rewrite, this mask is always unmasked when the main cpu
loop is processed, leaving a corner case where calling the interrupt
handler causes a #PF. In that case (booting Linux / starting gfxboot)
the current implementation tells the VMM the interrupt is taken, even
though it is not.
This patch modifies the VIRQ unmasking to occur after do_interrupt,
making gfxboot work again.
blueswir1 [Sat, 13 Dec 2008 11:49:17 +0000 (11:49 +0000)]
x86 cleanup
Remove some unnecessary includes, add needed includes, move prototypes to
cpu.h to suppress missing prototype warnings.
Remove unused functions and prototypes (cpu_x86_flush_tlb, cpu_lock,
cpu_unlock, restore_native_fp_state, save_native_fp_state).
Make some functions and data static (f15rk, parity_table, rclw_table,
rclb_table, raise_interrupt, fpu_raise_exception), they are not used
outside op_helper.c anymore.
Make some x86_64 and user only code conditional to avoid warnings.
Document where each function is implemented in cpu.h and exec.h.
blueswir1 [Sat, 13 Dec 2008 08:16:43 +0000 (08:16 +0000)]
Fix TARGET_LONG_BITS warning in TCG
Looking at tcg/tcg.c:828, the bug that the warning indicated would show up as
incorrect PC shown in log, only on 32 bit big endian host emulating a 64 bit
target, -d op flag enabled. Now that dyngen is gone, the patch can be applied.
aliguori [Fri, 12 Dec 2008 20:02:52 +0000 (20:02 +0000)]
Make sure to link librt if we need to.
This is really a stop-gap. The recent thread pool changes uncovered a
deeper issue with how we use librt. We really should be probing for
timer_create and then conditionally enabling that code.
aliguori [Fri, 12 Dec 2008 16:41:40 +0000 (16:41 +0000)]
Replace posix-aio with custom thread pool
glibc implements posix-aio as a thread pool and imposes a number of limitations.
1) it limits one request per-file descriptor. we hack around this by dup()'ing
file descriptors which is hideously ugly
2) it's impossible to add new interfaces and we need a vectored read/write
operation to properly support a zero-copy API.
What has been suggested to me by glibc folks, is to implement whatever new
interfaces we want and then it can eventually be proposed for standardization.
This requires that we implement our own posix-aio implementation though.
This patch implements posix-aio using pthreads. It immediately eliminates the
need for fd pooling.
It performs at least as well as the current posix-aio code (in some
circumstances, even better).