From patchwork Mon Dec 16 16:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1210618 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=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YWBDEQe6"; 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 47c71B1NV6z9sRX for ; Tue, 17 Dec 2019 04:04:46 +1100 (AEDT) Received: from localhost ([::1]:57016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtnX-000680-9x for incoming@patchwork.ozlabs.org; Mon, 16 Dec 2019 12:04:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57386) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtFe-0005uG-VM for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtFd-0000ND-Lt for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:42 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igtFd-0000KB-BO for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:41 -0500 Received: by mail-wr1-x444.google.com with SMTP id g17so8055345wro.2 for ; Mon, 16 Dec 2019 08:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=9NSUuNQ9Jf+FzPsRmj7s9FDau0CX5jauhzpAS1A8igc=; b=YWBDEQe6D1eKZ9PcOGWcCkECUNXngyWNgZyJNhAyFKOSLQsudtuQnoU5YBxOR3v3P+ aRqmtfVTGj12j3OyRbSPA/N6pFvzD+O5CTpQKwwZua0J57nAky/aJYLPCKUtVC23NxHZ MZUVnApZYjkpmsfLywDg7jTog/mu3+6raktWv9oNm6PkbOXRahyhm4y93aqUj9Qzr4Q2 kP3FJJYUs4nVSrckEqMawc5yh3x+C1DcoimLSTCnXWXdFpGXzWRumZQkoHr9FOP0eFfd vFnEfnI2QYT24DKt8/BivCJceQ3r7RWi5YCe6dOillj1e5QewMfpmC6fAipIIldH4bqx kxSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=9NSUuNQ9Jf+FzPsRmj7s9FDau0CX5jauhzpAS1A8igc=; b=EXlKNtVdRQMcKKHXoc9qHaCDIX7PKHpqZYvWBymi11mmaKXTmQpSVKS2Rhi2jt/5qZ gHLWOIrm9AO16L86Vlik+YtNRlAFPfN4EntCg5oaYGPsvQWyJ+WCkcfOf6mP6W8ICHu9 OrXcQ+9Nh3mR+aAWeHcsqKroFvlKEA/OJ8cVX0VnmSZ9mi9ldJSUs4yCJ4YDpDh4URuf uqHV2AHTrkjlEfoozp3wcuawfRt+rYjDethQxqZCsGpKRQGa+J/S8joVOu7XvfI0CWo8 Am8X8yE3+XHaiquYtOsVWs9UKckDmdmuAXbo+MrWYU8dh97GrvB/6WIaUrjDC+YQ3TRM yHMg== X-Gm-Message-State: APjAAAXOikMcxdFNCDBT5skZW8IxOoAPJNUL4RG+zonf5dcuPtMSaOdU 5GmohmqMqWihcT8HHiNIT/8bK10C X-Google-Smtp-Source: APXvYqw+R9I8WJRF4Mg35XRkh2EHHVCyrthR7Lb75RfJ9J0jH8UZ3Akjza51/mN3N6lwL1KJalUuNQ== X-Received: by 2002:adf:fe4d:: with SMTP id m13mr28683761wrs.179.1576513780139; Mon, 16 Dec 2019 08:29:40 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id q68sm19962334wme.14.2019.12.16.08.29.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 08:29:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 52/62] pc: stubify x86 iommu Date: Mon, 16 Dec 2019 17:28:36 +0100 Message-Id: <1576513726-53700-53-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576513726-53700-1-git-send-email-pbonzini@redhat.com> References: <1576513726-53700-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Allow building microvm without x86-iommu.c. Signed-off-by: Paolo Bonzini --- hw/i386/Kconfig | 6 ++++++ hw/i386/Makefile.objs | 3 ++- hw/i386/x86-iommu-stub.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 hw/i386/x86-iommu-stub.c diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 5a49434..91cf584 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -103,11 +103,17 @@ config MICROVM select MC146818RTC select VIRTIO_MMIO +config X86_IOMMU + bool + depends on PC + config VTD bool + select X86_IOMMU config AMD_IOMMU bool + select X86_IOMMU config VMPORT bool diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 01ae202..1236c3b 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -6,7 +6,8 @@ obj-$(CONFIG_I440FX) += pc_piix.o obj-$(CONFIG_Q35) += pc_q35.o obj-$(CONFIG_MICROVM) += microvm.o obj-y += fw_cfg.o -obj-y += x86-iommu.o +obj-$(CONFIG_X86_IOMMU) += x86-iommu.o +obj-$(call lnot,$(CONFIG_X86_IOMMU)) += x86-iommu-stub.o obj-$(CONFIG_VTD) += intel_iommu.o obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o obj-$(CONFIG_XEN) += ../xenpv/ xen/ diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c new file mode 100644 index 0000000..03576cd --- /dev/null +++ b/hw/i386/x86-iommu-stub.c @@ -0,0 +1,34 @@ +/* + * Stubs for X86 IOMMU emulation + * + * Copyright (C) 2019 Red Hat, Inc. + * + * Author: Paolo Bonzini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "qemu/osdep.h" +#include "hw/i386/x86-iommu.h" + +void x86_iommu_iec_register_notifier(X86IOMMUState *iommu, + iec_notify_fn fn, void *data) +{ +} + +X86IOMMUState *x86_iommu_get_default(void) +{ + return NULL; +} +