From patchwork Tue Jan 26 01:34:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jianzhong,Chang" X-Patchwork-Id: 8117991 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F17019F818 for ; Tue, 26 Jan 2016 04:52:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FFAF2027D for ; Tue, 26 Jan 2016 04:52:11 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2BC1A20274 for ; Tue, 26 Jan 2016 04:52:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aNvYb-0007ov-Ex; Tue, 26 Jan 2016 04:48:45 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aNsfI-00062u-TC for xen-devel@lists.xen.org; Tue, 26 Jan 2016 01:43:29 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id 39/A6-07165-04FC6A65; Tue, 26 Jan 2016 01:43:28 +0000 X-Env-Sender: changjzh@gmail.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1453772606!19251717!1 X-Originating-IP: [209.85.220.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55027 invoked from network); 26 Jan 2016 01:43:27 -0000 Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by server-12.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 26 Jan 2016 01:43:27 -0000 Received: by mail-pa0-f45.google.com with SMTP id yy13so89535756pab.3 for ; Mon, 25 Jan 2016 17:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9hxMur8NZuEYr5ieMFvl6TBL5f6Lk6rs0OMqth1W7BQ=; b=FyvkjgE7qmkm+k2hTt5Ky5tNk0UCNnDuZe9Vxcj2TWMSZHpjQLDNJNNBXxJjD7qS+e Y5ULEN3JUrJ6JgUDAyc7eX5qlWobWjTtV5TVqDLF/PUweoSXNgjN4TO0jsqVzCDRLXlj T+fqaunzUkj5Tcs+tHNK8EHcZUff+yXooNuz3SUWyZaqByd+rIxvyUaUcrPz/PC6eH9s QeSNkV6cX+ZWBhtFOBZiK/whvW6qbTC2ebED9a+tSHyDomRp85PoQsUIJLcNDPc86QTG KM1XzeCO0dAplVzu4Y3/fCbnRnTpDcThFoK69V0fSS+B5d1e+ZoGUKPtR9zRUdZDlKrj EY1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9hxMur8NZuEYr5ieMFvl6TBL5f6Lk6rs0OMqth1W7BQ=; b=S6ekio/b3TuUiasvFxBppBMCX4YUkF+4x/AIaa7tMsN7J+d/YePtVKbxL+F84vPGq6 LrVsfmF8nT4F7Op1ozPlBinLsENMzY/Q9wS1EtE4A6BJ9rE9rKOBb9p1TkpRGnNn8/av 7Rw6dfgOp+W5W4dOucY82eJVKaGjlJrwl3j0JuzAgl5M2MEKeiYfWpzakmh4NYGoCjV6 C0klDt14luuXrsMTqnFgAxBWk4z84k9Dsg8KcpIKMJlJ98UcKlBiFFPEkym63g20cpZW n0UKazpbfjs6O5KGKqs8pYakkhYFNDraypLCxGZwWtZLwXh9WjJdYjn66pcrQBc8rKbW iJsQ== X-Gm-Message-State: AG10YOQYkveDjAE1UhnFAoTopKPtApxq3s3bzwQbDc6fsK7dVeij53TJ1Ix2keSyoD//jA== X-Received: by 10.66.218.103 with SMTP id pf7mr29999024pac.140.1453772605713; Mon, 25 Jan 2016 17:43:25 -0800 (PST) Received: from localhost.localdomain ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id a62sm31479182pfj.40.2016.01.25.17.43.22 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Jan 2016 17:43:24 -0800 (PST) From: "Jianzhong,Chang" To: keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, xen-devel@lists.xen.org Date: Tue, 26 Jan 2016 09:34:52 +0800 Message-Id: <1453772092-24866-1-git-send-email-changjzh@gmail.com> X-Mailer: git-send-email 1.7.1 X-Mailman-Approved-At: Tue, 26 Jan 2016 04:48:43 +0000 Cc: "Jianzhong,Chang" Subject: [Xen-devel] [PATCH] xen vtd : set msi guest_masked 0 by default X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are some problems when msi guest_masked is set to 1 by default. When guest os is windows 2008 r2 server, the device(eg X540-AT2 vf) is not initialized correctly. Host will always receive message like this :"VF Reset msg received from vf". Guest has network connectivity issues, and can not correctly receive/send the packet. So, guest_masked is set to 0 by default. Signed-off-by: Jianzhong,Chang --- xen/arch/x86/msi.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index 5a481f6..b4f60a3 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -512,7 +512,7 @@ void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask) static unsigned int startup_msi_irq(struct irq_desc *desc) { - if ( unlikely(!msi_set_mask_bit(desc, 0, !!(desc->status & IRQ_GUEST))) ) + if ( unlikely(!msi_set_mask_bit(desc, 0, 0) )) WARN(); return 0; } @@ -972,7 +972,7 @@ static int msix_capability_init(struct pci_dev *dev, entry->msi_attrib.entry_nr = msi->entry_nr; entry->msi_attrib.maskbit = 1; entry->msi_attrib.host_masked = 1; - entry->msi_attrib.guest_masked = 1; + entry->msi_attrib.guest_masked = 0; entry->msi_attrib.pos = pos; entry->irq = msi->irq; entry->dev = dev;