From patchwork Wed Oct 23 22:47:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 1182541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="IOo0QSog"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46z5BT5PpCz9sNx for ; Thu, 24 Oct 2019 09:48:15 +1100 (AEDT) Received: from localhost ([::1]:51848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNPQI-0002JP-Qq for incoming@patchwork.ozlabs.org; Wed, 23 Oct 2019 18:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58500) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNPPY-0002G0-55 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 18:47:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNPPT-0007Lc-NA for qemu-devel@nongnu.org; Wed, 23 Oct 2019 18:47:21 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:44596 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNPPQ-0007DP-2K for qemu-devel@nongnu.org; Wed, 23 Oct 2019 18:47:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571870833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDDY6oOVAl1wZFIuiv6IAxl42tD8bgPjZNcyepNtE/I=; b=IOo0QSog1oR8YyGsFQLDu0veHbJPlUL7Qe7kNIEzPzom3CBXKFTtVoIbtbDAdLOQmcgB80 gBKqNvrbmiNxlNvV5fIjAcgth6XyUurz3xicYVWQItWqsNZU5aCc7evIGZopra/d41bJ/L 24IOnXo5nSfX0RiJs4ubeneH0T+WM8E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-114-Fj0MvnJ3N4C12QfD-2nEDQ-1; Wed, 23 Oct 2019 18:47:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 641731800D6B for ; Wed, 23 Oct 2019 22:47:10 +0000 (UTC) Received: from gimli.home (ovpn-118-102.phx2.redhat.com [10.3.118.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 858605D6D0; Wed, 23 Oct 2019 22:47:03 +0000 (UTC) Subject: [RESEND PATCH 0/2] PCI DMA alias support From: Alex Williamson To: qemu-devel@nongnu.org Date: Wed, 23 Oct 2019 16:47:02 -0600 Message-ID: <157187055395.5439.6693401317571144578.stgit@gimli.home> User-Agent: StGit/0.19-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: Fj0MvnJ3N4C12QfD-2nEDQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peterx@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Previous posting: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg06182.html Rebased (no change) and added Peter's R-b. Please apply for QEMU 4.2. Previous cover letter: Please see patch 1/ for the motivation and utility of this series. This v1 submission improves on the previous RFC with revised commit logs, comments, and more testing, and the missing IVRS support for DMA alias ranges is now included. Testing has been done with Linux guests with both SeaBIOS and OVMF with configurations of intel-iommu and amd-iommu. Intel-iommu testing includes device assignment, amd-iommu is necessarily limited to emulated devices with interrupt remapping disabled and iommu=pt in the guest (enabling interrupt remapping or disabling guest passthrough mode fails to work regardless of this series). This series is NOT intended for QEMU v4.1. Thanks, Alex --- Alex Williamson (2): pci: Use PCI aliases when determining device IOMMU address space hw/i386: AMD-Vi IVRS DMA alias support hw/i386/acpi-build.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++--- hw/pci/pci.c | 43 ++++++++++++++++- 2 files changed, 160 insertions(+), 10 deletions(-)