From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E184EC3A5A4 for ; Fri, 23 Aug 2019 23:06:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C40E22173B for ; Fri, 23 Aug 2019 23:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbfHWXGo (ORCPT ); Fri, 23 Aug 2019 19:06:44 -0400 Received: from ale.deltatee.com ([207.54.116.67]:37440 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfHWXGo (ORCPT ); Fri, 23 Aug 2019 19:06:44 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1i1Idf-0004su-T5; Fri, 23 Aug 2019 17:06:36 -0600 To: Nadav Amit , Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, David Woodhouse , Jacob Pan References: <20190820085317.29458-1-namit@vmware.com> From: Logan Gunthorpe Message-ID: Date: Fri, 23 Aug 2019 17:06:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190820085317.29458-1-namit@vmware.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: jacob.jun.pan@linux.intel.com, dwmw2@infradead.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, joro@8bytes.org, namit@vmware.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH] iommu/vt-d: Fix wrong analysis whether devices share the same bus X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-08-20 2:53 a.m., Nadav Amit wrote: > set_msi_sid_cb() is used to determine whether device aliases share the > same bus, but it can provide false indications that aliases use the same > bus when in fact they do not. The reason is that set_msi_sid_cb() > assumes that pdev is fixed, while actually pci_for_each_dma_alias() can > call fn() when pdev is set to a subordinate device. > > As a result, running an VM on ESX with VT-d emulation enabled can > results in the log warning such as: > > DMAR: [INTR-REMAP] Request device [00:11.0] fault index 3b [fault reason 38] Blocked an interrupt request due to source-id verification failure > > This seems to cause additional ata errors such as: > ata3.00: qc timeout (cmd 0xa1) > ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4) > > These timeouts also cause boot to be much longer and other errors. > > Fix it by checking comparing the alias with the previous one instead. > > Fixes: 3f0c625c6ae71 ("iommu/vt-d: Allow interrupts from the entire bus for aliased devices") > Cc: stable@vger.kernel.org > Cc: Logan Gunthorpe > Cc: David Woodhouse > Cc: Joerg Roedel > Cc: Jacob Pan > Signed-off-by: Nadav Amit This looks good to me. Reviewed-by: Logan Gunthorpe Thanks! Logan