aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2022-02-16 19:37:34 +0800
committerWill Deacon <will@kernel.org>2022-02-16 15:43:31 +0000
commitd4d6f1538966e211913db5d522e67ed65d73625d (patch)
tree3ea420767117a63cfda3ff22e34c58bcd2ae15b6
parentcdd7d8cc0109bb8e2a0a04c5fe904b5ad4f07a80 (diff)
downloadkvmtool-d4d6f1538966e211913db5d522e67ed65d73625d.tar.gz
x86: Fix initialization of irq mptable
When dev_hdr->dev_num is greater one, the initialization of last_addr is wrong. Fix it. Fixes: f83cd16 ("kvm tools: irq: replace the x86 irq rbtree with the PCI device tree") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20220216113735.52240-1-songmuchun@bytedance.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--x86/mptable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/x86/mptable.c b/x86/mptable.c
index a984de9e..f13cf0f7 100644
--- a/x86/mptable.c
+++ b/x86/mptable.c
@@ -184,7 +184,7 @@ int mptable__init(struct kvm *kvm)
mpc_intsrc = last_addr;
mptable_add_irq_src(mpc_intsrc, pcibusid, srcbusirq, ioapicid, pci_hdr->irq_line);
- last_addr = (void *)&mpc_intsrc[dev_hdr->dev_num];
+ last_addr = (void *)&mpc_intsrc[1];
nentries++;
dev_hdr = device__next_dev(dev_hdr);
}