From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Blue Swirl <blauwirbel@gmail.com>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported
Date: Sun, 4 Dec 2011 12:42:23 +0200 [thread overview]
Message-ID: <20111204104221.GE15464@redhat.com> (raw)
In-Reply-To: <fcf06b2d32d56e7877652ceb6b5f2d4841bda112.1322910904.git.jan.kiszka@web.de>
On Sat, Dec 03, 2011 at 12:17:26PM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Rename msix_supported to msi_supported and control MSI and MSI-X
> activation this way. That was likely to original intention for this
> flag, but MSI support came after MSI-X.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
This patch should go into qemu.git, right?
> ---
> hw/msi.c | 8 ++++++++
> hw/msi.h | 2 ++
> hw/msix.c | 9 ++++-----
> hw/msix.h | 2 --
> hw/pc.c | 4 ++--
> 5 files changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/hw/msi.c b/hw/msi.c
> index f214fcf..5d6ceb6 100644
> --- a/hw/msi.c
> +++ b/hw/msi.c
> @@ -36,6 +36,9 @@
>
> #define PCI_MSI_VECTORS_MAX 32
>
> +/* Flag for interrupt controller to declare MSI/MSI-X support */
> +bool msi_supported;
> +
> /* If we get rid of cap allocator, we won't need this. */
> static inline uint8_t msi_cap_sizeof(uint16_t flags)
> {
> @@ -116,6 +119,11 @@ int msi_init(struct PCIDevice *dev, uint8_t offset,
> uint16_t flags;
> uint8_t cap_size;
> int config_offset;
> +
> + if (!msi_supported) {
> + return -ENOTSUP;
> + }
> +
> MSI_DEV_PRINTF(dev,
> "init offset: 0x%"PRIx8" vector: %"PRId8
> " 64bit %d mask %d\n",
> diff --git a/hw/msi.h b/hw/msi.h
> index 5766018..3040bb0 100644
> --- a/hw/msi.h
> +++ b/hw/msi.h
> @@ -24,6 +24,8 @@
> #include "qemu-common.h"
> #include "pci.h"
>
> +extern bool msi_supported;
> +
> bool msi_enabled(const PCIDevice *dev);
> int msi_init(struct PCIDevice *dev, uint8_t offset,
> unsigned int nr_vectors, bool msi64bit, bool msi_per_vector_mask);
> diff --git a/hw/msix.c b/hw/msix.c
> index b15bafc..8850fbd 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -12,6 +12,7 @@
> */
>
> #include "hw.h"
> +#include "msi.h"
> #include "msix.h"
> #include "pci.h"
> #include "range.h"
> @@ -32,9 +33,6 @@
> #define MSIX_MAX_ENTRIES 32
>
>
> -/* Flag for interrupt controller to declare MSI-X support */
> -int msix_supported;
> -
> /* Add MSI-X capability to the config space for the device. */
> /* Given a bar and its size, add MSI-X table on top of it
> * and fill MSI-X capability in the config space.
> @@ -212,10 +210,11 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
> unsigned bar_nr, unsigned bar_size)
> {
> int ret;
> +
> /* Nothing to do if MSI is not supported by interrupt controller */
> - if (!msix_supported)
> + if (!msi_supported) {
> return -ENOTSUP;
> -
> + }
> if (nentries > MSIX_MAX_ENTRIES)
> return -EINVAL;
>
> diff --git a/hw/msix.h b/hw/msix.h
> index 7e04336..5aba22b 100644
> --- a/hw/msix.h
> +++ b/hw/msix.h
> @@ -29,6 +29,4 @@ void msix_notify(PCIDevice *dev, unsigned vector);
>
> void msix_reset(PCIDevice *dev);
>
> -extern int msix_supported;
> -
> #endif
> diff --git a/hw/pc.c b/hw/pc.c
> index 9328ee5..5225d5b 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -36,7 +36,7 @@
> #include "elf.h"
> #include "multiboot.h"
> #include "mc146818rtc.h"
> -#include "msix.h"
> +#include "msi.h"
> #include "sysbus.h"
> #include "sysemu.h"
> #include "blockdev.h"
> @@ -896,7 +896,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
> apic_mapped = 1;
> }
>
> - msix_supported = 1;
> + msi_supported = true;
>
> return dev;
> }
> --
> 1.7.3.4
next prev parent reply other threads:[~2011-12-04 10:40 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-03 11:17 [Qemu-devel] [RFC][PATCH 00/16] uq/master: Introduce basic irqchip support Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported Jan Kiszka
2011-12-04 10:42 ` Michael S. Tsirkin [this message]
2011-12-04 10:42 ` Jan Kiszka
2011-12-04 13:12 ` Avi Kivity
2011-12-04 13:16 ` Jan Kiszka
2011-12-04 13:26 ` Avi Kivity
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 02/16] kvm: Move kvmclock into hw/kvm folder Jan Kiszka
2011-12-03 19:00 ` Andreas Färber
2011-12-03 22:33 ` Jan Kiszka
2011-12-04 10:43 ` Avi Kivity
2011-12-04 10:46 ` Jan Kiszka
2011-12-05 10:43 ` Andreas Färber
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 03/16] apic: Stop timer on reset Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 04/16] apic: Factor out core for KVM reuse Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 05/16] apic: Open-code timer save/restore Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 06/16] i8259: Factor out core for KVM reuse Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 07/16] ioapic: Convert to memory API Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 08/16] ioapic: Reject non-dword accesses to IOWIN register Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 09/16] ioapic: Factor out core for KVM reuse Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 10/16] memory: Introduce memory_region_init_reservation Jan Kiszka
2011-12-04 13:20 ` Avi Kivity
2011-12-04 13:24 ` Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support Jan Kiszka
2011-12-04 13:23 ` Avi Kivity
2011-12-04 13:27 ` Jan Kiszka
2011-12-04 13:28 ` Avi Kivity
2011-12-04 13:30 ` Jan Kiszka
2011-12-04 13:32 ` Avi Kivity
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 12/16] kvm: x86: Establish IRQ0 override control Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 13/16] kvm: x86: Add user space part for in-kernel APIC Jan Kiszka
2011-12-04 13:24 ` Avi Kivity
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259 Jan Kiszka
2011-12-04 13:31 ` Avi Kivity
2011-12-04 13:42 ` Jan Kiszka
2011-12-04 13:49 ` Avi Kivity
2011-12-04 13:51 ` Jan Kiszka
2011-12-04 14:04 ` Avi Kivity
2011-12-04 14:06 ` Jan Kiszka
2011-12-04 15:12 ` Avi Kivity
2011-12-04 15:19 ` Jan Kiszka
2011-12-04 16:35 ` Avi Kivity
2011-12-04 21:31 ` Blue Swirl
2011-12-04 21:38 ` Jan Kiszka
2011-12-05 10:01 ` Avi Kivity
2011-12-05 11:37 ` Jan Kiszka
2011-12-05 12:36 ` Avi Kivity
2011-12-05 12:47 ` Jan Kiszka
2011-12-05 13:14 ` Avi Kivity
2011-12-05 13:29 ` Jan Kiszka
2011-12-05 13:36 ` Avi Kivity
2011-12-05 13:55 ` Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 15/16] kvm: x86: Add user space part for in-kernel IOAPIC Jan Kiszka
2011-12-03 11:17 ` [Qemu-devel] [RFC][PATCH 16/16] kvm: Arm in-kernel irqchip support Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111204104221.GE15464@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).