Re: [PATCH] LoongArch: Fix acpi_package_ids array overflow
Huacai Chen <[email protected]>
| Newsgroups | dev.linux.lists.loongarch,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <CAAhV-H7900J7RwUHnJFN7nXb+_SZzoA-xZ1aUGF_6OrjTr1D6w@mail.gmail.com> |
On Tue, Aug 4, 2026 at 4:57 PM Tao Cui <[email protected]> wrote: > > > > 在 2026/8/4 15:57, Bibo Mao 写道: > > With LoongArch virt machine, one typical setting is one core per socket, > > there will max 256 sockets on one VM. With PPTT acpi table, array > > acpi_package_ids will be overflowed. > > > > Here change array size of acpi_package_ids with max value of > > MAX_PACKAGES and KVM_MAX_VCPUS. > > > > Fixes: 4e8f58620f67 ("LoongArch: Retrieve CPU package ID from PPTT when available") > > Cc: [email protected] > > Signed-off-by: Bibo Mao <[email protected]> > > --- > > arch/loongarch/kernel/acpi.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/loongarch/kernel/acpi.c b/arch/loongarch/kernel/acpi.c > > index 873e90990771..cb454ee92b20 100644 > > --- a/arch/loongarch/kernel/acpi.c > > +++ b/arch/loongarch/kernel/acpi.c > > @@ -13,6 +13,7 @@ > > #include <linux/export.h> > > #include <linux/irq.h> > > #include <linux/irqdomain.h> > > +#include <linux/kvm_host.h> > > #include <linux/memblock.h> > > #include <linux/of_fdt.h> > > #include <linux/serial_core.h> > > @@ -202,7 +203,7 @@ static void __init acpi_process_madt(void) > > > > int pptt_enabled; > > static int acpi_nr_packages; > > -static int acpi_package_ids[MAX_PACKAGES]; > > +static int acpi_package_ids[MAX(MAX_PACKAGES, KVM_MAX_VCPUS)]; > > > > int __init parse_acpi_topology(void) > > { > > > > base-commit: 075b74841bd0065a3bda3440873c747938e69b68 > Reviewed-by: Tao Cui <[email protected]> Applied, thanks. Huacai >