Commit Graph

9708 Commits

Author SHA1 Message Date
Anthony Liguori 365369847f Merge commit 'mst/for_anthony' into mst 2009-12-01 11:54:39 -06:00
Michael S. Tsirkin 98304c846d msix: clear pending bit of an unused vector
PCI spec states:
if a masked vector has its Pending bit set, and the associated
underlying interrupt events are somehow satisfied (usually by software
though the exact manner is function-specific), the function must clear
the Pending bit, to avoid sending a spurious interrupt message later
when software unmasks the vector.

In our case this happens if vector becomes unused.
Clear pending bit in this case.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 18:00:14 +02:00
Michael S. Tsirkin 1f944c661a msix: fix reset value for enable bit
On reset, we currently clear all bits in msix control register *except*
enable bit.  This is wrong: the spec says we should clear writeable
bits: function mask and enable bit.
Correct this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 18:00:00 +02:00
Michael S. Tsirkin ae1be0bbc1 msix: fix mask bit state after reset
PCI spec states that mask bit must be 1 after reset.
Make it so.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:59:54 +02:00
Michael S. Tsirkin 1b8e9b2742 virtio: do not reset msix state on soft reset
msix state is managed by OS, not the
driver, so it's wrong to touch it
on io from driver.
Mark all vectors unused instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:58:48 +02:00
Michael S. Tsirkin b5f28bcaee msix: add helper to unuse all msix entries
will be used by virtio on soft reset

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:58:27 +02:00
Michael S. Tsirkin 88a9556430 pci: convert goto into scope in bridge_filter
goto into scope is evil. rearrange pci_bridge_filter
so that we always go to end of function on error.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-01 17:52:51 +02:00
Isaku Yamahata d46636b883 pci: pci bridge related clean up.
- fix bridge prefetchable memory accesser to check 64bit or not.
- use pcibus_t consistently instead mixing pcibus_t and uint64_t.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:47 +02:00
Isaku Yamahata 10c9c329da pci: fix pci_config_get_io_base().
fix typo in pci_config_get_io_base().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:43 +02:00
Isaku Yamahata b47b0706f1 pci: remove magic number, 256 in pci.c
This patch replaces magic number, 256, with ARRAY_SIZE().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:39 +02:00
Michael S. Tsirkin 876a350d3d pci: split up up pci_update mappings
Split bar address math into a separate function.
In particular, this gets rid of an ugly forward goto
into scope that we have there.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-01 17:52:35 +02:00
Isaku Yamahata ec50344230 pci: clean up of pci_update_mappings()
This patch converts r->size == 0 to !r_size.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:28 +02:00
Isaku Yamahata 2c56b44b88 pci: remove unused constants
This patch removes unused constants committed by
fb23162885.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:15 +02:00
Isaku Yamahata fb47a2e983 pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.
This patch moves two typedefs, PCIHostState and PCIExpressHost to
qemu-common.h for consistency as PCIBus and PCIDevice are typedefed
in qemu-common.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:08 +02:00
Isaku Yamahata 3c217c14f5 pci: remove some unnecessary comment in pci.h
This patch removes some comment which should go into commit log
in pci.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:04 +02:00
Isaku Yamahata 3e21ffc954 pci: clean up of pci_init_wmask().
This patch replaces for loop by memset in pci_init_wmask().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:52:01 +02:00
Isaku Yamahata c34369d48c pci: kill unnecessary included in pci.c
including pci_host.h isn't needed by pci.c.
This patch kills it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:58 +02:00
Isaku Yamahata 42331e9f2f pci_host: remove unnecessary & 0xff.
This patch removes unnecessary & 0xff in pci_dev_find_by_addr().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:53 +02:00
Isaku Yamahata c469e1dd63 pci: s/pci_find_host_bus/pci_find_root_bus/g
This patch renames pci_find_host_bus() to pci_find_root_bus()
as suggested by "Michael S. Tsirkin" <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:49 +02:00
Isaku Yamahata 070297d260 pci: remove pci_sub_bus() by open coding.
Because pci_sub_bus() is used only once so eliminate it
by open coding as suggested by "Michael S. Tsirkin" <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:43 +02:00
Isaku Yamahata f08b32fe95 pci: shorten pci_host_{conf, data}_register_xxx function a bit.
pci_host_data_register_io_memory and its variants are too long a bit.
So shorten them. Now they are
pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:37 +02:00
Isaku Yamahata 8d6514f8dd pci: rename (pci_/pcie_mmcfg_)addr_to_dev
This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev()
to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr()
as "Michael S. Tsirkin" <mst@redhat.com> suggested.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:31 +02:00
Isaku Yamahata 7ac901cd18 pci: remove pci_addr_to_config() by open code
This patch removes pci_addr_to_config() and open code it
as suggested by Michael S. Tsirkin <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:26 +02:00
Michael S. Tsirkin 4677d8ed9d pci: simplify (pci_/pcie_mmcfg_)data_read()
Remove switch on length: we don't care about
high bits for value, so just return all ones
if no device.  And add one assert().

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-01 17:51:21 +02:00
Isaku Yamahata b6243d991a pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]
so the declaration of pci_data_{read, write}() should be in
pci_host.h
This patch moves them from pci.h to pci_host.h for consistency.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:15 +02:00
Isaku Yamahata f88d7509b4 pci: fix pci_info_device().
It printed wrong limit value of bridge.
This patch fixes it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:10 +02:00
Michael S. Tsirkin 18e08a5529 pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren't
defined in pci.h. Clean up moving things
to appropriate headers, and update all users.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01 17:51:04 +02:00
Aurelien Jarno 0cbfcd2b03 tcg: increase TCG_MAX_OP_SIZE to 192
This is needed on a MIPS host and a 64-bit cross-endian target.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-01 00:06:15 +00:00
Aurelien Jarno afa05235a5 tcg: initial mips support
Based on a patch from Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>

A few words about design choices:
* Two registers, at and t0, are reserved for TCG internal use. They are
  useful for bswap and 64-bit ops.
* Most ops supports a constant argument with value 0, which is actually
  mapped to the zero register.
* While the at register is available for constant loading, ops only
  support a limited range of constants. TCG does a better job doing the
  register allocation and constant loading by itself. There are plenty of
  registers available anyway.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-01 00:06:15 +00:00
Aurelien Jarno e7139c440c target-mips: use physical address in lladdr
Currently the ll/sc instructions use the virtual address in both
user and system mode. Use the physical address insteead in system
mode.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-30 16:18:28 +01:00
Aurelien Jarno 25b91e32e0 target-mips: add a function to do virtual -> physical translations
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-30 16:10:04 +01:00
Aurelien Jarno 1147e18994 target-mips: split code raising MMU exception in a separate function
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-30 16:10:00 +01:00
Aurelien Jarno 0ae430454c target-mips: factorize load/store code in op_helper.c
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-30 16:06:25 +01:00
Aurelien Jarno bbe813a2dd Fix commit a167ba5085
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-30 15:42:59 +01:00
Aurelien Jarno a167ba5085 Add support for GNU/kFreeBSD
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-29 18:00:41 +01:00
Aurelien Jarno 3098b9fde9 Revert "vga: do not resize the screen on hw_invalidate"
This causes ctrl+alt+u or ctrl+alt+f to not work when windows hasn't been
resized first. Other graphic emulators do resize the screen on
hw_invalidate.

This reverts commit 0bd8246bfe.
2009-11-27 18:42:26 +01:00
Stefan Weil 63e86b2e13 Makefile: Fix spelling
Replace defconfing -> defconfig

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:53:50 +01:00
Aurelien Jarno 7d30175271 tcg: fix tcg_regset_{set,reset}_reg with more than 32 registers
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:51:13 +01:00
Arnaud Patard fea0ac23c7 cpu-all.h: fix cpu_get_real_ticks on mips host
Fix cpu_get_real_ticks:
- check should be done on __mips and not __mips_isa_rev
- linux kernels >= 2.6.25 are emulating the 2 needed rdhwr functions
  so it's safe to use rdhwr.

This is better than what's currently in but it doesn't mean it works nicely
Some tests needs to be done imho

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:51:13 +01:00
Arnaud Patard 3ca055883b linux-user: remove hardcoded value of _NSIG in signal.c
In a bunch of places, 64 is used as value of _NSIG but it's wrong
at least on MIPS were _NSIG is 128.

Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:51:12 +01:00
Aurelien Jarno 016b2b287d tcg/ppc64,x86_64: fix constraints of op_qemu_st64
This op only takes two arguments, not two.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:51:12 +01:00
Paul Brook e92734555f Add missing break.
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-24 13:10:08 +00:00
Anthony Liguori b0293e54af Update SeaBIOS
This includes the following changes:

  42bc394 Make sure to reenable ata interrupts even on error.
  494dfc6 Move SeaBIOS post/boot stack to avoid conflict with gPXE.
  3133e38 Test for broken gcc -combine on FC12.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-23 12:53:22 -06:00
Paul Brook 426f5abcaa ARM atomic ops rewrite
Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:35:13 +00:00
Paul Brook eee4850422 ARM RealView I2C
Add ARM Realview I2C host emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:27:40 +00:00
Paul Brook 3cd035d863 GPIO I2C rework
Reqrite bitbanging I2C implementation.  New code improves stop/start
condition handling, and gives more accurate input line level.

Introduce intermediate abstraction layer for I2C bitbanging that
is not connected via a GPIO port.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:27:40 +00:00
Paul Brook 1dfe3943e9 DS1338 RTC
Implement MAXIM SD1338 RTC+NVRAM.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:27:40 +00:00
Paul Brook abd0c6bda0 BCD cleanup
Combine multiple BCD implementations.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:27:40 +00:00
Paul Brook a992fe3d0f Makefile dependencies for device configs
Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code.  If a config already exists but is older than the
default then print a warning.

Also remove config-devices.h.  Code does not and should not care which
devices are being built.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:24:54 +00:00
Aurelien Jarno 60c9af07aa target-mips: fix physical address type in MMU functions
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-22 14:37:04 +01:00