Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 569

kvm-83-164.el5_5.30.src.rpm

From 64b4e698615181c6935b2ac9a27559fcedeeff07 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng@linux.intel.com>
Date: Thu, 21 May 2009 17:08:56 -0700
Subject: [PATCH 18/25] kvm: qemu: don't check per-vector mask bit before enable MSI-X

Some guest drivers (e.g. bnx2) do the following to enable MSI-X:
1. Mask all vectors.
2. Write the msg data and address.
3. Enable MSI-X
4. Unmask all the vectors.

For this, check per-vector mask bit before enable MSI-X would cause device
fail to enable MSI-X. So now we only determine the availability of vector
by if msg_data is zero.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
(cherry picked from commit 0bb316db4116e8d59c226333e62e088ba190c252)
Signed-off-by: Chris Wright <chrisw@redhat.com>
Bugzilla: 498085
Message-Id: <1242950943-30180-19-git-send-email-chrisw@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Upstream-status: applied
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Don Dutile <ddutile@redhat.com>
---
 qemu/hw/device-assignment.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 80ced75..09228f4 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -822,9 +822,6 @@ static int assigned_dev_update_msix_mmio(PCIDevice *pci_dev)
     /* Get the usable entry number for allocating */
     for (i = 0; i < entries_max_nr; i++) {
         memcpy(&msg_ctrl, va + i * 16 + 12, 4);
-        /* 0x1 is mask bit for per vector */
-        if (msg_ctrl & 0x1)
-            continue;
         memcpy(&msg_data, va + i * 16 + 8, 4);
         /* Ignore unused entry even it's unmasked */
         if (msg_data == 0)
-- 
1.6.3.rc4.29.g8146