From: Dexuan Cui <decui@microsoft.com>
To: tglx@linutronix.de, 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: [PATCH] iommu/hyper-v: Fix panic on a host without the 15-bit APIC ID support
Date: Tue, 1 Dec 2020 16:45:10 -0800 [thread overview]
Message-ID: <20201202004510.1818-1-decui@microsoft.com> (raw)
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 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.
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Fixes: f36a74b9345a ("x86/ioapic: Use I/O-APIC ID for finding irqdomain, not index")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
drivers/iommu/hyperv-iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
This patch is for the tip.git tree's x86/apic branch.
diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
index 9438daa24fdb..1d21a0b5f724 100644
--- a/drivers/iommu/hyperv-iommu.c
+++ b/drivers/iommu/hyperv-iommu.c
@@ -105,8 +105,8 @@ static int hyperv_irq_remapping_select(struct irq_domain *d,
struct irq_fwspec *fwspec,
enum irq_domain_bus_token bus_token)
{
- /* Claim only the first (and only) I/OAPIC */
- return x86_fwspec_is_ioapic(fwspec) && fwspec->param[0] == 0;
+ /* Claim the only I/O APIC emulated by Hyper-V */
+ return x86_fwspec_is_ioapic(fwspec);
}
static const struct irq_domain_ops hyperv_ir_domain_ops = {
base-commit: d1adcfbb520c43c10fc22fcdccdd4204e014fb53
--
2.27.0
next reply other threads:[~2020-12-02 0:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 0:45 Dexuan Cui [this message]
2020-12-02 1:28 ` [PATCH] iommu/hyper-v: Fix panic on a host without the 15-bit APIC ID support Woodhouse, David
2020-12-02 9:56 ` Thomas Gleixner
2020-12-02 19:53 ` Dexuan Cui
2020-12-02 10:28 ` [tip: x86/apic] iommu/hyper-v: Remove I/O-APIC ID check from hyperv_irq_remapping_select() tip-bot2 for Dexuan Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201202004510.1818-1-decui@microsoft.com \
--to=decui@microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=dwmw@amazon.co.uk \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.