summaryrefslogtreecommitdiffstats
path: root/hw/msix.c
Commit message (Collapse)AuthorAgeFilesLines
* Add endianness as io mem parameterAlexander Graf2010-12-111-1/+2
| | | | | | | | | | | | | As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge branch 'pci' into for_anthonyMichael S. Tsirkin2010-10-271-2/+6
|\
| * msix: clear not only INTA, but all INTx when MSI-X is enabled.Isaku Yamahata2010-09-201-1/+4
| | | | | | | | | | | | | | clear not only INTA, but all INTx when MSI-X is enabled. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: consolidate pci_add_capability_at_offset() into pci_add_capability().Isaku Yamahata2010-09-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | By making pci_add_capability() the special case of pci_add_capability_at_offset() of offset = 0, consolidate pci_add_capability_at_offset() into pci_add_capability(). Cc: Stefan Weil <weil@mail.berlios.de> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Introduce range.hBlue Swirl2010-09-181-0/+1
|/ | | | | | | Extract range functions from pci.h. These will be used by later patches by non-PCI devices. Adjust current users. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove unused DEBUG defines from hw/msix.cJes Sorensen2010-06-141-9/+0
| | | | | | | | Remove unused DEBUG defines from hw/msix.c to avoid having anything define the word DEBUG without any additions such as MSIX_DEBUG. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* msix: remove duplicated defines.Isaku Yamahata2010-05-311-8/+0
| | | | | | | remove defines which are already defined in pci_regs.h Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* msix: use range helper function.Isaku Yamahata2009-12-231-1/+1
| | | | | | | use range helper function in msix_write_config(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* msix: function mask supportMichael S. Tsirkin2009-12-071-18/+46
| | | | | | | | Function mask is a mandatory feature in MSIX spec so not implementing it is a spec violation. Implement. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* msix: macro rename for function mask supportMichael S. Tsirkin2009-12-071-7/+7
| | | | | | | | rename ENABLE_OFFSET -> CONTROL_OFFSET, since same byte includes function mask. This is in preparation for function mask support. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* msix: clear pending bit of an unused vectorMichael S. Tsirkin2009-12-011-10/+17
| | | | | | | | | | | | | | 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>
* msix: fix reset value for enable bitMichael S. Tsirkin2009-12-011-1/+2
| | | | | | | | | 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>
* msix: fix mask bit state after resetMichael S. Tsirkin2009-12-011-0/+11
| | | | | | | PCI spec states that mask bit must be 1 after reset. Make it so. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* msix: add helper to unuse all msix entriesMichael S. Tsirkin2009-12-011-0/+7
| | | | | | will be used by virtio on soft reset Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: introduce pcibus_t to represent pci bus address/size instead of uint32_tIsaku Yamahata2009-11-091-1/+1
| | | | | | | | | | | This patch is preliminary for 64 bit BAR support. Introduce dedicated type, pcibus_t, to represent pci bus address/size instead of uint32_t. Later this type will be changed to uint64_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/msix: fix table access issuesMichael S. Tsirkin2009-10-301-7/+4
| | | | | | | | | | | | | | Fixes a couple of issues with msix table access: - With misbehaving guests, misaligned 4 byte access could overflow msix table and cause qemu to segfault. Since PCI spec requires host to only issue dword-aligned accesses, as a fix, it's enough to mask the address low bits. - Tables use pci format, not native format, and so we must use pci_[sg]et_long on read/write. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu: clean up target page usage in msixMichael S. Tsirkin2009-10-051-25/+24
| | | | | | | | | | Since cpu_register_phys_memory does not require size to be a multiple of target page size, simply make msix page size 0x1000. Do this in msix, reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we no longer have to pass target page around. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-5/+5
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-5/+5
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Compile msix only onceBlue Swirl2009-09-201-25/+25
| | | | | | Get page size in device init. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make CPURead/WriteFunc structure 'const'Blue Swirl2009-08-251-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu: msix nit: clear msix_entries_nr on errorMichael S. Tsirkin2009-07-271-0/+1
| | | | | | | | I don't think it's critical to do this, but it's best to keep uninit and error recovery consistent. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/msi: missing bracesMichael S. Tsirkin2009-07-101-1/+2
| | | | | | | | | MSIX present bit is tested incorrectly, and only happens to work because the bit we are testing is 0x1. Add braces to fix this. Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/msi: clean used vectors state on loadMichael S. Tsirkin2009-07-101-0/+1
| | | | | | | | | Clean up msix vector usage state on load. Since guest might have control over it through the device, the device will have to load this state from file. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix segfault in msix_saveMichael S. Tsirkin2009-07-091-5/+7
| | | | | | | | | This fixes segfault reported by Kevin Wolf, and simplifies the code in msix_save. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix Sparse warningBlue Swirl2009-07-051-1/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu/pci: MSI-X support functionsMichael S. Tsirkin2009-06-241-0/+378
Add functions implementing MSI-X support. First user will be virtio-pci. Note that platform must set a flag to declare MSI supported: this is a safety measure to avoid breaking platforms which should support MSI-X but currently lack this in the interrupt controller emulation. For PC this will be set by APIC. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud