From patchwork Thu Sep 27 16:45:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 975805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="b1t028vr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Lglq5Wz6z9s3l for ; Fri, 28 Sep 2018 02:50:15 +1000 (AEST) Received: from localhost ([::1]:38041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5ZUT-0002hz-3K for incoming@patchwork.ozlabs.org; Thu, 27 Sep 2018 12:50:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5ZQU-0007qL-4Z for qemu-devel@nongnu.org; Thu, 27 Sep 2018 12:46:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5ZQQ-0002Ei-4e for qemu-devel@nongnu.org; Thu, 27 Sep 2018 12:46:04 -0400 Received: from mail-co1nam03on0053.outbound.protection.outlook.com ([104.47.40.53]:43024 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5ZQP-0002B6-RV for qemu-devel@nongnu.org; Thu, 27 Sep 2018 12:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gzXZynEfCcFIXtSokYuavKsqkYY61mCI+0SpExWdrIo=; b=b1t028vrxwfl3GsPuva/NoDCT1pvUKlv3OBL/asKWos6UQFnb4H4GzFD0wojuJRI+nr9AQFEi7TeTgyvNbN7aH8lSIHKAPgz9lqTIorZx7mywvubfeq1UWwAztJwUwLLnQY+dXUVurHF7wY3IposPsk4r5hcLFgFSTN73cZsSTU= Received: from DM6PR12MB2682.namprd12.prod.outlook.com (20.176.116.31) by DM6PR12MB2748.namprd12.prod.outlook.com (20.176.118.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Thu, 27 Sep 2018 16:45:53 +0000 Received: from DM6PR12MB2682.namprd12.prod.outlook.com ([fe80::7c34:f2e8:a8a9:cab8]) by DM6PR12MB2682.namprd12.prod.outlook.com ([fe80::7c34:f2e8:a8a9:cab8%3]) with mapi id 15.20.1164.024; Thu, 27 Sep 2018 16:45:53 +0000 From: "Singh, Brijesh" To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v4 1/9] x86_iommu: move the kernel-irqchip check in common code Thread-Index: AQHUVoGNWEi4PTRAHUCseG1NQHIaEw== Date: Thu, 27 Sep 2018 16:45:53 +0000 Message-ID: <1538066739-13095-2-git-send-email-brijesh.singh@amd.com> References: <1538066739-13095-1-git-send-email-brijesh.singh@amd.com> In-Reply-To: <1538066739-13095-1-git-send-email-brijesh.singh@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CY4PR1201CA0007.namprd12.prod.outlook.com (2603:10b6:910:16::17) To DM6PR12MB2682.namprd12.prod.outlook.com (2603:10b6:5:4a::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM6PR12MB2748; 20:L09EL5BwV/rUMsSMgpaO/+s0a4/H5M2uPwwdZwhbveO6CsxmYMuuWhMNdEuRKBsf1BHfgjYSxdH0vAp7MMgN0Nzv2dCxfXb8kJwEhhUWe44x/lu0hD1CqSOkTO+UKeFI9RfpqqITLNGIoMRhCT/snt6mCg2/VnLUdxYtLPeJaANMeZDSPdgmK6aZcEW0K800T6LwnAkKAB2IO22CrKHF4/LgFrmL+FjqGQev3EKEeln4MJvoEJTlY8S8OHeNMQ1E x-ms-office365-filtering-correlation-id: 5c3d6afb-fba6-4f76-92ef-08d62498b02d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM6PR12MB2748; x-ms-traffictypediagnostic: DM6PR12MB2748: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(85827821059158); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:DM6PR12MB2748; BCL:0; PCL:0; RULEID:; SRVR:DM6PR12MB2748; x-forefront-prvs: 0808323E97 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39860400002)(136003)(396003)(376002)(199004)(189003)(8676002)(6916009)(2351001)(54906003)(86362001)(105586002)(14454004)(7736002)(106356001)(99286004)(34290500001)(36756003)(2906002)(305945005)(68736007)(81156014)(478600001)(5660300001)(5640700003)(6116002)(3846002)(26005)(81166006)(39060400002)(2616005)(446003)(76176011)(2900100001)(6486002)(6506007)(5250100002)(8936002)(316002)(476003)(11346002)(256004)(71200400001)(52116002)(71190400001)(53936002)(2501003)(66066001)(6436002)(486006)(97736004)(102836004)(25786009)(4326008)(6512007)(186003)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2748; H:DM6PR12MB2682.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: VVfUnfL1fxq+8Mi946ZPkBHJfvkkZPXAl+Ts8rnzR8pXQpWiUGBitOEfVCL01EYFO6BL4bpCT0EJchpnTX2OlTxoqrlKeQQtN0PAWebo3MwqjE+h0o034Qx/GeP1RrqxSSeE0AJPYbzBurUCxRvIei9pzuDrwqr4/oxgAGASJ98GOvOQN0xLBhLlYJEZ+IgLe/LyfHF+bvIxgYAkBCfToFBKe6zxaRPYoyOpkIWXMsy9IHt4BH0UmQLRuLsAU8/nv6QF1fLCQ5j+h+eZ/6uYKbwsw1fP5z4iOs6wfVUFLHo4nsK7bhR9Jl+oX+ab4z9ILBLN0LIjbC/9dsHONgXj+tegUzB4sJ9HMz2i21yTJ2Q= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c3d6afb-fba6-4f76-92ef-08d62498b02d X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2018 16:45:53.2412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2748 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.53 Subject: [Qemu-devel] [PATCH v4 1/9] x86_iommu: move the kernel-irqchip check in common code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Lendacky, Thomas" , "Singh, Brijesh" , Eduardo Habkost , "Michael S. Tsirkin" , Peter Xu , Paolo Bonzini , "Suthikulpanit, Suravee" , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Interrupt remapping needs kernel-irqchip={off|split} on both Intel and AMD platforms. Move the check in common place. Signed-off-by: Brijesh Singh Reviewed-by: Peter Xu Cc: Peter Xu Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Tom Lendacky Cc: Suravee Suthikulpanit --- hw/i386/intel_iommu.c | 7 ------- hw/i386/x86-iommu.c | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 3dfada1..84dbc20 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3248,13 +3248,6 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) { X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(s); - /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */ - if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() && - !kvm_irqchip_is_split()) { - error_setg(errp, "Intel Interrupt Remapping cannot work with " - "kernel-irqchip=on, please use 'split|off'."); - return false; - } if (s->intr_eim == ON_OFF_AUTO_ON && !x86_iommu->intr_supported) { error_setg(errp, "eim=on cannot be selected without intremap=on"); return false; diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index 8a01a2d..7440cb8 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -25,6 +25,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "trace.h" +#include "sysemu/kvm.h" void x86_iommu_iec_register_notifier(X86IOMMUState *iommu, iec_notify_fn fn, void *data) @@ -94,6 +95,14 @@ static void x86_iommu_realize(DeviceState *dev, Error **errp) return; } + /* Both Intel and AMD IOMMU IR only support "kernel-irqchip={off|split}" */ + if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() && + !kvm_irqchip_is_split()) { + error_setg(errp, "Interrupt Remapping cannot work with " + "kernel-irqchip=on, please use 'split|off'."); + return; + } + if (x86_class->realize) { x86_class->realize(dev, errp); }