From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rui Guo Subject: [PATCH 1/3] qemu-xen-trad/pt_msi_disable: do not clear all MSI flags Date: Fri, 8 Feb 2013 00:12:06 +0800 Message-ID: <1360253528-5424-2-git-send-email-firemeteor@users.sourceforge.net> References: <1360253528-5424-1-git-send-email-firemeteor@users.sourceforge.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1360253528-5424-1-git-send-email-firemeteor@users.sourceforge.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com Cc: Rui Guo , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org "qemu-xen-trad: fix msi_translate with PV event delivery" added a pt_msi_disable() call into pt_msgctrl_reg_write, clearing the MSI flags as a consequence. MSIs get enabled again soon after by calling pt_msi_setup. However the MSI flags are only setup once in the pt_msgctrl_reg_init function, so from the QEMU point of view the device has lost some important properties, like for example PCI_MSI_FLAGS_64BIT. This patch fixes the bug by clearing only the MSI enabled/mapped/initialized flags in pt_msi_disable. Signed-off-by: Stefano Stabellini Tested-by: G.R. Xen-devel: http://marc.info/?l=xen-devel&m=135489879503075 --- hw/pt-msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pt-msi.c b/hw/pt-msi.c index 73f737d..b03b989 100644 --- a/hw/pt-msi.c +++ b/hw/pt-msi.c @@ -213,7 +213,7 @@ void pt_msi_disable(struct pt_dev *dev) out: /* clear msi info */ - dev->msi->flags = 0; + dev->msi->flags &= ~(MSI_FLAG_UNINIT | PT_MSI_MAPPED | PCI_MSI_FLAGS_ENABLE); dev->msi->pirq = -1; dev->msi_trans_en = 0; } -- 1.7.10.4