Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp739477pxu; Wed, 2 Dec 2020 02:01:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuXS48dNziRZbiqicHCMquu0MDIO7/bttYDWS9ZHcSLLTLd6Q/P5BiOgB9hMmLrWkGd6AW X-Received: by 2002:a17:906:3704:: with SMTP id d4mr1561803ejc.338.1606903283713; Wed, 02 Dec 2020 02:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606903283; cv=none; d=google.com; s=arc-20160816; b=ZG7+hHSoSKjcMJbbKsh6MbqAlYi6g2Y0kJSwroHJ6BQ9XB2+mcJdrWVP26xVv1nz6f E345cXzIjTB67n1y6HZINp6hyXXZBwDduCEJtw3KAhZ01buce5ptw5L34VYeLsrOiuvV gZenYlM4ejZI2Cnflc+co3sehd5fGDMjwCRv7Cu5PXybqBQcHXg0RnyIrpv+0Q5cIj9x c9VhAi4jvTG8azslOF9Xbe5qDPJjZmDgPecvwzz3rpswm9DCFl7Yf8qmA4WawrO7WA95 +3I+L8Xnq7d266ADgxSkNuNUQZLfhfHOmpMA3U8PirhF1zvC/ui6tZRXN1x113CJ5RLQ BH4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=ITThREJyYKgdVDP8BrxeZZquiJpUQMhRfu4ZTflB4TU=; b=m9LI7OJcPdHUxJQe3ka0wbDuIUFYM9uTJ2UQ3xNPfy1so5vANh/Ioujvf7OfZAyeL4 Tyu3bgHGbaShwNueiytcocxyv/Inyg+amVlXRPHFq9MfTuWFDt9GURaeCSFbxr88HdCT G1K6iQdUjwmENSnC1YQeMqrhgkO8A3f5jlj4tXp9sAASGkJd88nZ4vBo1A2Bm8A3Lcrd ytKSFTO7qCFLaiae3BxBiyE/1Ewya5lswm4dIFlQNTRnxkXVLGzqTIrDS4ha28p0jHwZ kJSiBPVbcBH37y5H1ugxJCcYvjvm/KdmG8Vxds+mX4ExmFub+ixHivL3MVHuqH3jCoRe 2KXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=X3QAAs3c; dkim=neutral (no key) header.i=@linutronix.de header.b=b9neEEER; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si562606eju.429.2020.12.02.02.01.00; Wed, 02 Dec 2020 02:01:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=X3QAAs3c; dkim=neutral (no key) header.i=@linutronix.de header.b=b9neEEER; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388474AbgLBJ5G (ORCPT + 99 others); Wed, 2 Dec 2020 04:57:06 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:33016 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388462AbgLBJ5G (ORCPT ); Wed, 2 Dec 2020 04:57:06 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606902984; 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: in-reply-to:in-reply-to:references:references; bh=ITThREJyYKgdVDP8BrxeZZquiJpUQMhRfu4ZTflB4TU=; b=X3QAAs3ckISUUWG4JJlFph2NnRIwNeaLE3wK3ajpyTpKBnjYav53rMdiurQ4jGCRO/ygKG 6jWHI2XX4+cQh/csusD6wphm4zlZXxFsgI8aGpjw/0KVbgWRxwkVBFMfNzZB3Du79Hhefk 2xns0YmYm0KsJkHpJZDjYU4tPACPgBry7LF143jLh3WI6EjUcHRHXorOR6pLHPuE/TYWYQ OV8mh49Qw1BydybEM8hH/8Zd60WQVPnleuUX4LUVjq2jwGKQlPH+mTe3u7bo4YaZGVvWoP tWO1NQSdvtEl4b+wGxxJzc7oMfQSuhvy4hHxWC54vr8ISzzicscbvbnoYupQVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606902984; 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: in-reply-to:in-reply-to:references:references; bh=ITThREJyYKgdVDP8BrxeZZquiJpUQMhRfu4ZTflB4TU=; b=b9neEEERJjd556NoK2GzpE5+E8u4vImeIIA5ZyL6Bc2eNU2YeQvdgCzUZa2tWdMJsRKvgt 3EJixrTbLSI2NJCg== To: Dexuan Cui , dwmw@amazon.co.uk, x86@kernel.org, decui@microsoft.com, mikelley@microsoft.com, linux-hyperv@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Tianyu.Lan@microsoft.com, vkuznets@redhat.com, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org Subject: Re: [PATCH] iommu/hyper-v: Fix panic on a host without the 15-bit APIC ID support In-Reply-To: <20201202004510.1818-1-decui@microsoft.com> References: <20201202004510.1818-1-decui@microsoft.com> Date: Wed, 02 Dec 2020 10:56:23 +0100 Message-ID: <87wny0edko.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01 2020 at 16:45, Dexuan Cui wrote: > The commit f36a74b9345a itself is good, but it causes a panic in a > Linux VM that runs on a Hyper-V host that doesn't have the 15-bit > Extended APIC ID support: > kernel BUG at arch/x86/kernel/apic/io_apic.c:2408! This has nothing to do with the 15bit APIC ID support, really. The point is that the select() function only matches when I/O APIC ID is 0, which is not guaranteed. That's independent of the 15bit extended APIC ID feature. But the I/O-APIC ID is irrelevant on hyperv because there is only one. > This happens because the Hyper-V ioapic_ir_domain (which is defined in > drivers/iommu/hyperv-iommu.c) can not be found. Fix the panic by > properly claiming the only I/O APIC emulated by Hyper-V. We don't fix a panic. We fix a bug in the code :) I'll amend the changelog. Thanks, tglx