Received: from eggs.gnu.org ([2001:4830:134:3::10]:55220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgBLA-0006im-9X for qemu-devel@nongnu.org; Mon, 20 Oct 2014 07:41:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgBL5-0001q4-79 for qemu-devel@nongnu.org; Mon, 20 Oct 2014 07:41:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgBL4-0001ps-VM for qemu-devel@nongnu.org; Mon, 20 Oct 2014 07:41:27 -0400 From: Markus Armbruster References: <1413797938-18100-1-git-send-email-mst@redhat.com> Date: Mon, 20 Oct 2014 13:41:20 +0200 In-Reply-To: <1413797938-18100-1-git-send-email-mst@redhat.com> (Michael S. Tsirkin's message of "Mon, 20 Oct 2014 12:40:02 +0300") Message-ID: <877fzvq87z.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Anthony Liguori , Le Tan "Michael S. Tsirkin" writes: > (((sid) >> 8) && 0xff) makes no sense > (((sid) >> 8) & 0xff) seems to be what was meant. > > Suggested-by: Markus Armbruster Actually by the reporter of https://bugs.launchpad.net/bugs/1382477 > Signed-off-by: Michael S. Tsirkin > --- > > Compile-tested only. > > include/hw/i386/intel_iommu.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h > index f4701e1..e321ee4 100644 > --- a/include/hw/i386/intel_iommu.h > +++ b/include/hw/i386/intel_iommu.h > @@ -37,7 +37,7 @@ > #define VTD_PCI_DEVFN_MAX 256 > #define VTD_PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) > #define VTD_PCI_FUNC(devfn) ((devfn) & 0x07) > -#define VTD_SID_TO_BUS(sid) (((sid) >> 8) && 0xff) > +#define VTD_SID_TO_BUS(sid) (((sid) >> 8) & 0xff) > #define VTD_SID_TO_DEVFN(sid) ((sid) & 0xff) > > #define DMAR_REG_SIZE 0x230 Can't find the spec right now, but it looks plausible enough. Only use is in vtd_context_device_invalidate(). Bug's impact isn't obvious to me. Reviewed-by: Markus Armbruster