[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] vpci/msix: exit early if MSI-X is disabled


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 1 Dec 2020 18:40:14 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QUilLypEJA41k654QAtYtSzKwPvDXaDonCVZeP+ybGU=; b=VBzgTq7SWTa9gheBt5P4oG7iitpxus0MpWETGiLDI1y3F/6UNZch4sGfPBWHJL+7YgH47TSKjsZ47LRwS0vtbFn2JmZSmX99Fxxy8CYD87pmdhnI/Vijz6pduYdg9BZmuzb9PJcSS73QiA8VIpPibc42KLsktF+yXMG021E3npE3skCF5gy/Gnq85Wj8Bqaqki7fBlaClo0Pj170QeI4zFPqoq6wxJKkqwK+4etFjcbj21hgCznV3E4r5dW9Z4iF5jRYEMCt8PBjEpg2sF2oWb/eF/IAkZ5pUPfEnrP5QiOvIhU338fMc/r02gAy26QnPV0H8bKiOa6dAxlv57Utug==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dqo/vHwpk/3MClzVP8XD1oAHeNbS2LDTcwOhbLB3b4cC3qF8jpFXxm/3VdSKBYyo3HFsBjoy5deYbwGAPHIXkZe3CmgfTEBS0pjjQCTtylOpCEzhG0JdMVvyrHKQVCeTulrXldiZ/ANtopTwJC7fyR5vJZHDuIa0MeLNKg6TdR3wg7mIDKF69rkcM+fXPl3lWGteAYMUnWKcDVhSjznBLR1WZTtPbp6V/VDt4TKyiCAUjqb/LXWIfnHVTgmUOBZXNbTdoZeqBn/nwmywoAvbAmkvf9JzNAaKENWIPcyG7f0ttOQ51wfsGGYKVGyX4cKwIR2u6Zp6BBTHXmtGgDftow==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Dec 2020 17:41:29 +0000
  • Ironport-sdr: SNTO5zvFG3vmfPRGVZxraIs5vumKDfiQncyQajZBiuCY+9XbUTxDf6uCZAfbndae1BpsEfoUP4 LaAbZMY1ytuZTlmvYIPpaejRyUkpqUOL2MzLNxil4pSSjigdu2kR2/mUEBNg2trWrX1lDt7IaN SDw7YDVNiCvIGtiAnefMxYXNTsw+QiXR6KPvMOvSXYDlR3IAOkXKiGiS/Hr9ZKiBqvYYiX/AbK 54qFJMmc+Azd9pSVNMdY7GG+yTA8KvuW8i+AplLGh9Myenu3h0jX/+Zjj3SRRTi5TYRMboK1hz QPo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Do not attempt to mask an MSI-X entry if MSI-X is not enabled. Else it
will lead to hitting the following assert on debug builds:

(XEN) Panic on CPU 13:
(XEN) Assertion 'entry->arch.pirq != INVALID_PIRQ' failed at vmsi.c:843

In order to fix it exit early from the switch in msix_write if MSI-X
is not enabled.

Fixes: d6281be9d0145 ('vpci/msix: add MSI-X handlers')
Reported-by: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/drivers/vpci/msix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 64dd0a929c..93902ba7db 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -357,7 +357,11 @@ static int msix_write(struct vcpu *v, unsigned long addr, 
unsigned int len,
          * so that it picks the new state.
          */
         entry->masked = new_masked;
-        if ( !new_masked && msix->enabled && !msix->masked && entry->updated )
+
+        if ( !msix->enabled )
+            break;
+
+        if ( !new_masked && !msix->masked && entry->updated )
         {
             /*
              * If MSI-X is enabled, the function mask is not active, the entry
-- 
2.29.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.