From patchwork Tue Nov 30 13:42:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 12647355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A191CC433EF for ; Tue, 30 Nov 2021 14:02:58 +0000 (UTC) Received: from localhost ([::1]:47664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms3ii-0003HU-7f for qemu-devel@archiver.kernel.org; Tue, 30 Nov 2021 09:02:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms3P5-0007bD-9t for qemu-devel@nongnu.org; Tue, 30 Nov 2021 08:42:39 -0500 Received: from [2607:7c80:54:e::133] (port=35974 helo=bombadil.infradead.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms3P2-0002mb-SL for qemu-devel@nongnu.org; Tue, 30 Nov 2021 08:42:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MAFvzvm9yPzRbdbUhmI26AoKprJGkAW3fVX8qCPQWkg=; b=0kkd6n7a5RqHhesfC0FHUDrkzD aZ8/yplmPD83ZVCQeGJPBIt1fKRY3Oi+jFlkD6l5P+lFIhVENSEkcAPKkoPCkXzo5WrNb43NZzVrA W26OceKMSt+3DGQRKMrQmww1deI/XTXtJO8boNf7J2sWLoIpxVrquiH+diI2B02hWqiCKgXyGqFkT 7TtFA4oG+Brf299CC9ggrSd6wbD3aRIzm8/hvHCTTdpVa+vpDSN7VazXV5h1i0issnsOWm2Kfcktu OXMQst5llSmkzVOExaiBlxpnS/uAkfX/mozxKcTMnUrHDxg/6vfaUUyKCfYWPzWfyv+lLnYTzYjLG U3BG17bA==; Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=freeip.amazon.com) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ms3Ox-005NYH-Rz; Tue, 30 Nov 2021 13:42:32 +0000 Message-ID: <26e2621ab6cef4d8c3e944dc9ebb6d2d0d5e9d2d.camel@infradead.org> Subject: [PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks From: David Woodhouse To: Claudio Fontana , "peter.maydell@linaro.org" , "pbonzini@redhat.com" Date: Tue, 30 Nov 2021 13:42:29 +0000 In-Reply-To: <41878a65209a3e1fc00bdafd216004c9f71b90fa.camel@infradead.org> References: <20210723112921.12637-1-cfontana@suse.de> <1102c315addf2f2fffc49222ab5be118e7ae9b0f.camel@amazon.co.uk> <483ebe21-2972-90c0-bc9a-ce922518632d@suse.de> <93efa230-fb6b-fdc7-a696-c555676da2b4@suse.de> <9990ade1-ccfa-a712-94c0-1667f5b3094f@suse.de> <41878a65209a3e1fc00bdafd216004c9f71b90fa.camel@infradead.org> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:7c80:54:e::133 (failed) Received-SPF: none client-ip=2607:7c80:54:e::133; envelope-from=BATV+3d53dfa5199d6a29bf1d+6673+infradead.org+dwmw2@bombadil.srs.infradead.org; helo=bombadil.infradead.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "alxndr@bu.edu" , "philmd@redhat.com" , "lovemrd@gmail.com" , "ehabkost@redhat.com" , "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We don't need to check kvm_enable_x2apic(). It's perfectly OK to support interrupt remapping even if we can't address CPUs above 254. Kind of pointless, but still functional. The check on kvm_enable_x2apic() needs to happen *anyway* in order to allow CPUs above 254 even without an IOMMU, so allow that to happen elsewhere. However, we do require the *split* irqchip in order to rewrite I/OAPIC destinations. So fix that check while we're here. Signed-off-by: David Woodhouse Acked-by: Claudio Fontana --- hw/i386/intel_iommu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 294499ee20..b0439d0fbf 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3746,15 +3746,10 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF; } if (s->intr_eim == ON_OFF_AUTO_ON && !s->buggy_eim) { - if (!kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_is_split()) { error_setg(errp, "eim=on requires accel=kvm,kernel-irqchip=split"); return false; } - if (!kvm_enable_x2apic()) { - error_setg(errp, "eim=on requires support on the KVM side" - "(X2APIC_API, first shipped in v4.7)"); - return false; - } } /* Currently only address widths supported are 39 and 48 bits */