From patchwork Fri Sep 14 18:26:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10601139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7A7314BD for ; Fri, 14 Sep 2018 18:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94C952BAB9 for ; Fri, 14 Sep 2018 18:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 873712BAC8; Fri, 14 Sep 2018 18:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 060632BAB9 for ; Fri, 14 Sep 2018 18:28:40 +0000 (UTC) Received: from localhost ([::1]:52871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0spb-0000gt-E8 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Sep 2018 14:28:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0soS-0008Ll-FP for qemu-devel@nongnu.org; Fri, 14 Sep 2018 14:27:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0soP-0003Xt-Pe for qemu-devel@nongnu.org; Fri, 14 Sep 2018 14:27:28 -0400 Received: from mail-co1nam04on0607.outbound.protection.outlook.com ([2a01:111:f400:fe4d::607]:5920 helo=NAM04-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 1g0soP-0003Ug-Hd for qemu-devel@nongnu.org; Fri, 14 Sep 2018 14:27:25 -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=LQUJDfkZUE4PDXVKOHe1LKJJ9xtO26SGiqpTarVEa68=; b=UN3yL28XVOfEslTaUolW89Mxh9KfdVqeUyRqMPUxcnFuLMVWMEhTyTqX4un8zsbd5DPa9VjGW7btQXhUk0fXZAA+SunN222bjOqjpRT9pBMw9bQ/M5aIK2leSrg/KgnLwPvR9FZ55fvOA2ItiLmVAvU3znUtr6PWUJF6ZBkqdXE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from sbrijesh-desktop.amd.com (165.204.77.1) by DM6PR12MB2684.namprd12.prod.outlook.com (2603:10b6:5:4a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 14 Sep 2018 18:27:21 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Fri, 14 Sep 2018 13:26:56 -0500 Message-Id: <1536949623-23564-2-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536949623-23564-1-git-send-email-brijesh.singh@amd.com> References: <1536949623-23564-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BYAPR01CA0001.prod.exchangelabs.com (2603:10b6:a02:80::14) To DM6PR12MB2684.namprd12.prod.outlook.com (2603:10b6:5:4a::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2525229d-c406-4f3f-2e1f-08d61a6fb69e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM6PR12MB2684; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 3:12+euh3oNZngUvAMz4C78rZlSsGj83gPvJ2a1TVgHbtnB9pZPdlh9bfspApk3XSDaf5geWXX8UB2EnEisv4yz8mEOoul/m/9R8fHQjD/knHVXAgeJ5hlrNNigglWeb2vxhH/S2Dee+olyJy7FrRIjiMdaubyjMn/zmdurkvnQB6xq0OYsr7FGfEKRAfPuMLDajmrcbgGpjFjUGEp14f2XTVpqmBlc3tXzosr+OVWQ5x9iXwXq1oWscRowwdaz3yv; 25:b/evaRHY2vRAn3Cf8RmJx2CJokfTUuc3X0S9boFeFJvkEGLDRnvTRUhk7D5s3CgCDxvw3Dt9Tlas5+oMQJQdoZXzLxB7CJJ4q8ZB+WIuFuidPFcHcAZls7aOsMdtfZQJDMOsLBFhwqkUcnulULbl8s+hJfZRPBRdtJSKWv0UCNAPesWx+EIS7TUR9P33h/MWxYRshoy+14pmScsK5ikPDoxtNQmNxhW3cOYPjIEjDtkFt748T2JR5arzuYiqOsrgZTBBS4v5XLlJCVI2/uLaGTbikCfdR+1EQ0lwEN9VbO/WMZ50uVjqI5UG/M4D4t+9bhdzHUWHLyJqe9PV3JZ11w==; 31:U53NLVtctF4Jkfvsc4d1A9LRzJtN5GphHjUYw+beOMybq8dctgj7xDPrsNbThBwpAqhp5HMWj/Pf2LXfOuK81GA99C8j9WagtbctW/EnaLuDS/OQ5WvyTNH8g3pxBANtru1iq/vp3IcGilTJbVUdTU8BrIvzlwwnGaBcaGGm7eZGlZEDYlcSF+ms6BTd2R9CLaO/MtzXAVoic/xRAaMg8LxCDm7APg0Ap4ubsX0yRbQ= X-MS-TrafficTypeDiagnostic: DM6PR12MB2684: X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 20:LzP42XEiAqx4PzXIwTBXly9qblsJhdyCvCQkJc7uwK9D5YbEdeghcgvKChDF0OospXLXaqpfQQsYYIbGXEc3QfoOIKATRbj/Tn5VwowP1qRehK8KgtFC+YYa4jwOcEaT5ahPyJVuhSGAdOahGGsL1GoeHde3bbSU6bP9fBz2qsIItCycmDc/yR3h+3Rv2iwzjBzoUNo9cO8yZHm9/gg5GaFkZq4oNcx/8HiA4P5o5Uskk4AJ1xAIiSaV/92n+kIlZXVsy0oCawkiTbVFIsew7HxzF8Fg6EX4/+7xDAolLq0Qo1Eh9hg3jUmzIz6iuaVmzZnu3amc1GfWhKPkIUZViftXOZkJmWSjQwbZ1JuY7rqpFBSGQtn0hk40QdNBZHFCu2y8o90v97WpQzMF+N3dS65E5RGB0LXUKdymC+YrgD3cxkzBWnFIK8OEUOWi/7zAPX6sTTbb8AzwrL1zi6FBoOr7JA5KX6c4SxADB6MzRhk6K5fkbOatrc3oK40bb+tF; 4:QWeTu0mhJmENU5A7UsQdKXBXNvFraMvKLzX7zAJ1qPRuQttnO5w6ZZ9GAhYVHsm2IrCIgG4e3f7bLP2CKR4ceCDtgNnl94C0LYGsr4Yk5oOGt76Me4dnhiCSOstTgla+l6capw5opuyOPdauoKkD0JBrt7DY7rTIQeYc/sgmqDhf/vtAi7DH4EF+vXps8IfSB7AGiRek7R5blyIGZw+z/OtmNtTLhRoOrf4WpJs5Cu9vy+di73y0BbR+jc51XUB9auVZRWJf7TSmK2Qu9XOW8MC3EJyNYaM/bKKo2RkAyCzZcPUv336Zv0O+FvubQB4rARMqkNWvOXbmSHTD4gTeEy15eldLRzpXiG4cWIgu7rk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:DM6PR12MB2684; BCL:0; PCL:0; RULEID:; SRVR:DM6PR12MB2684; X-Forefront-PRVS: 07954CC105 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(366004)(189003)(199004)(50466002)(66066001)(48376002)(2906002)(25786009)(446003)(16586007)(6486002)(76176011)(39060400002)(7736002)(68736007)(51416003)(7696005)(305945005)(316002)(6666003)(6916009)(47776003)(53936002)(52116002)(386003)(956004)(486006)(11346002)(5660300001)(54906003)(2616005)(8676002)(478600001)(36756003)(476003)(186003)(44832011)(105586002)(2361001)(3846002)(106356001)(26005)(81166006)(81156014)(8936002)(2351001)(53416004)(16526019)(50226002)(4326008)(97736004)(6116002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2684; H:sbrijesh-desktop.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR12MB2684; 23:NPAqEisg22rkvZqpdPdgxw1M9gtJjmTPmFpOT1Uar?= nyesdeRqjFTQM54MnffRdHvNkv7JH1G3vsa43XzB4R8olT7m8YsAY7gBU7I3ggznn7/in+sQZPS+7sjSbFZmY+/b3Kcv+SoWrsjNgHKHbFflI8HQxSDihZNCaoPGl9Vbh8R1ciarpxpe193SvJ8Nfn2gVSGS0rk2uU0n8bHgmDRj/dYAGR0hoYDqmWnqN69xcbIumY0KAhevsl6rSrUp2aKADI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p3NoGwo+It70r6cHBDKrOGslPlzLvaIO9Wqs448AmM5x9IE8un2fyHPx6cOr8AiQj9/3nAE1aLgvf3xtW6//VE4vt7+Jr9UqpD335AGdAlCYNHcaxTSTuoWB6ffA3PWhNRaj/8dGMP3Uu4sg6Z1PlVGjgvpZ3jgWbNYh+CEx4Dp1A2myiHM+MQVI4Ijl06uXD1/bgDJg1aToT0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2684; 20:XEJ1aBwSqzpa1QLLRCP7a6JNbTXy3tTDlNyr/wzsaCKQIvIvlDiM008LGSWb52kXuah5jgzgfj9h72fVKWRbcGCK7ZSNHUlFkKNw5YQHsknHgzKaELmIyGYyAIrNOsgeJAjqSC/11HbCzwTA0HyU0g/Mrfn70E55+QIfGr/j+FqE1azyySRWm/y7tXbM0WZs/sFjY1O7V+B02uUwp55fHmE+7Vgc6ghcLfA8d6aB6iWAliEicHoznXpeT/VK4y9I X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 18:27:21.5367 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2525229d-c406-4f3f-2e1f-08d61a6fb69e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2684 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe4d::607 Subject: [Qemu-devel] [PATCH v2 1/8] 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: Tom Lendacky , Brijesh Singh , Eduardo Habkost , "Michael S. Tsirkin" , Paolo Bonzini , Suravee Suthikulpanit , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Tom Lendacky Cc: Suravee Suthikulpanit Reviewed-by: Eduardo Habkost --- 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); }